GNU bug report logs - #18545
24.4.50: Bug - forward-line inside with-selected-window

Previous Next

Package: emacs;

Reported by: lompik <at> voila.fr

Date: Wed, 24 Sep 2014 13:40:02 UTC

Severity: normal

Found in version 24.4.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: lompik <at> voila.fr, 18545 <at> debbugs.gnu.org
Subject: bug#18545: 24.4.50: Bug - forward-line inside with-selected-window
Date: Fri, 26 Sep 2014 15:32:11 -0400
>> >> Why does
>> >> (with-selected-window (get-buffer-window "*Completions*")
>> >> (recenter 5))
>> >> require an explicit call to wset_redisplay from recenter, whereas
>> >> (with-selected-window (get-buffer-window "*Completions*")
>> >> (forward-line 1))
>> >> doesn't need an explicit call to wset_redisplay (or bset_redisplay) from
>> >> forward-line?
>> > I think that's because forward-line moves point, while recenter
>> > doesn't.
>> But I don't see why moving point would help: calling wset_redisplay
>> should only change the fact that this window is considered for
>> redisplay
> There are redisplay optimizations that don't depend on whether we
> consider a window for redisplay; see around line 13700 in xdisp.c from
> emacs-24.  You will see a little ways below that place that we test
> point against its recorded value in w->last_point, for example.

Right, but these are only for the current-buffer/selected-window,
whereas the example modifies another window (and another buffer), so
they first need to be considered (via [bwf]set_redisplay) before
anything else will look at them.

>> so if it's needed for the recenter case, that means that
>> without it, the window would not be considered at all
> 'with-selected-window makes' the offending window selected, and the
> selected window is always considered for redisplay, right?

No.  If it were the wset_redisplay you added would have been a no-op.

Oh, wait I see it now.  We do test if point changed, in
redisplay_window:15965:

  if (!just_this_one_p
      && REDISPLAY_SOME_P ()
      && !w->redisplay
      && !f->redisplay
      && !buffer->text->redisplay
      && BUF_PT (buffer) == w->last_point)
    return;

So indeed changing point ends up doing the moral equivalent of bset_redisplay.


        Stefan




This bug report was last modified 10 years and 237 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.