Commit d917be71 authored by Karl Heuer's avatar Karl Heuer
Browse files

(message_dolog): Ignore narrowing.

Use low-level functions, to bypass modification and motion hooks.
parent 155ef550
...@@ -212,7 +212,9 @@ int line_number_display_limit; ...@@ -212,7 +212,9 @@ int line_number_display_limit;
t means infinite. nil means don't log at all. */ t means infinite. nil means don't log at all. */
Lisp_Object Vmessage_log_max; Lisp_Object Vmessage_log_max;
/* Add a string to the message log, optionally terminated with a newline. */ /* 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. */
void void
message_dolog (m, len, nlflag) message_dolog (m, len, nlflag)
...@@ -229,6 +231,8 @@ message_dolog (m, len, nlflag) ...@@ -229,6 +231,8 @@ message_dolog (m, len, nlflag)
oldpoint = PT; oldpoint = PT;
oldbegv = BEGV; oldbegv = BEGV;
oldzv = ZV; oldzv = ZV;
BEGV = BEG;
ZV = Z;
if (oldpoint == Z) if (oldpoint == Z)
oldpoint += len + nlflag; oldpoint += len + nlflag;
if (oldzv == Z) if (oldzv == Z)
...@@ -240,13 +244,12 @@ message_dolog (m, len, nlflag) ...@@ -240,13 +244,12 @@ message_dolog (m, len, nlflag)
insert_1 ("\n", 1, 1, 0); insert_1 ("\n", 1, 1, 0);
if (NATNUMP (Vmessage_log_max)) if (NATNUMP (Vmessage_log_max))
{ {
Lisp_Object n; int pos = scan_buffer ('\n', PT, 0,
XSETINT (n, -XFASTINT (Vmessage_log_max)); -XFASTINT (Vmessage_log_max) - 1, 0, 1);
Fforward_line (n); oldpoint -= min (pos, oldpoint) - BEG;
oldpoint -= min (PT, oldpoint) - BEG; oldbegv -= min (pos, oldbegv) - BEG;
oldbegv -= min (PT, oldbegv) - BEG; oldzv -= min (pos, oldzv) - BEG;
oldzv -= min (PT, oldzv) - BEG; del_range_1 (BEG, pos, 0);
del_range (BEG, PT);
} }
BEGV = oldbegv; BEGV = oldbegv;
ZV = oldzv; ZV = oldzv;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment