]> code.delx.au - gnu-emacs/blobdiff - lisp/warnings.el
*** empty log message ***
[gnu-emacs] / lisp / warnings.el
index 07075fa970cf6ef9bc198034f5faf198438a3395..4d0354236a806bc71000aaa43877259c8aef7a90 100644 (file)
 
 ;;; Code:
 
+(defgroup warnings nil
+  "Log and display warnings."
+  :version "21.4"
+  :group 'lisp)
+
 (defvar warning-levels
   '((:emergency "Emergency%s: " ding)
     (:error "Error%s: ")
@@ -257,7 +262,13 @@ See also `warning-series', `warning-prefix-function' and
            ;; Do this unconditionally, since there is no way
            ;; to view logged messages unless we output them.
            (with-current-buffer buffer
-             (message "%s" (buffer-substring start end)))
+             (save-excursion
+               ;; Don't include the final newline in the arg
+               ;; to `message', because it adds a newline.
+               (goto-char end)
+               (if (bolp)
+                   (forward-char -1))
+               (message "%s" (buffer-substring start (point)))))
          ;; Interactively, decide whether the warning merits
          ;; immediate display.
          (or (< (warning-numeric-level level)