From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#32672: 27.0.50; image resize on window resizing Date: Wed, 19 Sep 2018 10:22:59 +0200 Message-ID: <5BA20763.8070305@gmx.at> References: <87pnxmyjgt.fsf@mail.linkov.net> <87ftyfoakb.fsf@mail.linkov.net> <5B98B33D.7000605@gmx.at> <871s9ycnjl.fsf@mail.linkov.net> <5B9A15DA.5000403@gmx.at> <87efdxnfww.fsf@mail.linkov.net> <5B9B7253.5060808@gmx.at> <87pnxexr2m.fsf@mail.linkov.net> <5B9E1E0E.7070805@gmx.at> <87h8ip2eby.fsf@mail.linkov.net> <5B9F4DBD.5020009@gmx.at> <877ejjzr9s.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080005020001040809050402" X-Trace: blaine.gmane.org 1537345339 6628 195.159.176.226 (19 Sep 2018 08:22:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 19 Sep 2018 08:22:19 +0000 (UTC) Cc: 32672@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 19 10:22:14 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g2XkS-0001Y9-R7 for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Sep 2018 10:22:13 +0200 Original-Received: from localhost ([::1]:44212 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2XmZ-00070z-EN for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Sep 2018 04:24:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2XmT-00070u-9A for bug-gnu-emacs@gnu.org; Wed, 19 Sep 2018 04:24:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g2XmK-0000Kf-A1 for bug-gnu-emacs@gnu.org; Wed, 19 Sep 2018 04:24:14 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40859) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g2XmE-00005s-5n for bug-gnu-emacs@gnu.org; Wed, 19 Sep 2018 04:24:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g2XmE-0007Up-2D for bug-gnu-emacs@gnu.org; Wed, 19 Sep 2018 04:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Sep 2018 08:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32672 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32672-submit@debbugs.gnu.org id=B32672.153734539928752 (code B ref 32672); Wed, 19 Sep 2018 08:24:01 +0000 Original-Received: (at 32672) by debbugs.gnu.org; 19 Sep 2018 08:23:19 +0000 Original-Received: from localhost ([127.0.0.1]:45116 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g2XlX-0007Tg-01 for submit@debbugs.gnu.org; Wed, 19 Sep 2018 04:23:19 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:50179) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g2XlU-0007TS-U0 for 32672@debbugs.gnu.org; Wed, 19 Sep 2018 04:23:17 -0400 Original-Received: from [192.168.1.101] ([212.95.5.68]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTP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Y+ua8DZtBe67horY6xOcJOEazVacco75T5EZv54LTKWgEW/wWEu9dZfx my9mbl7T2vmMTEmW4mirRYzyUE0qTiQTmSKVp/l1ZzqYi8MM0GxfS+7dE144NEm0oe0NGxgu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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" Xref: news.gmane.org gmane.emacs.bugs:150445 Archived-At: This is a multi-part message in MIME format. --------------080005020001040809050402 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit > Please try with more buffers than initial 2 (*scratch* and *Messages*), > e.g. with *info* (just `C-h i'), I get > > 1 ... current: *scratch* ... window-buffer: *scratch* ... which is something you probably don't even want - it comes from 'get-buffer-create' when making the *info* buffer ... > 2 ... current: *scratch* ... window-buffer: *info* > > which is in an inconsistent state, ... not really - look at the backtrace: foo() run-hooks(buffer-list-update-hook) record-window-buffer(#) set-window-buffer(# #) window--display-buffer(# # reuse ((inhibit-same-window))) display-buffer-same-window(# ((inhibit-same-window))) display-buffer(# (display-buffer-same-window (inhibit-same-window))) pop-to-buffer("*info*" (display-buffer-same-window (inhibit-same-window)) nil) pop-to-buffer-same-window("*info*") info(nil nil) funcall-interactively(info nil nil) call-interactively(info nil nil) command-execute(info) 'pop-to-buffer' can "reasonably" select the window and thus implicitly make its buffer current only _after_ the buffer has been displayed via 'display-buffer-same-window'. I say reasonably because we could make the buffer current earlier but this doesn't strike me as a very good idea. It would constitute an incompatible change in the internal behavior of 'pop-to-buffer'. > and after typing `q' the hook is called 3 times > > 3 ... current: *scratch* ... window-buffer: *scratch* > 4 ... current: *scratch* ... window-buffer: *scratch* > 5 ... current: *scratch* ... window-buffer: *scratch* Look at the backtraces: 3 ... current: *scratch* ... window-buffer: *scratch* run-hooks(buffer-list-update-hook) record-window-buffer(#) set-window-buffer(# #) set-window-buffer-start-and-point(# # 1 #) quit-restore-window(nil bury) quit-window() Info-exit() funcall-interactively(Info-exit) call-interactively(Info-exit nil nil) command-execute(Info-exit) This one comes from replacing the *info* buffer with *scratch* in the window. 4 ... current: *scratch* ... window-buffer: *scratch* run-hooks(buffer-list-update-hook) select-window(#) quit-restore-window(nil bury) quit-window() Info-exit() funcall-interactively(Info-exit) call-interactively(Info-exit nil nil) command-execute(Info-exit) This one comes from selecting that window. 5 ... current: *scratch* ... window-buffer: *scratch* run-hooks(buffer-list-update-hook) bury-buffer-internal(#) quit-restore-window(nil bury) quit-window() Info-exit() funcall-interactively(Info-exit) call-interactively(Info-exit nil nil) command-execute(Info-exit) And this one comes from burying the *info* buffer. What should we do instead? > And there is the workflow how to break the correct order > of `C-x C-x ': > > 1. Create *info* buffer: `C-h i' and quit `q' > 2. Split windows `C-x 2' or `C-x 3' (both windows display *scratch*) > 3. Check that `C-x C-x ' correctly returns to the original > buffer *scratch* in the first window. > 4. After `C-x o' in another window `C-x C-x ' > doesn't return to the original buffer *scratch*. > It displays *info*. Evidently, this comment for 'record-window-buffer' ;; The following function is called by `set-window-buffer' _before_ it ;; replaces the buffer of the argument window with the new buffer. had its purpose. Please try the attached patch. Thanks, martin --------------080005020001040809050402 Content-Type: text/plain; charset=windows-1252; name="buffer-list-update-hook.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="buffer-list-update-hook.diff" LS0tIGEvbGlzcC93aW5kb3cuZWwKKysrIGIvbGlzcC93aW5kb3cuZWwKQEAgLTQyNzQsOSAr NDI3NCw3IEBAIHJlY29yZC13aW5kb3ctYnVmZmVyCiAJCQkgICAgICAgOzsgKEJ1ZyMxMjU4 OCkuCiAJCQkgICAgICAgcG9pbnQg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ICB7CisJICAgICAgY2FsbDEgKFFy ZWNvcmRfd2luZG93X2J1ZmZlciwgd2luZG93KTsKKworCSAgICAgIGlmICghTklMUCAoVnJ1 bl9ob29rcykpCisJCWNhbGwxIChWcnVuX2hvb2tzLCBRYnVmZmVyX2xpc3RfdXBkYXRlX2hv b2spOworCSAgICB9CiAJfQogCiAgICAgICAvKiBEaXNhbGxvdyB4X3NldF93aW5kb3dfc2l6 ZSwgdGVtcG9yYXJpbHkuICAqLwoK --------------080005020001040809050402--