* [RFC] buffer_shared in redisplay_internal
@ 2012-11-19 16:42 Dmitry Antipov
2012-11-19 17:02 ` Eli Zaretskii
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Antipov @ 2012-11-19 16:42 UTC (permalink / raw)
To: Emacs development discussions; +Cc: Eli Zaretskii
[-- Attachment #1: Type: text/plain, Size: 293 bytes --]
This patch proposes the minor redisplay optimization for the case when current
buffer is shown in more than one window but was not changed since last display.
In such a case, it should be enough to redisplay only the selected window
or selected frame rather than redisplay everything.
Dmitry
[-- Attachment #2: buffer_shared_and_changed.patch --]
[-- Type: text/plain, Size: 2188 bytes --]
=== modified file 'src/xdisp.c'
--- src/xdisp.c 2012-11-14 11:13:33 +0000
+++ src/xdisp.c 2012-11-19 16:17:50 +0000
@@ -515,9 +515,8 @@
static int overlay_arrow_seen;
-/* Number of windows showing the buffer of the selected window (or
- another buffer with the same base buffer). keyboard.c refers to
- this. */
+/* Number of windows showing the buffer of the selected
+ window (or another buffer with the same base buffer). */
int buffer_shared;
@@ -10889,8 +10888,15 @@
return window_height_changed_p;
}
-
-\f
+/* True if the current buffer is shown in more than
+ one window and was modified since last display. */
+
+static int
+buffer_shared_and_changed (void)
+{
+ return (buffer_shared > 1 && UNCHANGED_MODIFIED < MODIFF);
+}
+
/***********************************************************************
Mode Lines and Frame Titles
***********************************************************************/
@@ -11196,7 +11202,7 @@
/* Update the menu bar item lists, if appropriate. This has to be
done before any actual redisplay or generation of display lines. */
all_windows = (update_mode_lines
- || buffer_shared > 1
+ || buffer_shared_and_changed ()
|| windows_or_buffers_changed);
if (all_windows)
{
@@ -13116,7 +13122,7 @@
if ((SAVE_MODIFF < MODIFF) != w->last_had_star)
{
w->update_mode_line = 1;
- if (buffer_shared > 1)
+ if (buffer_shared_and_changed ())
update_mode_lines++;
}
@@ -13141,7 +13147,8 @@
/* The variable buffer_shared is set in redisplay_window and
indicates that we redisplay a buffer in different windows. See
there. */
- consider_all_windows_p = (update_mode_lines || buffer_shared > 1
+ consider_all_windows_p = (update_mode_lines
+ || buffer_shared_and_changed ()
|| cursor_type_changed);
/* If specs for an arrow have changed, do thorough redisplay
@@ -13433,7 +13440,7 @@
}
CHARPOS (this_line_start_pos) = 0;
- consider_all_windows_p |= buffer_shared > 1;
+ consider_all_windows_p |= buffer_shared_and_changed ();
++clear_face_cache_count;
#ifdef HAVE_WINDOW_SYSTEM
++clear_image_cache_count;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFC] buffer_shared in redisplay_internal
2012-11-19 16:42 [RFC] buffer_shared in redisplay_internal Dmitry Antipov
@ 2012-11-19 17:02 ` Eli Zaretskii
0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2012-11-19 17:02 UTC (permalink / raw)
To: Dmitry Antipov; +Cc: emacs-devel
> Date: Mon, 19 Nov 2012 20:42:02 +0400
> From: Dmitry Antipov <dmantipov@yandex.ru>
> CC: Eli Zaretskii <eliz@gnu.org>
>
> This patch proposes the minor redisplay optimization for the case when current
> buffer is shown in more than one window but was not changed since last display.
> In such a case, it should be enough to redisplay only the selected window
> or selected frame rather than redisplay everything.
What about the mode lines of the other windows showing the same
buffer? They might need redisplay even if the buffer didn't change,
e.g., to show the current line number. Similarly with the tool bar
(if the buffer is shown in more than one frame).
If you made sure all these cases are covered, I guess we can apply
this and see if someone complains.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-19 17:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-19 16:42 [RFC] buffer_shared in redisplay_internal Dmitry Antipov
2012-11-19 17:02 ` Eli Zaretskii
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.