aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1995-01-17 02:29:16 +0000
committerKarl Heuer1995-01-17 02:29:16 +0000
commitd917be71a8466e98f2c3dd55670fd540c727638e (patch)
treecd798b58d0c2f77548e3cf12fdf89ac9a8cbd2f3 /src
parent155ef550fb02a15a4de1ea6d013c40adf3858b51 (diff)
downloademacs-d917be71a8466e98f2c3dd55670fd540c727638e.tar.gz
emacs-d917be71a8466e98f2c3dd55670fd540c727638e.zip
(message_dolog): Ignore narrowing.
Use low-level functions, to bypass modification and motion hooks.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index bb34e27e456..91ffad37d63 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -212,7 +212,9 @@ int line_number_display_limit;
212 t means infinite. nil means don't log at all. */ 212 t means infinite. nil means don't log at all. */
213Lisp_Object Vmessage_log_max; 213Lisp_Object Vmessage_log_max;
214 214
215/* Add a string to the message log, optionally terminated with a newline. */ 215/* Add a string to the message log, optionally terminated with a newline.
216 This function calls low-level routines in order to bypass text property
217 hooks, etc. which might not be safe to run. */
216 218
217void 219void
218message_dolog (m, len, nlflag) 220message_dolog (m, len, nlflag)
@@ -229,6 +231,8 @@ message_dolog (m, len, nlflag)
229 oldpoint = PT; 231 oldpoint = PT;
230 oldbegv = BEGV; 232 oldbegv = BEGV;
231 oldzv = ZV; 233 oldzv = ZV;
234 BEGV = BEG;
235 ZV = Z;
232 if (oldpoint == Z) 236 if (oldpoint == Z)
233 oldpoint += len + nlflag; 237 oldpoint += len + nlflag;
234 if (oldzv == Z) 238 if (oldzv == Z)
@@ -240,13 +244,12 @@ message_dolog (m, len, nlflag)
240 insert_1 ("\n", 1, 1, 0); 244 insert_1 ("\n", 1, 1, 0);
241 if (NATNUMP (Vmessage_log_max)) 245 if (NATNUMP (Vmessage_log_max))
242 { 246 {
243 Lisp_Object n; 247 int pos = scan_buffer ('\n', PT, 0,
244 XSETINT (n, -XFASTINT (Vmessage_log_max)); 248 -XFASTINT (Vmessage_log_max) - 1, 0, 1);
245 Fforward_line (n); 249 oldpoint -= min (pos, oldpoint) - BEG;
246 oldpoint -= min (PT, oldpoint) - BEG; 250 oldbegv -= min (pos, oldbegv) - BEG;
247 oldbegv -= min (PT, oldbegv) - BEG; 251 oldzv -= min (pos, oldzv) - BEG;
248 oldzv -= min (PT, oldzv) - BEG; 252 del_range_1 (BEG, pos, 0);
249 del_range (BEG, PT);
250 } 253 }
251 BEGV = oldbegv; 254 BEGV = oldbegv;
252 ZV = oldzv; 255 ZV = oldzv;