aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorDmitry Antipov2012-12-11 13:51:12 +0400
committerDmitry Antipov2012-12-11 13:51:12 +0400
commitc6afe371b0218154957bbef17c3f8bda5377b7c8 (patch)
tree2356c637109538cac1d24a7e1ae0ba38ccfec53d /src/window.c
parent1b47babdb7fd503ad79a696a1b9d9b2e2b46e10c (diff)
downloademacs-c6afe371b0218154957bbef17c3f8bda5377b7c8.tar.gz
emacs-c6afe371b0218154957bbef17c3f8bda5377b7c8.zip
* buffer.c (Fset_buffer_multibyte): Do not force redisplay
if changed buffer is not shown in a window. * insdel.c (prepare_to_modify_buffer): Likewise. * window.c (replace_buffer_in_windows_safely): Do nothing if buffer is not shown in a window. (Fforce_window_update): Likewise if string or buffer argument is passed.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/window.c b/src/window.c
index 17489cb95e9..f696e3c2a1b 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2988,22 +2988,24 @@ replace_buffer_in_windows (Lisp_Object buffer)
2988 call1 (Qreplace_buffer_in_windows, buffer); 2988 call1 (Qreplace_buffer_in_windows, buffer);
2989} 2989}
2990 2990
2991 2991/* If BUFFER is shown in a window, safely replace it with some other
2992/* Safely replace BUFFER with some other buffer in all windows of all 2992 buffer in all windows of all frames, even those on other keyboards. */
2993 frames, even those on other keyboards. */
2994 2993
2995void 2994void
2996replace_buffer_in_windows_safely (Lisp_Object buffer) 2995replace_buffer_in_windows_safely (Lisp_Object buffer)
2997{ 2996{
2998 Lisp_Object tail, frame; 2997 if (buffer_window_count (XBUFFER (buffer)))
2998 {
2999 Lisp_Object tail, frame;
2999 3000
3000 /* A single call to window_loop won't do the job because it only 3001 /* A single call to window_loop won't do the job because it only
3001 considers frames on the current keyboard. So loop manually over 3002 considers frames on the current keyboard. So loop manually over
3002 frames, and handle each one. */ 3003 frames, and handle each one. */
3003 FOR_EACH_FRAME (tail, frame) 3004 FOR_EACH_FRAME (tail, frame)
3004 window_loop (REPLACE_BUFFER_IN_WINDOWS_SAFELY, buffer, 1, frame); 3005 window_loop (REPLACE_BUFFER_IN_WINDOWS_SAFELY, buffer, 1, frame);
3006 }
3005} 3007}
3006 3008
3007/* If *ROWS or *COLS are too small a size for FRAME, set them to the 3009/* If *ROWS or *COLS are too small a size for FRAME, set them to the
3008 minimum allowable size. */ 3010 minimum allowable size. */
3009 3011
@@ -3338,11 +3340,11 @@ displaying that buffer. */)
3338 3340
3339 if (STRINGP (object)) 3341 if (STRINGP (object))
3340 object = Fget_buffer (object); 3342 object = Fget_buffer (object);
3341 if (BUFFERP (object) && BUFFER_LIVE_P (XBUFFER (object))) 3343 if (BUFFERP (object) && BUFFER_LIVE_P (XBUFFER (object))
3344 && buffer_window_count (XBUFFER (object)))
3342 { 3345 {
3343 /* Walk all windows looking for buffer, and force update 3346 /* If buffer is live and shown in at least one window, find
3344 of each of those windows. */ 3347 all windows showing this buffer and force update of them. */
3345
3346 object = window_loop (REDISPLAY_BUFFER_WINDOWS, object, 0, Qvisible); 3348 object = window_loop (REDISPLAY_BUFFER_WINDOWS, object, 0, Qvisible);
3347 return NILP (object) ? Qnil : Qt; 3349 return NILP (object) ? Qnil : Qt;
3348 } 3350 }