Re: shell-script-mode

"Stephen J. Turnbull" <[email protected]>
Newsgroups gmane.emacs.xemacs.general
Organization The XEmacs Project
Message-ID <[email protected]>
>>>>> "Emilie" == Emilie Vanvyve <[email protected]> writes:

    Emilie> The problem is the following : on the Mac, when I open my
    Emilie> script files, XEmacs automatically recognizes that they
    Emilie> are shell scripts and automatically turns to the major
    Emilie> mode 'shell-script' and fontifies also all according to my
    Emilie> colours set-up. No matters if they are in ksh or bash, it
    Emilie> works.  On the other machine, it does not work.

Please tell us what the value of load-path is on the machine where it
doesn't work.  You may not have the packages installed there, in which
case you're out of luck, unless you can install them in ~/.xemacs
(mkdir ~/.xemacs/xemacs-packages and ~/.xemacs/mule-packages, download
the current sumos, untar the regular sumo in xemacs-packages and the
mule sumo in mule-packages).

If the packages are already installed, then probably what is happening
is that they have not been updated in ages (over a year, I'd guess).
The method for setting up auto-mode-alist changed around 21.4.12, and
you need reasonably recent (less than a year old) packages for this to
work correctly.

First, try hard to get the admin to update the packages.  They're
really old, many bugs have been fixed and features added.  Not to
mention that the workaround below will undoubtedly come back to bite
you some day.  Second, you can install packages yourself as above.  In
that case you may find that setting EMACSPACKAGEPATH=~/.xemacs in your
environment avoids problems with package shadows from the old
versions.  (This is optional.)

If the admin is unsympathetic and you can't for some reason install
your own set of packages, try putting the expression below in your
init file.

(setq auto-mode-alist
  '(("\\.te?xt\\'" . text-mode)
    ("\\.[chi]\\'" . c-mode)
    ("\\.el\\'" . emacs-lisp-mode)
    ("\\.\\(?:[CH]\\|cc\\|hh\\)\\'" . c++-mode)
    ("\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\'" . c++-mode)
    ("\\.java\\'" . java-mode)
    ("\\.idl\\'" . idl-mode)
    ("\\.f\\(?:or\\)?\\'" . fortran-mode)
    ("\\.F\\(?:OR\\)?\\'" . fortran-mode)
    ("\\.[fF]90\\'" . f90-mode)
;;; Less common extensions come here
;;; so more common ones above are found faster.
    ("\\.\\([pP][Llm]\\|al\\)\\'" . perl-mode)
    ("\\.py\\'" . python-mode)
    ("\\.texi\\(?:nfo\\)?\\'" . texinfo-mode)
    ("\\.ad[abs]\\'" . ada-mode)
    ("\\.c?l\\(?:i?sp\\)?\\'" . lisp-mode)
    ("\\.p\\(?:as\\)?\\'" . pascal-mode)
    ("\\.ltx\\'" . latex-mode)
    ("\\.[sS]\\'" . asm-mode)
    ("[Cc]hange.?[Ll]og?\\(?:.[0-9]+\\)?\\'" . change-log-mode)
    ("\\$CHANGE_LOG\\$\\.TXT" . change-log-mode)
    ("\\.scm?\\(?:\\.[0-9]*\\)?\\'" . scheme-mode)
    ("\\.e\\'" . eiffel-mode)
    ("\\.mss\\'" . scribe-mode)
    ("\\.m\\(?:[mes]\\|an\\)\\'" . nroff-mode)
    ("\\.icn\\'" . icon-mode)
    ("\\.\\(?:[ckz]?sh\\|shar\\)\\'" . sh-mode)
    ("\\.[Pp][Rr][Oo]\\'" . idlwave-mode)
    ("\\.si\\(v\\|eve\\)\\'" . sieve-mode)
    ;; #### Unix-specific!
    ("/\\.\\(?:bash_\\|z\\)?\\(profile\\|login\\|logout\\)\\'" . sh-mode)
    ("/\\.\\(?:[ckz]sh\\|bash\\|tcsh\\|es\\|xinit\\|startx\\)rc\\'" . sh-mode)
    ("/\\.\\(?:[kz]shenv\\|xsession\\)\\'" . sh-mode)
    ("\\.m?spec$" .sh-mode)
    ;; The following come after the ChangeLog pattern for the sake of
    ;; ChangeLog.1, etc. and after the .scm.[0-9] pattern too.
    ("\\.[123456789]\\'" . nroff-mode)
    ("\\.[tT]e[xX]\\'" . tex-mode)
    ("\\.\\(?:sty\\|cls\\|bbl\\)\\'" . latex-mode)
    ("\\.bib\\'" . bibtex-mode)
    ("\\.article\\'" . text-mode)
    ("\\.letter\\'" . text-mode)
    ("\\.\\(?:tcl\\|exp\\)\\'" . tcl-mode)
    ("\\.wrl\\'" . vrml-mode)
    ("\\.awk\\'" . awk-mode)
    ("\\.prolog\\'" . prolog-mode)
    ("\\.\\(?:arc\\|zip\\|lzh\\|zoo\\)\\'" . archive-mode)
    ;; Mailer puts message to be edited in /tmp/Re.... or Message
    ;; #### Unix-specific!
    ("\\`/tmp/Re" . text-mode)
    ("/Message[0-9]*\\'" . text-mode)
    ("/drafts/[0-9]+\\'" . mh-letter-mode)
    ;; some news reader is reported to use this
    ("^/tmp/fol/" . text-mode)
    ("\\.y\\'" . c-mode)
    ("\\.lex\\'" . c-mode)
    ("\\.m\\'" . objc-mode)
    ("\\.oak\\'" . scheme-mode)
    ("\\.[sj]?html?\\'" . html-mode)
    ("\\.jsp\\'" . html-mode)
    ("\\.xml\\'" . xml-mode)
    ("\\.\\(?:sgml?\\|dtd\\)\\'" . sgml-mode)
    ("\\.c?ps\\'" . postscript-mode)
    ;; .emacs following a directory delimiter in either Unix or
    ;; Windows syntax.
    ("[/\\][._].*emacs\\'" . emacs-lisp-mode)
    ("\\.m4\\'" . autoconf-mode)
    ("configure\\(\\.in\\|\\.ac\\)\\'" . autoconf-mode)
    ("\\.ml\\'" . lisp-mode)
    ("\\.ma?ke?\\'" . makefile-mode)
    ("\\(GNU\\)?[Mm]akefile\\(\\.\\|\\'\\)" . makefile-mode)
    ("[./\\]X\\(defaults\\|environment\\|resources\\|modmap\\)\\'" . xrdb-mode)
    ;; #### The following three are Unix-specific (but do we care?)
    ("/app-defaults/" . xrdb-mode)
    ("\\.[^/]*wm2?\\(?:rc\\)?\\'" . winmgr-mode)
    ("\\.\\(?:jpe?g\\|JPE?G\\|png\\|PNG\\|gif\\|GIF\\|tiff?\\|TIFF?\\)\\'" . im
ge-mode)
    ))
-- 
Institute of Policy and Planning Sciences     http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
               Ask not how you can "do" free software business;
              ask what your business can "do for" free software.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.