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#19576: write-file writes the wrong buffer Date: Sat, 21 Nov 2015 13:35:02 +0200 Message-ID: <83k2pb4mc9.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> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1448105780 9738 80.91.229.3 (21 Nov 2015 11:36:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Nov 2015 11:36:20 +0000 (UTC) Cc: 19576@debbugs.gnu.org, andlind@gmail.com, juri@linkov.net To: acm@muc.de Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 21 12:36:10 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 1a06Sf-000765-SL for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Nov 2015 12:36:10 +0100 Original-Received: from localhost ([::1]:51954 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a06Sf-0003SJ-83 for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Nov 2015 06:36:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a06Sb-0003SE-G6 for bug-gnu-emacs@gnu.org; Sat, 21 Nov 2015 06:36:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a06SY-0004eB-6D for bug-gnu-emacs@gnu.org; Sat, 21 Nov 2015 06:36:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a06SY-0004e7-2c for bug-gnu-emacs@gnu.org; Sat, 21 Nov 2015 06:36:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a06SX-0001od-Uz for bug-gnu-emacs@gnu.org; Sat, 21 Nov 2015 06:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Nov 2015 11:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19576 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19576-submit@debbugs.gnu.org id=B19576.14481057186924 (code B ref 19576); Sat, 21 Nov 2015 11:36:01 +0000 Original-Received: (at 19576) by debbugs.gnu.org; 21 Nov 2015 11:35:18 +0000 Original-Received: from localhost ([127.0.0.1]:46655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a06Rp-0001nc-RP for submit@debbugs.gnu.org; Sat, 21 Nov 2015 06:35:18 -0500 Original-Received: from mtaout26.012.net.il ([80.179.55.182]:42604) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a06Rm-0001nS-WB for 19576@debbugs.gnu.org; Sat, 21 Nov 2015 06:35:16 -0500 Original-Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0NY500G00XNIN000@mtaout26.012.net.il> for 19576@debbugs.gnu.org; Sat, 21 Nov 2015 13:38:12 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NY5008YTXNNW460@mtaout26.012.net.il>; Sat, 21 Nov 2015 13:38:12 +0200 (IST) In-reply-to: <83mvua7z8k.fsf@gnu.org> 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:109012 Archived-At: > 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. Please tell me if this bug and bug#21333 could now be closed, or if there are any leftovers. Thanks.