From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83zjdx0xbx.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1411053717 6302 80.91.229.3 (18 Sep 2014 15:21:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Sep 2014 15:21:57 +0000 (UTC) Cc: 18490-done@debbugs.gnu.org To: Matthew Smiglarski Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 18 17:21:50 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XUdWm-0002K0-Aq for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Sep 2014 17:21:48 +0200 Original-Received: from localhost ([::1]:51752 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUdWl-00066U-L4 for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Sep 2014 11:21:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUdWI-0005Vs-7f for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 11:21:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUdW8-0007Il-0d for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 11:21:18 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUdW7-0007Hg-UF for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 11:21:07 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XUdW2-0005KJ-Jl for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 11:21:02 -0400 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Sep 2014 15:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 18490 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 18490@debbugs.gnu.org, eliz@gnu.org, matthew.smiglarski@gmail.com Original-Received: via spool by 18490-done@debbugs.gnu.org id=D18490.141105363820425 (code D ref 18490); Thu, 18 Sep 2014 15:21:01 +0000 Original-Received: (at 18490-done) by debbugs.gnu.org; 18 Sep 2014 15:20:38 +0000 Original-Received: from localhost ([127.0.0.1]:44646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUdVd-0005JM-4P for submit@debbugs.gnu.org; Thu, 18 Sep 2014 11:20:37 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:33102) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUdVa-0005JA-3Z for 18490-done@debbugs.gnu.org; Thu, 18 Sep 2014 11:20:35 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0NC300M00RO53G00@a-mtaout23.012.net.il> for 18490-done@debbugs.gnu.org; Thu, 18 Sep 2014 18:20:32 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC300MEQRY83910@a-mtaout23.012.net.il>; Thu, 18 Sep 2014 18:20:32 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:93470 Archived-At: > Date: Wed, 17 Sep 2014 19:50:46 +0100 > From: Matthew Smiglarski > > 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.