changeset 10567:65c5552c16cb

(message_log_need_newline): This var is now static. (message_dolog): Set message_log_need_newline appropriately. Don't change it at all if message logging is currently disabled. (message_log_maybe_newline): New function. (message2): Use message_log_maybe_newline.
author Karl Heuer <kwzh@gnu.org>
date Fri, 27 Jan 1995 19:27:07 +0000
parents 9f018a8f2f67
children 275f62e27ee2
files src/xdisp.c
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Fri Jan 27 19:19:23 1995 +0000
+++ b/src/xdisp.c	Fri Jan 27 19:27:07 1995 +0000
@@ -50,7 +50,7 @@
 
 /* Nonzero means print newline to message log before next message.  */
 
-int message_log_need_newline;
+static int message_log_need_newline;
 
 #define min(a, b) ((a) < (b) ? (a) : (b))
 #define max(a, b) ((a) > (b) ? (a) : (b))
@@ -212,6 +212,14 @@
    t means infinite.  nil means don't log at all.  */
 Lisp_Object Vmessage_log_max;
 
+void
+message_log_maybe_newline ()
+{
+  if (message_log_need_newline)
+    message_dolog ("", 0, 1);
+}
+
+
 /* Add a string to the message log, optionally terminated with a newline.
    This function calls low-level routines in order to bypass text property
    hooks, etc. which might not be safe to run.  */
@@ -227,7 +235,7 @@
       int oldpoint, oldbegv, oldzv;
 
       oldbuf = current_buffer;
-      Fset_buffer (Fget_buffer_create (build_string (" *Messages*")));
+      Fset_buffer (Fget_buffer_create (build_string ("*Messages*")));
       oldpoint = PT;
       oldbegv = BEGV;
       oldzv = ZV;
@@ -255,6 +263,7 @@
       ZV = oldzv;
       TEMP_SET_PT (oldpoint);
       set_buffer_internal (oldbuf);
+      message_log_need_newline = !nlflag;
     }
 }
 
@@ -270,9 +279,7 @@
      int len;
 {
   /* First flush out any partial line written with print.  */
-  if (message_log_need_newline)
-    message_dolog ("", 0, 1);
-  message_log_need_newline = 0;
+  message_log_maybe_newline ();
   if (m)
     message_dolog (m, len, 1);
   message2_nolog (m, len);