[PATCH] emacs: Make the shell location configurable

Tomi Ollila tomi.ollila at iki.fi
Thu Aug 17 05:15:21 PDT 2017


On Thu, Aug 17 2017, David Bremner wrote:

> Robert Ewald <robewald at gmx.net> writes:
>
>>> On 16 Aug 2017, at 13:09, David Bremner <david at tethera.net> wrote:
>>> 
>>> Robert Ewald <robewald at gmx.net> writes:
>>> 
>>>>> On 16 Aug 2017, at 01:38, David Bremner <david at tethera.net> wrote:
>>> 
>>>> I did some research: apparently shell-file-name should be POSIX compatible,
>>>> otherwise many plugins don't work. explicit-shell-file-name however can be set to
>>>> fish or tcsh if you want to use that in M-x shell.
>>>> 
>>> 
>>> Is the requirement for shell-file-name to be POSIX compatible documented
>>> somewhere in the emacs documentation?
>>
>> Not that I could find.
>>
>> Robert
>
> OK, then I think we'd better be conservative in notmuch. Anecdotally I
> think it is set to some *csh on BSD variants and (!) cmd.exe on windows
> by default. We don't want people to have to change a default global
> setting to use notmuch.  I believe there is work in progress to support
> 'make-process' which is new in emacs25, and would eliminate the need for
> a shell wrapper there.

The effective line

/bin/sh -c ' exec 2>"$1"; shift; exec "$0" "$@" ' args...

Is neat trick (created by Austin, I[I]RC 2013-05) to have the command started
from emacs redirect stderr to a file while preserving argument list.
Before that we sometimes got errors intermixed to the output and sexp
parsing failed. I tried an alternative --stderr=FILE patch to notmuch,
which was applied, and then reverted by followup patch from me -- it
was useless as using that e.g. in remote notmuch use would have written
stderr on *remote* system and not locally. 

I tested what shell-file-name is defined by default on a freebsd KVM
instance -- it is /bin/csh -- and /bin/csh -c ' exec 2>"$1" '; does not work.

Many of have to host private patches to get their things work on their
"niche" ;) operating environments. Until (and if) emacs 25 make-process
approach is feasible, perhaps you have to host your own there.

Anyway, it is nice to see use of notmuch in many alternative systems, keep
up the good work!

Tomi

>
> d


More information about the notmuch mailing list