GNU bug report logs -
#9110
how to map sh-mode to mean bash-mode
Previous Next
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.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9110 in the body.
You can then email your comments to 9110 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#9110
; Package
emacs
.
(Sun, 17 Jul 2011 20:43:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
jidanni <at> jidanni.org
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 17 Jul 2011 20:43:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Dear bug-gnu-emacs,
There is no way to map sh-mode to bash-mode.
As you know, the bash shell likes to call itself sh sometimes.
But it is really still bash.
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. See also
http://lists.gnu.org/archive/html/help-gnu-emacs/2011-07/msg00143.html
However the real solution should be a one liner of lisp in ones .emacs.
Reply sent
to
Glenn Morris <rgm <at> gnu.org>
:
You have taken responsibility.
(Sun, 17 Jul 2011 23:03:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
jidanni <at> jidanni.org
:
bug acknowledged by developer.
(Sun, 17 Jul 2011 23:03:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 9110-done <at> debbugs.gnu.org (full text, mbox):
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"))))
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#9110
; Package
emacs
.
(Sun, 17 Jul 2011 23:54:02 GMT)
Full text and
rfc822 format available.
Message #13 received at 9110 <at> debbugs.gnu.org (full text, mbox):
>>>>> "GbTS" == GNU bug Tracking System <help-debbugs <at> gnu.org> writes:
GbTS> (add-hook 'sh-mode-hook
GbTS> '(lambda () (and buffer-file-name
GbTS> (string-match "\\.sh\\'" buffer-file-name)
GbTS> (sh-set-shell "bash"))))
Thanks, but that doesn't also cover the case when there is a #!/bin/sh
but no .sh or .bash.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#9110
; Package
emacs
.
(Mon, 18 Jul 2011 04:52:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 9110 <at> debbugs.gnu.org (full text, mbox):
>>>>> "SM" == Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
SM> Check C-h m to see how to control them.
Got it!
(add-to-list 'sh-alias-alist '(sh . bash))
Thanks!
I declare this thread closed.
Bye.
See ya.
Adios.
Hasta la pasta.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#9110
; Package
emacs
.
(Mon, 18 Jul 2011 05:53:02 GMT)
Full text and
rfc822 format available.
Message #19 received at submit <at> debbugs.gnu.org (full text, mbox):
Am 17.07.2011 22:42, schrieb jidanni <at> jidanni.org:
> Dear bug-gnu-emacs,
> There is no way to map sh-mode to bash-mode.
Again: AFAIK there no such thing like `bash-mode' in Emacs.
There is a `sh-mode' dealing with several kind of shells.
If `sh-mode' thinks you are dealing with a bash -- by shebang or
suffix-- it provides for it. An alias is called `shell-script-mode'
See C-h f shell-script-mode RET
for what it does.
> As you know, the bash shell likes to call itself sh sometimes.
Didn't know that. Curious to read an example.
> But it is really still bash.
Well, bash might use a sh as a subset. Don't know that architecture.
> 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.
Could you deliver an example of usage for that?
If you send code written for a bash to a simple sh - some may work,
others will fail.
You are surely implementing bugs then.
See also
> http://lists.gnu.org/archive/html/help-gnu-emacs/2011-07/msg00143.html
> However the real solution should be a one liner of lisp in ones .emacs.
>
What's great about a one-liner? Usually they are hard to read.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#9110
; Package
emacs
.
(Mon, 18 Jul 2011 15:44:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 9110 <at> debbugs.gnu.org (full text, mbox):
> Thanks, but that doesn't also cover the case when there is a #!/bin/sh
> but no .sh or .bash.
If it says #!/bin/sh then it really shouldn't use bashisms.
Use #!/bin/bash for that.
Stefan
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#9110
; Package
emacs
.
(Wed, 20 Jul 2011 00:00:04 GMT)
Full text and
rfc822 format available.
Message #25 received at 9110 <at> debbugs.gnu.org (full text, mbox):
OK, I perfected it:
(eval-after-load "sh-script" '(add-to-list 'sh-alias-alist '(sh . bash)))
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 17 Aug 2011 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 13 years and 305 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.