Re: log-messages.el and efs
Andy Norman (ange@hplb.hpl.hp.com)
Tue, 05 Sep 1995 13:31:54 +0100
Folks,
Although I can't reproduce the error under XEmacs 19.13, it does look like the
version of log-messages I grabbed from Dave Smith's web-page clobbers
match-data.
Please let me know if this patch doesn't work.
-- ange -- <><
ange@hplb.hpl.hp.com
--- log-messages.el~ Tue Sep 5 13:27:01 1995
+++ log-messages.el Tue Sep 5 13:27:01 1995
@@ -82,31 +82,32 @@
(logmsg-log-message (apply 'format (ad-get-args 0))))
(defun logmsg-log-message (msg)
- (let ((rgx logmsg-nolog-regexps))
- (and logmsg-log-messages
- (> (length msg) 0)
- (progn
- (while (and rgx (not (string-match (car rgx) msg)))
- (setq rgx (cdr rgx)))
- (not rgx))
- (save-excursion
- (set-buffer (get-buffer-create "*Message Log*"))
- (goto-char (point-max))
- ;; If last message is a prefix of this one, delete it
- (if (string-match (concat "^" (regexp-quote logmsg-last-msg)) msg)
- (delete-region (point)
- (save-excursion
- (forward-line -1)
- (point))))
- (setq logmsg-last-msg msg)
- (insert-before-markers msg ?\n)
- ;; If there are too many messages, delete some
- (let ((nummsg (count-lines (point-min) (point-max))))
- (if (> nummsg logmsg-max-log-size)
- (progn
- (goto-char (point-min))
- (forward-line (- nummsg logmsg-max-log-size))
- (delete-region (point-min) (point))))))))
- msg)
+ (save-match-data
+ (let ((rgx logmsg-nolog-regexps))
+ (and logmsg-log-messages
+ (> (length msg) 0)
+ (progn
+ (while (and rgx (not (string-match (car rgx) msg)))
+ (setq rgx (cdr rgx)))
+ (not rgx))
+ (save-excursion
+ (set-buffer (get-buffer-create "*Message Log*"))
+ (goto-char (point-max))
+ ;; If last message is a prefix of this one, delete it
+ (if (string-match (concat "^" (regexp-quote logmsg-last-msg)) msg)
+ (delete-region (point)
+ (save-excursion
+ (forward-line -1)
+ (point))))
+ (setq logmsg-last-msg msg)
+ (insert-before-markers msg ?\n)
+ ;; If there are too many messages, delete some
+ (let ((nummsg (count-lines (point-min) (point-max))))
+ (if (> nummsg logmsg-max-log-size)
+ (progn
+ (goto-char (point-min))
+ (forward-line (- nummsg logmsg-max-log-size))
+ (delete-region (point-min) (point))))))))
+ msg))
(provide 'log-messages)