all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 16431@debbugs.gnu.org, andlind@gmail.com
Subject: bug#16431: 24.3.50; `follow-adjust-windows' sometimes fails (patch included)
Date: Thu, 16 Jan 2014 13:58:41 -0500	[thread overview]
Message-ID: <jwv8uufojfx.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <837g9z3jax.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 16 Jan 2014 19:53:10 +0200")

> I don't have a clear understanding of how your suggestion would work.

Don't worry: you're not alone.

> Now, the above doesn't say, but your later message indicates that by
> "redisplay a window" you mean only the first part.

That's right.

> However, the current redisplay cycle marks a window's display
> "accurate" only after update_frame was called and was able to complete
> its job.  I'm not sure we can mark a window "up to date" without
> actually delivering the stiff to the glass.

Indeed, we may need to introduce a new boolean flag to distinguish the
"matrix up to date" from "display up to date".  I haven't had to deal
with this part of the code yet, so I'm not sure it will turn out.
But seen from a distance, it looks like it should be doable without
any serious restructuring.

> Next, there's a complication on TTYs: there, update_frame updates the
> entire frame at once, not one window at a time (as it does on GUI
> displays).  So the TTY redisplay cannot easily update several windows
> one by one without doing a lot of redundant work.

That's actually good.  It means there's an existing road that goes in
the direction of separating the "update the matrix" vs "update the
display".

> The function that redisplays a window in your sense already exists:
> it's redisplay_window; you just need to expose it to Lisp.

More or less, yes.

> But calling that function from pre-redisplay-function, i.e. from
> inside redisplay, means you are potentially re-entering the display
> engine, which is non-reentrant.

Note that pre-redisplay-function is called from redisplay, not from
redisplay_window, so having pre-redisplay-function call redisplay_window
does not in itself create a circularity.
Of course, the devil is in the detail, but again, from a distance it
looks doable.

> OTOH, the job at hand is very simple: we need to ask the display
> engine to redisplay several windows in a particular order, and to
> determine the window-start of each of these windows from the
> window-end of the previous one.

It's not quite that simple because point may want to move from one
window to the other instead of scrolling.  Of course, my plan currently
does not account for this either (my best guess so far is that we
should somehow tell redisplay-window not to change scroll and if
that causes point to move it means scrolling was needed, at which point
we can decide whether to move point to another window, or to call
redisplay-window again (but letting it scroll this time)).

> This is a much easier job, one that doesn't require re-entering the
> display engine, nor usurping its job by redisplaying some windows
> behind its back "by hand".

Could be.  As you know, I'm a big fan of moving code to Elisp to provide
ever more rope for users to shoot themselves in the foot.

E.g. maybe the same functionality can later be used for scroll-all-mode
and two-columns-mode.  Presumably, ediff could also use that kind
of functionality.


        Stefan





  reply	other threads:[~2014-01-16 18:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-13 12:13 bug#16431: 24.3.50; `follow-adjust-windows' sometimes fails (patch included) Anders Lindgren
2014-01-16  4:39 ` Stefan Monnier
2014-01-16 10:03   ` martin rudalics
2014-01-16 10:20   ` Anders Lindgren
2014-01-16 14:25     ` Stefan Monnier
2014-01-16 15:51       ` Anders Lindgren
2014-01-16 17:57         ` Eli Zaretskii
2014-01-16 18:43         ` Stefan Monnier
2014-01-16 17:56       ` Eli Zaretskii
2014-01-16 17:53   ` Eli Zaretskii
2014-01-16 18:58     ` Stefan Monnier [this message]
2014-01-16 21:38       ` Eli Zaretskii

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=jwv8uufojfx.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=16431@debbugs.gnu.org \
    --cc=andlind@gmail.com \
    --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.