From: Eli Zaretskii <eliz@gnu.org>
To: Matthew Smiglarski <matthew.smiglarski@gmail.com>
Cc: 18490-done@debbugs.gnu.org
Subject: bug#18490: 24.3.93; Narrowing in other window no longer redisplays until a call to other-window.
Date: Thu, 18 Sep 2014 18:20:34 +0300 [thread overview]
Message-ID: <83zjdx0xbx.fsf@gnu.org> (raw)
In-Reply-To: <CAAkg2_+-Tv=_K+7hz7TwH689h8Ba2ok_=Z0jf9t3mnF+QqyPhg@mail.gmail.com>
> Date: Wed, 17 Sep 2014 19:50:46 +0100
> From: Matthew Smiglarski <matthew.smiglarski@gmail.com>
>
> Hello,
> When a buffer has narrowing applied the window does not update until
> other-window is called.
>
> This is not the case on 24.3.
>
> To reproduce:
>
> 1. Start emacs
> $ emacs -Q
>
> 2. Enter the following into some buffer
>
> (defun bug-redisplay-narrowing-on-other-window ()
> (interactive)
> (widen)
> (search-forward-regexp "[a-z]+")
> (narrow-to-region (match-beginning 0) (match-end 0)))
>
> (global-set-key (kbd "M-n") 'bug-redisplay-narrowing-on-other-window)
>
> ;; Create 3 windows
> (split-window-below)
> (split-window-below)
>
> 3. M-x eval-buffer
>
> 4. Execute the bug function defined above a few times, mixing it up
> with the odd call to
> #'other-window.
>
> M-x beginning-of-buffer
> M-n M-n C-x 4 o M-n M-n C-x 4 o M-n M-n
>
> What happens is the narrowing is only apparent to the poor user when
> another window is selected, and this was not the case previously.
Thanks, I fixed this in revision 117507 on the emacs-24 branch.
> Apologies if this is an intended change but to me it seems that the
> redisplay should occur immediately?
Not immediately, but the next time Emacs schedules redisplay, yes, all
the windows showing the buffer whose narrowing changed should be
updated. So this is indeed a bug.
Emacs 24.3 and before used to be quite conservative in deciding when a
non-selected window should be redisplayed, as in "when in doubt,
redisplay". The current code was changed to attempt to refrain even
more from unnecessary redisplays, and this bug is fallout from those
changes.
> I would be interested to know how to determine when the window is
> redisplayed.
There's no simple answer to this question. Emacs employs several
flags to track when a buffer or a window or a frame might need to be
redrawn, and also tries to distinguish between redisplay of the window
content from redisplay of the mode line. Look at the first 200 lines
of redisplay_internal to see the complicated logic by which Emacs
decides whether it needs to redisplay more than just the selected
window on the selected frame.
prev parent reply other threads:[~2014-09-18 15:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-17 18:50 bug#18490: 24.3.93; Narrowing in other window no longer redisplays until a call to other-window Matthew Smiglarski
2014-09-18 15:20 ` Eli Zaretskii [this message]
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=83zjdx0xbx.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=18490-done@debbugs.gnu.org \
--cc=matthew.smiglarski@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 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.