diff options
| author | Roland McGrath | 1993-04-19 20:27:50 +0000 |
|---|---|---|
| committer | Roland McGrath | 1993-04-19 20:27:50 +0000 |
| commit | a292c99fb50462827fc42625de737bdeade7f1eb (patch) | |
| tree | 9d9593fd615ed7480f1d37ca2952a3375ffdb432 | |
| parent | 5e6cb310a7b0da7f7331aa9c391e1d1e4dafa79b (diff) | |
| download | emacs-a292c99fb50462827fc42625de737bdeade7f1eb.tar.gz emacs-a292c99fb50462827fc42625de737bdeade7f1eb.zip | |
(set-auto-mode): If the buffer begins with "#!", look for -*- in the first
two lines, not just the first one.
| -rw-r--r-- | lisp/files.el | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el index 5d1b91ce823..3423d87f2ce 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; files.el --- file input and output commands for Emacs | 1 | ;;; files.el --- file input and output commands for Emacs |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1985, 1986, 1987, 1992, 1993 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Maintainer: FSF | 5 | ;; Maintainer: FSF |
| 6 | 6 | ||
| @@ -694,7 +694,16 @@ If `enable-local-variables' is nil, this function does not check for a | |||
| 694 | (goto-char (point-min)) | 694 | (goto-char (point-min)) |
| 695 | (skip-chars-forward " \t\n") | 695 | (skip-chars-forward " \t\n") |
| 696 | (if (and enable-local-variables | 696 | (if (and enable-local-variables |
| 697 | (search-forward "-*-" (save-excursion (end-of-line) (point)) t) | 697 | (search-forward "-*-" (save-excursion |
| 698 | ;; If the file begins with "#!" | ||
| 699 | ;; (exec interpreter magic), look | ||
| 700 | ;; for mode frobs in the first two | ||
| 701 | ;; lines. You cannot necessarily | ||
| 702 | ;; put them in the first line of | ||
| 703 | ;; such a file without screwing up | ||
| 704 | ;; the interpreter invocation. | ||
| 705 | (end-of-line (and (looking-at "^#!") 2)) | ||
| 706 | (point)) t) | ||
| 698 | (progn | 707 | (progn |
| 699 | (skip-chars-forward " \t") | 708 | (skip-chars-forward " \t") |
| 700 | (setq beg (point)) | 709 | (setq beg (point)) |