Bug 10798

Summary: Emacs shell-script mode doesn't know about bash2
Product: [Retired] Red Hat Linux Reporter: Richard Cobbe <rcc>
Component: emacsAssignee: Cristian Gafton <gafton>
Status: CLOSED RAWHIDE QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 6.2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-04-18 16:55:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Richard Cobbe 2000-04-13 17:52:55 UTC
As shipped, emacs's shell-script mode and supporting utilities don't know
anything about bash2.  As a result, when one opens a file whose first line
is

#!/bin/bash2

it comes up in text mode, rather than shell-script mode.  Easily fixed with
a M-x shell-script-mode, but still annoying.

To fix, run the following when emacs is initialized:

(require 'sh-script)
(setq interpreter-mode-alist (cons '("bash2" . sh-mode)
                                   interpreter-mode-alist))
(setq sh-ancestor-alist (cons '(bash2 . jsh) sh-ancestor-alist))
(setq sh-alias-alist (cons '(bash2 . bash) sh-alias-alist))

I'm not really sure where to put this: /etc/skel/.emacs will only work for
new users, and I don't know that I like putting that (require 'sh-script)
in site-init.el before a build---why load packages when you're not sure
you're going to need them?  Perhaps someone who is more skilled with
emacs-lisp than I am can find a better solution.

Comment 1 Trond Eivind Glomsrxd 2000-04-18 16:55:59 UTC
I've patched it into emacs 20.6, it should be available in next rawhide (20.6-3
or higher)