]> git.eshelyaron.com Git - emacs.git/commitdiff
* emacs-lisp/lisp-mnt.el (lm-header): save-excursion
authorArtur Malabarba <bruce.connor.am@gmail.com>
Wed, 12 Aug 2015 07:52:42 +0000 (08:52 +0100)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Wed, 12 Aug 2015 07:55:38 +0000 (08:55 +0100)
lisp/emacs-lisp/lisp-mnt.el

index 104c23c210236e098e09ca403267bf7208d5ca7d..01ba656450a1cedc2a87a2eb08d60140d7b0f44d 100644 (file)
@@ -265,16 +265,17 @@ a section."
 
 (defun lm-header (header)
   "Return the contents of the header named HEADER."
-  (goto-char (point-min))
-  (let ((case-fold-search t))
-    (when (and (re-search-forward (lm-get-header-re header) (lm-code-mark) t)
-              ;;   RCS ident likes format "$identifier: data$"
-              (looking-at
-               (if (save-excursion
-                     (skip-chars-backward "^$" (match-beginning 0))
-                     (= (point) (match-beginning 0)))
-                   "[^\n]+" "[^$\n]+")))
-      (match-string-no-properties 0))))
+  (save-excursion
+    (goto-char (point-min))
+    (let ((case-fold-search t))
+      (when (and (re-search-forward (lm-get-header-re header) (lm-code-mark) t)
+                 ;;   RCS ident likes format "$identifier: data$"
+                 (looking-at
+                  (if (save-excursion
+                        (skip-chars-backward "^$" (match-beginning 0))
+                        (= (point) (match-beginning 0)))
+                      "[^\n]+" "[^$\n]+")))
+        (match-string-no-properties 0)))))
 
 (defun lm-header-multiline (header)
   "Return the contents of the header named HEADER, with continuation lines.