diff options
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/warnings.el | 29 |
2 files changed, 21 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 11b76ccc18f..2b384b31b6b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-09-19 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emacs-lisp/warnings.el: Fix commenting convention. | ||
| 4 | (display-warning): Use special mode and make the buffer read-only. | ||
| 5 | |||
| 1 | 2010-09-18 Jay Belanger <jay.p.belanger@gmail.com> | 6 | 2010-09-18 Jay Belanger <jay.p.belanger@gmail.com> |
| 2 | 7 | ||
| 3 | * calc/calc-prog.el (calc-read-parse-table-part): Don't "fix" the | 8 | * calc/calc-prog.el (calc-read-parse-table-part): Don't "fix" the |
diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el index 4adb93a852d..ba8c8ffc831 100644 --- a/lisp/emacs-lisp/warnings.el +++ b/lisp/emacs-lisp/warnings.el | |||
| @@ -119,9 +119,9 @@ See also `warning-suppress-log-types'." | |||
| 119 | :type '(repeat (repeat symbol)) | 119 | :type '(repeat (repeat symbol)) |
| 120 | :version "22.1") | 120 | :version "22.1") |
| 121 | 121 | ||
| 122 | ;;; The autoload cookie is so that programs can bind this variable | 122 | ;; The autoload cookie is so that programs can bind this variable |
| 123 | ;;; safely, testing the existing value, before they call one of the | 123 | ;; safely, testing the existing value, before they call one of the |
| 124 | ;;; warnings functions. | 124 | ;; warnings functions. |
| 125 | ;;;###autoload | 125 | ;;;###autoload |
| 126 | (defvar warning-prefix-function nil | 126 | (defvar warning-prefix-function nil |
| 127 | "Function to generate warning prefixes. | 127 | "Function to generate warning prefixes. |
| @@ -132,9 +132,9 @@ The warnings buffer is current when this function is called | |||
| 132 | and the function can insert text in it. This text becomes | 132 | and the function can insert text in it. This text becomes |
| 133 | the beginning of the warning.") | 133 | the beginning of the warning.") |
| 134 | 134 | ||
| 135 | ;;; The autoload cookie is so that programs can bind this variable | 135 | ;; The autoload cookie is so that programs can bind this variable |
| 136 | ;;; safely, testing the existing value, before they call one of the | 136 | ;; safely, testing the existing value, before they call one of the |
| 137 | ;;; warnings functions. | 137 | ;; warnings functions. |
| 138 | ;;;###autoload | 138 | ;;;###autoload |
| 139 | (defvar warning-series nil | 139 | (defvar warning-series nil |
| 140 | "Non-nil means treat multiple `display-warning' calls as a series. | 140 | "Non-nil means treat multiple `display-warning' calls as a series. |
| @@ -146,16 +146,16 @@ A symbol with a function definition is like t, except | |||
| 146 | also call that function before the next warning.") | 146 | also call that function before the next warning.") |
| 147 | (put 'warning-series 'risky-local-variable t) | 147 | (put 'warning-series 'risky-local-variable t) |
| 148 | 148 | ||
| 149 | ;;; The autoload cookie is so that programs can bind this variable | 149 | ;; The autoload cookie is so that programs can bind this variable |
| 150 | ;;; safely, testing the existing value, before they call one of the | 150 | ;; safely, testing the existing value, before they call one of the |
| 151 | ;;; warnings functions. | 151 | ;; warnings functions. |
| 152 | ;;;###autoload | 152 | ;;;###autoload |
| 153 | (defvar warning-fill-prefix nil | 153 | (defvar warning-fill-prefix nil |
| 154 | "Non-nil means fill each warning text using this string as `fill-prefix'.") | 154 | "Non-nil means fill each warning text using this string as `fill-prefix'.") |
| 155 | 155 | ||
| 156 | ;;; The autoload cookie is so that programs can bind this variable | 156 | ;; The autoload cookie is so that programs can bind this variable |
| 157 | ;;; safely, testing the existing value, before they call one of the | 157 | ;; safely, testing the existing value, before they call one of the |
| 158 | ;;; warnings functions. | 158 | ;; warnings functions. |
| 159 | ;;;###autoload | 159 | ;;;###autoload |
| 160 | (defvar warning-type-format (purecopy " (%s)") | 160 | (defvar warning-type-format (purecopy " (%s)") |
| 161 | "Format for displaying the warning type in the warning message. | 161 | "Format for displaying the warning type in the warning message. |
| @@ -241,6 +241,8 @@ See also `warning-series', `warning-prefix-function' and | |||
| 241 | (with-current-buffer buffer | 241 | (with-current-buffer buffer |
| 242 | ;; If we created the buffer, disable undo. | 242 | ;; If we created the buffer, disable undo. |
| 243 | (unless old | 243 | (unless old |
| 244 | (special-mode) | ||
| 245 | (setq buffer-read-only t) | ||
| 244 | (setq buffer-undo-list t)) | 246 | (setq buffer-undo-list t)) |
| 245 | (goto-char (point-max)) | 247 | (goto-char (point-max)) |
| 246 | (when (and warning-series (symbolp warning-series)) | 248 | (when (and warning-series (symbolp warning-series)) |
| @@ -248,6 +250,7 @@ See also `warning-series', `warning-prefix-function' and | |||
| 248 | (prog1 (point-marker) | 250 | (prog1 (point-marker) |
| 249 | (unless (eq warning-series t) | 251 | (unless (eq warning-series t) |
| 250 | (funcall warning-series))))) | 252 | (funcall warning-series))))) |
| 253 | (let ((inhibit-read-only t)) | ||
| 251 | (unless (bolp) | 254 | (unless (bolp) |
| 252 | (newline)) | 255 | (newline)) |
| 253 | (setq start (point)) | 256 | (setq start (point)) |
| @@ -262,7 +265,7 @@ See also `warning-series', `warning-prefix-function' and | |||
| 262 | (let ((fill-prefix warning-fill-prefix) | 265 | (let ((fill-prefix warning-fill-prefix) |
| 263 | (fill-column 78)) | 266 | (fill-column 78)) |
| 264 | (fill-region start (point)))) | 267 | (fill-region start (point)))) |
| 265 | (setq end (point)) | 268 | (setq end (point))) |
| 266 | (when (and (markerp warning-series) | 269 | (when (and (markerp warning-series) |
| 267 | (eq (marker-buffer warning-series) buffer)) | 270 | (eq (marker-buffer warning-series) buffer)) |
| 268 | (goto-char warning-series))) | 271 | (goto-char warning-series))) |