all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 12600@debbugs.gnu.org
Subject: bug#12600: 24.2.50; linum-mode: line numbers in fringe do not refresh when resizing frame
Date: Sat, 13 Oct 2012 11:51:46 +0200	[thread overview]
Message-ID: <507939B2.8070709@gmx.at> (raw)
In-Reply-To: <83626e7nse.fsf@gnu.org>

 >> last_modifed_flag is a fictitious variable I would set when the window
 >> changes.  When it's set, redisplay must redisplay the window.
 >
 > What do you mean by "window changes"?  And how would any code outside
 > of the display engine know whether some change requires to redisplay a
 > window?

There are three types of window changes we have to consider:

(1) Change the window's buffer via `set-window-buffer'.

(2) Change the size of the window (including toggling of scrollbars and
     fringes).

(3) Change the buffer's position in the window (usually via scrolling,
     `set-window-point' and `set-window-start').

There might be indirect changes as well (e.g., when setting a window
display property) but let's stick to the three cited above.  All these
require usually a complete redisplay of the buffer in the window.  There
is one exception, namely when `split-window-keep-point' is nil,
`split-window-below' tries to keep the old display (but I doubt that
this works with variable height fonts and it will likely fail as soon as
we split windows pixel-wise).

Now in all of these cases, the respective routines in window.c would set
the window's last_modified_flag to t, marking the window as dirty.  When
resizing or splitting windows, usually more than one window is affected;
for scrolling usually one window is affected.  When the display engine
scans windows, it has to redisplay a window when the flag is set,
resetting the flag when it's done.  Otherwise, it will redisplay the
window iff the buffer's modification flag says so.

Note that the last_modified_flag of the window covers both last_modified
and last_overlay_modified as far as the window's redisplay is concerned.

`window-end' with non-nil UPDATE requires a different treatment anyway
because it inspects a cached value that is invalidated either by a
buffer modification or a window change.  Hence the only simple solution
for this is to reset window_end_pos to nil whenenver we set that
window's last_modified_flag.  `window-end' then would update
window_end_pos either if it is nil or the buffer was modified since the
last redisplay.

 > Anyway, I don't think the above is right.  Only the display engine
 > should set this variable.  The display engine should figure out itself
 > whether to redisplay a window, by using other means.  If it doesn't,
 > that's a bug.

So why do we currently reset last_modified and last_overlay_modified in
window.c?

 >> We'd obviously have an independent buffer_modified_flag.  A window must
 >> be redisplayed if either buffer_modified_flag is set (modulo any
 >> optimizations which I won't dispute here) or its last_modifed_flag is
 >> set.
 >
 > But comparing the buffer's modiff with last_modified already
 > accomplishes this, so what would be the purpose of converting
 > last_modified to a boolean flag, and then introducing another struct
 > member that acts exactly like last_modified does today?

The last_modified_flag struct member would replace three members that
have very obscure semantics IMHO.

martin





  reply	other threads:[~2012-10-13  9:51 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-07 23:03 bug#12600: 24.2.50; linum-mode: line numbers in fringe do not refresh when resizing frame Christoph Scholtes
2012-10-08  7:31 ` Eli Zaretskii
2012-10-08  9:17   ` martin rudalics
2012-10-08 13:59     ` Stefan Monnier
2012-10-08 15:48     ` Eli Zaretskii
2012-10-09  9:36       ` martin rudalics
2012-10-09 17:04         ` Eli Zaretskii
2012-10-10 10:22           ` martin rudalics
2012-10-10 15:45             ` Eli Zaretskii
2012-10-11  7:12               ` martin rudalics
2012-10-11 16:56                 ` Eli Zaretskii
2012-10-12  7:32                   ` martin rudalics
2012-10-12  8:52                     ` Eli Zaretskii
2012-10-12  9:35                       ` martin rudalics
2012-10-12 13:51                         ` Eli Zaretskii
2012-10-12 15:42                           ` martin rudalics
2012-10-12 14:55                         ` Stefan Monnier
2012-10-12 15:36                           ` Eli Zaretskii
2012-10-12 15:43                           ` martin rudalics
2012-10-13  8:56                             ` Eli Zaretskii
2012-10-13  9:51                               ` martin rudalics [this message]
2012-10-13 12:45                                 ` Eli Zaretskii
2012-10-13 17:45                                   ` martin rudalics
2012-10-13 18:08                                     ` Eli Zaretskii
2012-10-14 10:21                                       ` martin rudalics
2012-10-14 12:06                                         ` Eli Zaretskii
2012-10-14 18:33                                           ` martin rudalics
2012-10-14 20:01                                             ` Eli Zaretskii
2012-10-15  9:41                                               ` martin rudalics
2012-10-15 19:39                                                 ` Eli Zaretskii
2012-10-16  9:39                                                   ` martin rudalics
2012-10-16 17:35                                                     ` Eli Zaretskii
2012-10-15  9:40 ` martin rudalics
2012-11-09  9:49   ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=507939B2.8070709@gmx.at \
    --to=rudalics@gmx.at \
    --cc=12600@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.