GNU bug report logs - #9110
how to map sh-mode to mean bash-mode

Previous Next

Package: emacs;

Reported by: jidanni <at> jidanni.org

Date: Sun, 17 Jul 2011 20:43:01 UTC

Severity: wishlist

Tags: notabug

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 9110-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 9110-done <at> debbugs.gnu.org
Subject: Re: bug#9110: how to map sh-mode to mean bash-mode
Date: Sun, 17 Jul 2011 19:02:26 -0400
jidanni <at> jidanni.org wrote:

> As you know, the bash shell likes to call itself sh sometimes.
> But it is really still bash.

No, it isn't.

> Hence I would like to make my emacs assume anything it thinks is sh is
> really bash, and thus show me "bash" in the mode line, not "sh", no
> matter how smart it thinks it is.

(add-hook 'sh-mode-hook
          '(lambda () (and buffer-file-name
                           (string-match "\\.sh\\'" buffer-file-name)
                           (sh-set-shell "bash"))))




This bug report was last modified 14 years ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.