* lisp/emacs-lisp/bytecomp.el (byte-compile-save-excursion): Change the

warning message.
This commit is contained in:
Stefan Monnier 2011-03-14 21:12:54 -04:00
parent c96bbc66c6
commit 0a57d256af
2 changed files with 7 additions and 1 deletions

View file

@ -3776,7 +3776,8 @@ that suppresses all warnings during execution of BODY."
(defun byte-compile-save-excursion (form)
(if (and (eq 'set-buffer (car-safe (car-safe (cdr form))))
(byte-compile-warning-enabled-p 'suspicious))
(byte-compile-warn "`save-excursion' defeated by `set-buffer'"))
(byte-compile-warn
"Use `with-current-buffer' rather than save-excursion+set-buffer"))
(byte-compile-out 'byte-save-excursion 0)
(byte-compile-body-do-effect (cdr form))
(byte-compile-out 'byte-unbind 1))