aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/buffer.c b/src/buffer.c
index da88e85f23b..20accd77a20 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1430,29 +1430,21 @@ DEFUN ("current-buffer", Fcurrent_buffer, Scurrent_buffer, 0, 0, 0,
1430 return buf; 1430 return buf;
1431} 1431}
1432 1432
1433/* Set the current buffer to B. */ 1433/* Set the current buffer to B.
1434
1435 We previously set windows_or_buffers_changed here to invalidate
1436 global unchanged information in beg_unchanged and end_unchanged.
1437 This is no longer necessary because we now compute unchanged
1438 information on a buffer-basis. Every action affecting other
1439 windows than the selected one requires a select_window at some
1440 time, and that increments windows_or_buffers_changed. */
1434 1441
1435void 1442void
1436set_buffer_internal (b) 1443set_buffer_internal (b)
1437 register struct buffer *b; 1444 register struct buffer *b;
1438{ 1445{
1439 if (current_buffer != b) 1446 if (current_buffer != b)
1440 { 1447 set_buffer_internal_1 (b);
1441 /* Set windows_or_buffers_changed only if buffer is displayed
1442 somewhere. This enables redisplay optimizations if a
1443 background task like deferred fontification changes buffers,
1444 but none that are currently displayed. */
1445 if (!windows_or_buffers_changed
1446 && selected_frame)
1447 {
1448 Lisp_Object buffer;
1449 XSETBUFFER (buffer, b);
1450 if (!NILP (Fget_buffer_window (buffer, Qvisible)))
1451 ++windows_or_buffers_changed;
1452 }
1453
1454 set_buffer_internal_1 (b);
1455 }
1456} 1448}
1457 1449
1458/* Set the current buffer to B, and do not set windows_or_buffers_changed. 1450/* Set the current buffer to B, and do not set windows_or_buffers_changed.