aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp/warnings.el
diff options
context:
space:
mode:
authorGlenn Morris <[email protected]>2007-03-31 19:41:46 +0000
committerGlenn Morris <[email protected]>2007-03-31 19:41:46 +0000
commit0eae9f3ba9eaec9a8693cf113059c52907956e88 (patch)
tree7dda7d7221ce925c29621b6418478f23dbc5f298 /lisp/emacs-lisp/warnings.el
parentc581350323814167f6f14e9b865175e121b51081 (diff)
(display-warning): If we create the buffer displaying the warning,
disable undo there.
Diffstat (limited to 'lisp/emacs-lisp/warnings.el')
-rw-r--r--lisp/emacs-lisp/warnings.el13
1 files changed, 10 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index b75f0fd242..99b0b3f344 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -218,8 +218,9 @@ Default is :warning.
but raise suspicion of a possible problem.
:debug -- info for debugging only.
-BUFFER-NAME, if specified, is the name of the buffer for logging the
-warning. By default, it is `*Warnings*'.
+BUFFER-NAME, if specified, is the name of the buffer for logging
+the warning. By default, it is `*Warnings*'. If this function
+has to create the buffer, it disables undo in the buffer.
See the `warnings' custom group for user customization features.
@@ -227,16 +228,22 @@ See also `warning-series', `warning-prefix-function' and
`warning-fill-prefix' for additional programming features."
(unless level
(setq level :warning))
+ (unless buffer-name
+ (setq buffer-name "*Warnings*"))
(if (assq level warning-level-aliases)
(setq level (cdr (assq level warning-level-aliases))))
(or (< (warning-numeric-level level)
(warning-numeric-level warning-minimum-log-level))
(warning-suppress-p type warning-suppress-log-types)
(let* ((typename (if (consp type) (car type) type))
- (buffer (get-buffer-create (or buffer-name "*Warnings*")))
+ (old (get-buffer buffer-name))
+ (buffer (get-buffer-create buffer-name))
(level-info (assq level warning-levels))
start end)
(with-current-buffer buffer
+ ;; If we created the buffer, disable undo.
+ (unless old
+ (setq buffer-undo-list t))
(goto-char (point-max))
(when (and warning-series (symbolp warning-series))
(setq warning-series