# HG changeset patch # User Glenn Morris # Date 1175370106 0 # Node ID acccfec692550c44c41e55237c274ee2fe5be2cc # Parent 482f0ebc1f2e563a1a8fff6cabe8afcbb3dbc143 (display-warning): If we create the buffer displaying the warning, disable undo there. diff -r 482f0ebc1f2e -r acccfec69255 lisp/emacs-lisp/warnings.el --- a/lisp/emacs-lisp/warnings.el Sat Mar 31 19:41:29 2007 +0000 +++ b/lisp/emacs-lisp/warnings.el Sat Mar 31 19:41:46 2007 +0000 @@ -218,8 +218,9 @@ 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 @@ `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