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: Fri, 12 Oct 2012 11:35:57 +0200	[thread overview]
Message-ID: <5077E47D.4080300@gmx.at> (raw)
In-Reply-To: <837gqw843w.fsf@gnu.org>

 > Quite a few struct members related to the
 > display engine (and I suppose other core structures as well) are
 > insufficiently, in accurately, or even downright incorrectly
 > documented.  I try to fix every such problem I bump into, FWIW.

If these concern the display engine exclusively, there's no problem.
Problems arise when the window handling code is supposed to change them.

 >> For example, what does the "displayed buffer's text modification events
 >> counter as of last time display completed" mean?
 >
 > This one sounds quite clear, please tell which part needs further
 > clarifications.  It would be better to say "counter of the displayed
 > buffer's modification events as of last time display completed", but
 > somehow I'm guessing it's not what you had in mind.

That's exactly what I had in mind: Either something that corresponds
textually to what is used in buffer.h or just mention the name of the
corresponding field used in buffer.h.  As it stands currently, I have to
either guess what is meant or go through the comparisons in the code to
find out.

 >> Suppose redisplay has set this to 37.  Apparently, setting it to 36
 >> means that the next redisplay will notice that for this window
 >> display is not accurate and has to be redone because 36 < 37.
 >
 > Not necessarily.  It depends on what is recorded in the buffer's
 > BUF_MODIFF slot.

IIUC this can only increase monotonously (modulo wraparounds, but in
that case ...).

 >> But why is a flag insufficient to accomplish that?  IIUC it's set only
 >> once by mark_window_display_accurate_1 and everywhere else reset to 0.
 >> Why can't we set it to "accurate" in mark_window_display_accurate_1 and
 >> "inaccurate" everwhere else?
 >
 > How would this work when the displayed buffer is modified behind
 > redisplay's back?  The last_modified slot belongs to the window, which
 > redisplay controls, but it doesn't control the buffer, which could
 > well be displayed in other windows as well and modified through there.
 > The display engine treats each window separately; when it displays
 > some window, it doesn't use information from other windows.

When last_modifed_flag is set, the window must be redisplayed.  Now if
someone else (including the display engine) decremented last_modified,
things were different indeed.  But as it stands I don't see any such
assignment.  OTOH when the buffer iself is modified it has to be
redisplayed anyway because we hardly know where the change happened.  So
I don't see why such a comparison of counters is useful.  But maybe I'm
missing something.

 >> And why do we have additional fields for last_overlay_modified and
 >> window_end_valid?  What sense does it make to handle these separately?
 >
 > Because changes in overlays do not constitute changes in buffer
 > contents, and are done via yet another set of primitives, yet they do
 > require redisplay.  Also because each one of these can allow and
 > disallow certain distinct redisplay optimizations, at least in
 > principle.

I doubt whether such optimizations exist.  Suppose we could exclude a
change to happen within the bounds of a window as for example a buffer
displayed with a window starting at M and ending at N and an overlay
modified at some position < M or > N.  Wouldn't this require to
associate each single overlay with a modification counter?

 > As for window_end_valid flag, it's there to allow yet another set of
 > redisplay optimizations.

I think that a correct implementation would have for each window w

(w->last_modified < MODIFF) => (NOT (w->window_end_valid))

but strongly doubt that this implication holds currently.

 >> For example, wherever last_modified is reset to 0 last_overlay_modified
 >> is always reset to 0 too.  Isn't that plain overkill?
 >
 > The potential for separate optimizations is not realized, that's true.
 > But it exists; I'm not sure we should remove it, and I surely won't
 > spend any of my personal time trying.  Fixing real bugs in the display
 > engine is enough to fill my free time already.  Of course, if you feel
 > like it, and if no one objects, feel free to make these cleanups.

I don't intend to make any cleanups.  I'd like to have a simple routine
we can use to reset any such structur members within window.c and have
that DTRT.  Currently, `window-end' is clearly broken and we should fix
it.

martin





  reply	other threads:[~2012-10-12  9:35 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 [this message]
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
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=5077E47D.4080300@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.