emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Small shell-mode patch to handle auto-cd (e.g. shells like zsh)


From: Jason Kim
Subject: Re: Small shell-mode patch to handle auto-cd (e.g. shells like zsh)
Date: Fri, 7 May 2021 09:35:16 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1


Working on it now,  Expect the git format-patch shortly
But just to set the stage.... a few comments.

On 5/6/21 1:23 AM, Eli Zaretskii wrote:

  . A few comments on the code itself:

+(defvar shell-has-auto-cd nil
+  "if set to true, shell-mode assumes that a command that resolves to a 
directory
+is an implicit cd command. Useful for shells like zsh that has this feature.")

This should be a defcustom, so that users could customize it easily.

done.

The first line of the doc string should be a single complete
sentence.  Something like this:

   If non-nil, `shell-mode' will automatically process implicit \"cd\" commands.

Yep that's lot better :-) thanks!


(Then in the following text of the doc string explain what does
"implicit cd command" mean in this context.)

Should this variable's value be computed automatically based on the
shell's name?

I don't think so... If only because its an option that needs enabling in zsh as well?


-               end cmd arg1)
+               end cmd arg1 cmdS)

I wonder if you could find a more descriptive name for the cmdS
variable.

cmdS --> cmd-subst-fn

> michael.albinus@gmx.de writes
>- Several different shells could be used in an Emacs session, depending
>  where you run the shell, locally or on a remote host. So it might be
>  problematic to have just one fixed global value.

I'm confused...?
Would making the variable buffer-local in a user's .emacs address this?

dir tracking (for things like auto completion) never worked for me if I ssh into a different host from emacs-shell.
(maybe because pattern globbing rules are more complex (optionally) in zsh?)
What am I missing here?

Can we skip this issue for now? (or does making the var buffer-local get around it?)

Thank!!!
-jason



reply via email to

[Prev in Thread] Current Thread [Next in Thread]