unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Anders Lindgren <andlind@gmail.com>
Cc: 16431@debbugs.gnu.org
Subject: bug#16431: 24.3.50; `follow-adjust-windows' sometimes fails (patch included)
Date: Wed, 15 Jan 2014 23:39:50 -0500	[thread overview]
Message-ID: <jwvmwiwsgc1.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <CABr8ebYiveqP+fK-RM_ZvvhLmTOy+1yugg-5+_RJK1=3a8HrrA@mail.gmail.com> (Anders Lindgren's message of "Mon, 13 Jan 2014 13:13:49 +0100")

> (let ((owin (selected-window)))
>   (select-window (next-window))
>   (let ((follow-mode t))
>     (follow-adjust-window (selected-window) (/ (point-max) 2))
>   (select-window owin)))

This recipe doesn't work any more now that follow-adjust-window only
takes a single argument.

Do you have some other way to reproduce the original problem (or has it
been accidentally fixed by my recent commit)?

> 1226,1232c1226,1232

> <           (goto-char dest)

> <           (redisplay)

Your patch (just like the one in your other bug-report) has spurious
empty lines between every actual line.  Also I think it was reversed
(at least the "destination" code is the one that's been in Emacs for
a while now).  Finally, please use "diff -u" or "diff -c" format
for patches.

And since I'm here, thinking about how to better support follow-mode,
here's an idea: IIUC the main problem currently (other than the "empty
last buffers") is that we have to redisplay in order to find the
window-end, after which we can adjust subsequent windows, and force
another redisplay.  So we'd like redisplay of the various windows to be
done "in the right order" and be able to run some Elisp code in-between.
One option for that would be to provide a new `redisplay-window'
function which does a redisplay of only one window, and then use it
inside pre-redisplay-function.  This way, when we do a normal redisplay,
our follow-pre-redisplay-function would check if some of the windows use
follow-mode.  If so, follow-pre-redisplay-function would redisplay its
windows "manually" in the right order via `redisplay-window' (and setup
window-starts between each window, as appropriate).  After that the
normal redisplay would continue and would find those windows "already
up-to-date", which would avoid the double-redisplay.


        Stefan





  reply	other threads:[~2014-01-16  4:39 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 [this message]
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
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvmwiwsgc1.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=16431@debbugs.gnu.org \
    --cc=andlind@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).