unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Changing sh-mode shell type.
@ 2011-10-27 13:52 Oleksandr Gavenko
  2011-11-08  6:18 ` Kevin Rodgers
  0 siblings, 1 reply; 2+ messages in thread
From: Oleksandr Gavenko @ 2011-10-27 13:52 UTC (permalink / raw)
  To: help-gnu-emacs

According to 'sh-mode':

   If you generally program a shell different from your login shell
   you can set `sh-shell-file' accordingly.

As usual I try add:

   # -*- sh-shell-file: "/bin/zsh"; mode: sh -*-

but it set to "bash" in any case...

I debug issue and found that when you enter into
'sh-mode' function 'sh-shell-file' have value "/bin/bash"
as it set by:

   (defcustom sh-shell-file ...)

so executed:

   (sh-set-shell
    (cond ((save-excursion
         ....  ....
          (t
           sh-shell-file))
     nil nil)

It is possible pass file local variable before mode activation
code was executed??




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Changing sh-mode shell type.
  2011-10-27 13:52 Changing sh-mode shell type Oleksandr Gavenko
@ 2011-11-08  6:18 ` Kevin Rodgers
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2011-11-08  6:18 UTC (permalink / raw)
  To: help-gnu-emacs

On 10/27/11 7:52 AM, Oleksandr Gavenko wrote:
> According to 'sh-mode':
>
> If you generally program a shell different from your login shell
> you can set `sh-shell-file' accordingly.

The next sentence is:

If your shell's file name doesn't correctly
indicate what shell it is use `sh-alias-alist' to translate.

> As usual I try add:
>
> # -*- sh-shell-file: "/bin/zsh"; mode: sh -*-
>
> but it set to "bash" in any case...

Why not specify your shell's file name:

#!/bin/zsh

> I debug issue and found that when you enter into
> 'sh-mode' function 'sh-shell-file' have value "/bin/bash"
> as it set by:
>
> (defcustom sh-shell-file ...)
>
> so executed:
>
> (sh-set-shell
> (cond ((save-excursion
> .... ....
> (t
> sh-shell-file))
> nil nil)
>
> It is possible pass file local variable before mode activation
> code was executed??

-- 
Kevin Rodgers
Denver, Colorado, USA




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-08  6:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-27 13:52 Changing sh-mode shell type Oleksandr Gavenko
2011-11-08  6:18 ` Kevin Rodgers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).