This is a CC of what I sent to gnu.emacs.bug
2003-09-14 Jari Aalto <jari.aalto(a)poboxes.com>
* emacs-lisp/lisp-mnt.el (lm-get-header-re): Added
surrounding \\( and \\) around the header. Like
for lm-history-header 'Change Log\\|History'. Otherwise
the regexp is wrong.
(lm-with-file): Set ` find-file-hooks' nil before
find-file-noselect. File content is loaded
in pure format.
===================================================================
RCS file: lisp-mnt.el,v
retrieving revision 1.1
diff -bwu -r1.1 lisp-mnt.el
--- lisp-mnt.el 2003-09-14 19:51:47+03 1.1
+++ lisp-mnt.el 2003-09-14 19:53:02+03
@@ -163,8 +163,8 @@
If called with optional MODE and with value `section',
return section regexp instead."
(if (eq mode 'section)
- (concat "^;;;;* " header ":[ \t]*$")
- (concat lm-header-prefix header "[ \t]*:[ \t]*")))
+ (concat "^;;;;* \\(" header "\\):[ \t]*$")
+ (concat lm-header-prefix "\\(" header "\\)[ \t]*:[ \t]*")))
(defun lm-get-package-name ()
"Return package name by looking at the first line."
@@ -250,7 +250,9 @@
(let ((filesym (make-symbol "file")))
`(save-excursion
(let ((,filesym ,file))
- (if ,filesym (set-buffer (find-file-noselect ,filesym)))
+ (when ,filesym
+ (let (find-file-hooks)
+ (set-buffer (find-file-noselect ,filesym))))
(prog1 (progn ,@body)
(if (and ,filesym (not (get-buffer-window (current-buffer) t)))
(kill-buffer (current-buffer))))))))