diff options
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/files.el | 23 |
2 files changed, 12 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d38b0ce8e49..393c2331fa7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2005-04-10 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2005-04-10 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * files.el (set-auto-mode-1): Use line-end-position. | ||
| 4 | |||
| 3 | * international/latin-1.el: | 5 | * international/latin-1.el: |
| 4 | * international/latin-2.el: | 6 | * international/latin-2.el: |
| 5 | * international/latin-3.el: | 7 | * international/latin-3.el: |
diff --git a/lisp/files.el b/lisp/files.el index eca86c52a79..d5e98672d27 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2113,22 +2113,19 @@ Otherwise, return nil; point may be changed." | |||
| 2113 | (setq temp (cdr temp))) | 2113 | (setq temp (cdr temp))) |
| 2114 | (not temp)) | 2114 | (not temp)) |
| 2115 | 2115 | ||
| 2116 | (search-forward "-*-" (save-excursion | 2116 | (search-forward "-*-" (line-end-position |
| 2117 | ;; If the file begins with "#!" | 2117 | ;; If the file begins with "#!" |
| 2118 | ;; (exec interpreter magic), look | 2118 | ;; (exec interpreter magic), look |
| 2119 | ;; for mode frobs in the first two | 2119 | ;; for mode frobs in the first two |
| 2120 | ;; lines. You cannot necessarily | 2120 | ;; lines. You cannot necessarily |
| 2121 | ;; put them in the first line of | 2121 | ;; put them in the first line of |
| 2122 | ;; such a file without screwing up | 2122 | ;; such a file without screwing up |
| 2123 | ;; the interpreter invocation. | 2123 | ;; the interpreter invocation. |
| 2124 | (end-of-line (and (looking-at "^#!") 2)) | 2124 | (and (looking-at "^#!") 2)) t) |
| 2125 | (point)) t) | ||
| 2126 | (progn | 2125 | (progn |
| 2127 | (skip-chars-forward " \t") | 2126 | (skip-chars-forward " \t") |
| 2128 | (setq beg (point)) | 2127 | (setq beg (point)) |
| 2129 | (search-forward "-*-" | 2128 | (search-forward "-*-" (line-end-position) t)) |
| 2130 | (save-excursion (end-of-line) (point)) | ||
| 2131 | t)) | ||
| 2132 | (progn | 2129 | (progn |
| 2133 | (forward-char -3) | 2130 | (forward-char -3) |
| 2134 | (skip-chars-backward " \t") | 2131 | (skip-chars-backward " \t") |