From bf2a6c399cf5f48ba47eaa5133c009a271e98401 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 14 Sep 2002 17:35:32 +0000 Subject: [PATCH] (display-warning): In batch mode, exclude the final newline from the arg to `message'. --- lisp/ChangeLog | 5 +++++ lisp/warnings.el | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ccda6c1344e..f12d7a6e3a7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2002-09-14 Richard M. Stallman + + * warnings.el (display-warning): In batch mode, + exclude the final newline from the arg to `message'. + 2002-09-13 Markus Rost * files.el (diff-buffer-with-file): Check whether associated file diff --git a/lisp/warnings.el b/lisp/warnings.el index 07075fa970c..99f345baa55 100644 --- a/lisp/warnings.el +++ b/lisp/warnings.el @@ -257,7 +257,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) -- 2.39.5