mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-22 10:26:20 +00:00
(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.
This commit is contained in:
parent
c006b215fa
commit
3c6595e0b2
17
src/xdisp.c
17
src/xdisp.c
@ -50,7 +50,7 @@ int noninteractive_need_newline;
|
||||
|
||||
/* 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 @@ int line_number_display_limit;
|
||||
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 @@ message_dolog (m, len, nlflag)
|
||||
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 @@ message_dolog (m, len, nlflag)
|
||||
ZV = oldzv;
|
||||
TEMP_SET_PT (oldpoint);
|
||||
set_buffer_internal (oldbuf);
|
||||
message_log_need_newline = !nlflag;
|
||||
}
|
||||
}
|
||||
|
||||
@ -270,9 +279,7 @@ message2 (m, len)
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user