summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2005-04-10 20:50:48 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2005-04-10 20:50:48 +0000
commitf587e30b7fdd23929d3e6639ad5d81dfeffb0e35 (patch)
tree57aa5d1cbf1fd4cf9e7993c881978a6fcef93b59 /lisp
parent35f257bb579d7f793d3072fbc2b9fbc04b1a0867 (diff)
downloademacs-f587e30b7fdd23929d3e6639ad5d81dfeffb0e35.tar.gz
emacs-f587e30b7fdd23929d3e6639ad5d81dfeffb0e35.tar.bz2
emacs-f587e30b7fdd23929d3e6639ad5d81dfeffb0e35.zip
(set-auto-mode-1): Use line-end-position.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/files.el23
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 @@
2005-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
+ * files.el (set-auto-mode-1): Use line-end-position.
+
* international/latin-1.el:
* international/latin-2.el:
* 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."
(setq temp (cdr temp)))
(not temp))
- (search-forward "-*-" (save-excursion
- ;; If the file begins with "#!"
- ;; (exec interpreter magic), look
- ;; for mode frobs in the first two
- ;; lines. You cannot necessarily
- ;; put them in the first line of
- ;; such a file without screwing up
- ;; the interpreter invocation.
- (end-of-line (and (looking-at "^#!") 2))
- (point)) t)
+ (search-forward "-*-" (line-end-position
+ ;; If the file begins with "#!"
+ ;; (exec interpreter magic), look
+ ;; for mode frobs in the first two
+ ;; lines. You cannot necessarily
+ ;; put them in the first line of
+ ;; such a file without screwing up
+ ;; the interpreter invocation.
+ (and (looking-at "^#!") 2)) t)
(progn
(skip-chars-forward " \t")
(setq beg (point))
- (search-forward "-*-"
- (save-excursion (end-of-line) (point))
- t))
+ (search-forward "-*-" (line-end-position) t))
(progn
(forward-char -3)
(skip-chars-backward " \t")