Commit e3998da1 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(interpreter-mode-alist): Add wishx, tclsh.

Delete form, scope, shell.
(set-auto-mode): Don't get confused by args after #! shell name.
parent 7dbf7369
...@@ -847,11 +847,10 @@ again for another match.") ...@@ -847,11 +847,10 @@ again for another match.")
(defconst interpreter-mode-alist (defconst interpreter-mode-alist
'(("perl" . perl-mode) '(("perl" . perl-mode)
("scope" . tcl-mode)
("wish" . tcl-mode) ("wish" . tcl-mode)
("shell" . tcl-mode) ("wishx" . tcl-mode)
("form" . tcl-mode)
("tcl" . tcl-mode) ("tcl" . tcl-mode)
("tclsh" . tcl-mode)
("awk" . awk-mode) ("awk" . awk-mode)
("gawk" . awk-mode) ("gawk" . awk-mode)
("scm" . scheme-mode)) ("scm" . scheme-mode))
...@@ -871,10 +870,13 @@ If it matches, mode MODE is selected.") ...@@ -871,10 +870,13 @@ If it matches, mode MODE is selected.")
(defun set-auto-mode () (defun set-auto-mode ()
"Select major mode appropriate for current buffer. "Select major mode appropriate for current buffer.
This checks for a -*- mode tag in the buffer's text, or This checks for a -*- mode tag in the buffer's text,
compares the filename against the entries in `auto-mode-alist'. It does compares the filename against the entries in `auto-mode-alist',
not check for the \"mode:\" local variable in the Local Variables or checks the interpreter that runs this file against
section of the file; for that, use `hack-local-variables'. `interpreter-mode-alist'.
It does not check for the `mode:' local variable in the
Local Variables section of the file; for that, use `hack-local-variables'.
If `enable-local-variables' is nil, this function does not check for a If `enable-local-variables' is nil, this function does not check for a
-*- mode tag." -*- mode tag."
...@@ -958,11 +960,9 @@ If `enable-local-variables' is nil, this function does not check for a ...@@ -958,11 +960,9 @@ If `enable-local-variables' is nil, this function does not check for a
(let ((interpreter (let ((interpreter
(save-excursion (save-excursion
(goto-char (point-min)) (goto-char (point-min))
(if (looking-at "#! *") (if (looking-at "#! *\\([^ \t\n]+\\)")
(progn (buffer-substring (match-beginning 1)
(goto-char (match-end 0)) (match-end 1))
(buffer-substring (point)
(progn (end-of-line) (point))))
""))) "")))
elt) elt)
;; Map interpreter name to a mode. ;; Map interpreter name to a mode.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment