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#21333: bug#19576: write-file writes the wrong buffer Date: Sat, 21 Nov 2015 18:02:39 +0200 Message-ID: <83a8q749y8.fsf@gnu.org> References: <564A3292.2050807@gmx.at> <87fv05phpw.fsf@mail.linkov.net> <20151117200204.GA5054@acm.fritz.box> <83lh9v9p7k.fsf@gnu.org> <20151118232304.GB1690@acm.fritz.box> <83mvua7z8k.fsf@gnu.org> <83k2pb4mc9.fsf@gnu.org> <20151121155658.GA3636@acm.fritz.box> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1448121808 11377 80.91.229.3 (21 Nov 2015 16:03:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Nov 2015 16:03:28 +0000 (UTC) To: 21333-done@debbugs.gnu.org, 21869-done@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 21 17:03:17 2015 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 1a0Ad6-0000V3-13 for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Nov 2015 17:03:12 +0100 Original-Received: from localhost ([::1]:52765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0Ad5-0006jr-Ix for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Nov 2015 11:03:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0Ad0-0006ge-Fv for bug-gnu-emacs@gnu.org; Sat, 21 Nov 2015 11:03:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0Acx-0003T7-6r for bug-gnu-emacs@gnu.org; Sat, 21 Nov 2015 11:03:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0Acx-0003T3-3y for bug-gnu-emacs@gnu.org; Sat, 21 Nov 2015 11:03:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a0Acw-0001MZ-Sm for bug-gnu-emacs@gnu.org; Sat, 21 Nov 2015 11:03:02 -0500 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Nov 2015 16:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 21333 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 21333@debbugs.gnu.org, eliz@gnu.org, pipcet@gmail.com Original-Received: via spool by 21333-done@debbugs.gnu.org id=D21333.14481217735214 (code D ref 21333); Sat, 21 Nov 2015 16:03:02 +0000 Original-Received: (at 21333-done) by debbugs.gnu.org; 21 Nov 2015 16:02:53 +0000 Original-Received: from localhost ([127.0.0.1]:47217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a0Acn-0001M1-4f for submit@debbugs.gnu.org; Sat, 21 Nov 2015 11:02:53 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:42367) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a0Ack-0001Lo-Oe; Sat, 21 Nov 2015 11:02:51 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NY600K009WPI700@a-mtaout22.012.net.il>; Sat, 21 Nov 2015 18:02:49 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NY600KPD9WOHJ00@a-mtaout22.012.net.il>; Sat, 21 Nov 2015 18:02:49 +0200 (IST) In-reply-to: <20151121155658.GA3636@acm.fritz.box> 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: 208.118.235.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:109017 Archived-At: > Date: Sat, 21 Nov 2015 15:56:58 +0000 > Cc: 19576@debbugs.gnu.org, andlind@gmail.com, juri@linkov.net > From: Alan Mackenzie > > Hello, Eli. > > On Sat, Nov 21, 2015 at 01:35:02PM +0200, Eli Zaretskii wrote: > > > Date: Thu, 19 Nov 2015 18:03:39 +0200 > > > From: Eli Zaretskii > > > Cc: 19576@debbugs.gnu.org, andlind@gmail.com, juri@linkov.net > > > > > Date: Wed, 18 Nov 2015 23:23:04 +0000 > > > > Cc: martin rudalics , juri@linkov.net, andlind@gmail.com, > > > > 19576@debbugs.gnu.org > > > > From: Alan Mackenzie > > > > > > Could you try a simpler patch below? It seems to fix both your test > > > > > case and the one originally reported in bug#21333. > > > > > It does indeed fix my test case (I haven't tried it on #21333). However > > > > it violates the specification of window-size-change-functions, which > > > > says that the hook is called _before_ redisplay, not after it has > > > > started. I suppose one could argue over what "redisplay" means here, > > > > but intuitively I would say it is the putting of glyphs into matrices. > > > > "Redisplay" is indeed not defined well enough, but the only reasonable > > > interpretation of "before redisplay" is that it happens before the > > > call to redisplay_internal. And this is false for your suggested > > > solution as well. It is false even by your definition, because > > > prepare_menu_bars already manipulates the glyph matrices, the ones it > > > creates for the tool bar (and also menu bar on some display types). > > > And display_echo_area also manipulates glyph matrices (it calls > > > try_window). > > > > Which is only logical for an event that by itself is triggered as part > > > of redisplay! It's redisplay that decides to resize the mini-window, > > > so calling the hook after that decision _cannot_ possibly count as > > > being "before redisplay". > > > > IOW, once we, by popular demand, decided to call > > > window-size-change-functions when the mini-window is resized, we > > > invalidated that specification. All the other callers of this hook > > > are not part of a redisplay cycle, but this one is, and cannot be > > > anywhere else. > > > > So no matter what change we eventually install, the documentation of > > > the hook needs to be amended to say that it's called "before redisplay > > > or at the beginning of a redisplay cycle", and maybe also mention that > > > the second case is when the mini-window is resized. > > > No further comments, so I've committed the changes I posted here > > earlier. I also modified the documentation to be consistent with what > > the code does. > > Thanks. > > > Please tell me if this bug and bug#21333 could now be closed, or if > > there are any leftovers. > > I don't think this fix concerns #19576. The discussion of #21869 seems, > somehow, to have moved to here. > > But I think that #21333 can be closed, and #21869 certainly can be; both > of these were about window-size-change-functions not getting called for > echo area size changes. Closing.