From unknown Sat Jun 14 04:54:10 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#32672 <32672@debbugs.gnu.org> To: bug#32672 <32672@debbugs.gnu.org> Subject: Status: 27.0.50; image resize on window resizing Reply-To: bug#32672 <32672@debbugs.gnu.org> Date: Sat, 14 Jun 2025 11:54:10 +0000 retitle 32672 27.0.50; image resize on window resizing reassign 32672 emacs submitter 32672 Juri Linkov severity 32672 wishlist tag 32672 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 09 12:10:53 2018 Received: (at submit) by debbugs.gnu.org; 9 Sep 2018 16:10:53 +0000 Received: from localhost ([127.0.0.1]:51438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fz2IX-0006rH-KP for submit@debbugs.gnu.org; Sun, 09 Sep 2018 12:10:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fz2IV-0006r2-W0 for submit@debbugs.gnu.org; Sun, 09 Sep 2018 12:10:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fz2IO-0003B3-Ab for submit@debbugs.gnu.org; Sun, 09 Sep 2018 12:10:46 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58610) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fz2IN-0003AW-G0 for submit@debbugs.gnu.org; Sun, 09 Sep 2018 12:10:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fz2IH-0003Mq-Gh for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2018 12:10:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fz23g-0002w5-5L for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2018 11:55:32 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:37546 helo=pdx1-sub0-mail-a38.g.dreamhost.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fz23f-0002sV-Rp for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2018 11:55:32 -0400 Received: from pdx1-sub0-mail-a38.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a38.g.dreamhost.com (Postfix) with ESMTP id 142B47F250 for ; Sun, 9 Sep 2018 08:55:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:date:message-id:mime-version:content-type; s= linkov.net; bh=4fPGONWJR2c6CUEqJ8LlHuX/BDc=; b=d/zAPo9RBI/hYs0a1 814I0UxiWoR/if5VIoc2eohlZ4Vgvo2ig37xcSXMms1wO+o361W+0XpzVkewIslD hNSVYWa8NvrRrxUwMgVqkwy4CfiveEsXE0F/ZdGJqSTKkIwJGrinc1CYCZvx2bpc R2oo2qcqe6MxjQMjJZrGeZbXkA= Received: from localhost.linkov.net (m91-129-104-147.cust.tele2.ee [91.129.104.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a38.g.dreamhost.com (Postfix) with ESMTPSA id 60F047F24E for ; Sun, 9 Sep 2018 08:55:30 -0700 (PDT) From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: 27.0.50; image resize on window resizing Organization: LINKOV.NET Date: Sun, 09 Sep 2018 18:54:27 +0300 Message-ID: <87pnxmyjgt.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) --=-=-= Content-Type: text/plain Like dynamically reformatting Man-mode buffers on window resizing in bug#32536 it would be useful to do the same for image-mode. By default, when an image is visited, it gets resized to fit into the window. But on window shrinking, parts of the image become truncated, and on window enlarging too much of empty space is wasted since the image is not zoomed. This patch relies on improvements in bug#32637. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=image-mode.1.patch diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 19fa28d440..9c7199ba9e 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -574,6 +574,7 @@ image-mode (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t) (add-hook 'after-revert-hook 'image-after-revert-hook nil t) + (add-hook 'window-size-change-functions 'image-window-size-change nil t) (run-mode-hooks 'image-mode-hook) (let ((image (image-get-display-property)) (msg1 (substitute-command-keys @@ -822,6 +823,17 @@ image-after-revert-hook (get-buffer-window-list (current-buffer) 'nomini 'visible)) (image-toggle-display-image))) +(defun image-window-size-change (frame) + (walk-windows (lambda (window) + (when (or (/= (window-pixel-width-before-size-change window) + (window-pixel-width window)) + (/= (window-pixel-height-before-size-change window) + (window-pixel-height window))) + (with-current-buffer (window-buffer window) + (when (derived-mode-p 'image-mode) + (image-after-revert-hook))))) + 'nomini frame)) + ;;; Animated images --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 11 20:11:21 2018 Received: (at 32672) by debbugs.gnu.org; 12 Sep 2018 00:11:21 +0000 Received: from localhost ([127.0.0.1]:37446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzskb-0005CM-Gt for submit@debbugs.gnu.org; Tue, 11 Sep 2018 20:11:21 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:51238 helo=pdx1-sub0-mail-a38.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzska-0005CF-R5 for 32672@debbugs.gnu.org; Tue, 11 Sep 2018 20:11:21 -0400 Received: from pdx1-sub0-mail-a38.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a38.g.dreamhost.com (Postfix) with ESMTP id 02AEE7F26B for <32672@debbugs.gnu.org>; Tue, 11 Sep 2018 17:11:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=SJq+wcu0naHHSGjQLrzqMkfSSrg=; b= eVLawn9Gp3Y7Gnz8I52uRl03Ut/a4Pf8MKx6kszxSpea8ZdKk02LJ1Dsx4TAE/Ma DOI9GQLYlFGN8ja1eCRayLgCGYa3pVLonI1j902GepGx9v9boNfcQ7vImMhKCN20 fJvK/aOkeQ/3krXMm31DOwquyBqCJ439aWpThKSklUw= Received: from localhost.linkov.net (m91-129-104-147.cust.tele2.ee [91.129.104.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a38.g.dreamhost.com (Postfix) with ESMTPSA id B71A47F269 for <32672@debbugs.gnu.org>; Tue, 11 Sep 2018 17:11:18 -0700 (PDT) From: Juri Linkov To: 32672@debbugs.gnu.org Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET References: <87pnxmyjgt.fsf@mail.linkov.net> Date: Wed, 12 Sep 2018 02:53:40 +0300 In-Reply-To: <87pnxmyjgt.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 09 Sep 2018 18:54:27 +0300") Message-ID: <87ftyfoakb.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Like dynamically reformatting Man-mode buffers on window resizing in bug#32536 > it would be useful to do the same for image-mode. By default, when an image > is visited, it gets resized to fit into the window. But on window shrinking, > parts of the image become truncated, and on window enlarging too much of > empty space is wasted since the image is not zoomed. There is still a problem how to catch a moment when an image-mode buffer is displayed after switching to it. For example, when the selected window is resized while it displayed a non-image-mode buffer, then after that the current buffer switched to the image-mode buffer. I can't find a hook that could be activated to resize the image to fit the new sizes of the window. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 12 03:02:42 2018 Received: (at 32672) by debbugs.gnu.org; 12 Sep 2018 07:02:42 +0000 Received: from localhost ([127.0.0.1]:37733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzzAf-0007PR-Tq for submit@debbugs.gnu.org; Wed, 12 Sep 2018 03:02:42 -0400 Received: from mout.gmx.net ([212.227.17.20]:51609) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzzAb-0007Oy-WB for 32672@debbugs.gnu.org; Wed, 12 Sep 2018 03:02:38 -0400 Received: from [192.168.1.101] ([213.162.73.211]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Lz0aC-1fmfQL3Aem-014955; Wed, 12 Sep 2018 09:02:29 +0200 Message-ID: <5B98B33D.7000605@gmx.at> Date: Wed, 12 Sep 2018 08:33:33 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov , 32672@debbugs.gnu.org Subject: Re: bug#32672: 27.0.50; image resize on window resizing References: <87pnxmyjgt.fsf@mail.linkov.net> <87ftyfoakb.fsf@mail.linkov.net> In-Reply-To: <87ftyfoakb.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:jTd1XSrMTUI/Y+tyEA/tr+yTW+r7mnFfcppOocnvnr5VvcLI2a+ Makp5NI9RoGg5LCYEEIGFEbKw142qUzccwZR36AU1bfQnnrulohdkdILxvkTmBQlNaJ4i0A 4ghFdJqLRu++uCz9eQQ6fnq4Sqg+WzBlRh5M8T8yGbHGGqh1E51FgyWx25h9BirxhwzmKxZ t4CxlkdYWEQjU1Oxdz4EA== X-UI-Out-Filterresults: notjunk:1;V01:K0:aGhAFqtXj3E=:C/J3xU23pUT2QwUuX8lIpJ Pe9IUs6yxwf+103oq+evJp8zgpV1Mnon/JGzITkF6nNvdIUm8YGpWo409q11shjjIO3yNZ1q6 Tl2cFjWJaNGxe8ze6MsFq07XVNm9PxnG0cdGsJ2qIYHyjqiS6MJzWfLIDK6fDGc2p1YIJBk0q mW39FAdWU+Zh91x75MyeI7/4147XBgeiESrJDzRmnltZAj2HRgA4Dg6Br7rDWUzLt3mtBRxZ0 3HdLdXIFd38MSnDnsbNqbH4EeUlNgXlFliSKZoLtJca8LYkWDao2On6QefX/Ze+EAVaUcTRRG bEBLDONAE8Bf/Y4dyG0YqmNN+F4n38B2RBztot/iFxBCc1AijHZgZ6Y0aDvd9AdsF0xdyki/R jB9SgTTdbxMxMs2/IIjRekd8mGu71vMHw++7rNkle4yjzFZ4ig+IBXTVE4dY3MfbRKkerMq4n b7YagTL/WUTYh2A2TKthz3QOzGk6rg+MhpAAluOa5VuTJ/tU7s/5G+sS3LG6HZ0PFLOfaIlIr YcSYU6COfYNP677EVWK7Be6QvuaTQ8V9MwVJVJtJlHHd6sbAQLIXXMFKWuy+X9xd83dvwLApF NyYonFaeB35OdIwGIH15BIdxTOvWToBnpeYYWcCvrhnxJ7C3oaa7SuyyaZNKcd4qx0WDgV2Pc QWQvqGy7bQhR6Bgc8/2M2ytbzcYWQhawmyUK7p1mMKMbxmPzJVYnlHibgeP3Coy9PDrs/muCR fwKeaHITEG7bku/RONhg3rbLkF07h45wBj1Tye7piRtVG7T6+F7yPr30KQaTBBCWU6dFOkvXS 0khuFza X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > There is still a problem how to catch a moment when an image-mode buffer > is displayed after switching to it. "Switching to a buffer" means to display it ... > For example, when the selected window > is resized while it displayed a non-image-mode buffer, then after that > the current buffer switched to the image-mode buffer. ... so please reformulate this in terms of a sequence of some sort of pseudo actions. In Emacs terminology, switching to a buffer implies making it current but making a buffer current doesn't imply switching to it. > I can't find a hook > that could be activated to resize the image to fit the new sizes of the window. Tell us which action should trigger such a hook. Thanks, martin From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 12 19:22:41 2018 Received: (at 32672) by debbugs.gnu.org; 12 Sep 2018 23:22:41 +0000 Received: from localhost ([127.0.0.1]:38551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0ET2-0004em-TG for submit@debbugs.gnu.org; Wed, 12 Sep 2018 19:22:41 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:47688 helo=pdx1-sub0-mail-a21.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0ET1-0004ee-Ot for 32672@debbugs.gnu.org; Wed, 12 Sep 2018 19:22:40 -0400 Received: from pdx1-sub0-mail-a21.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a21.g.dreamhost.com (Postfix) with ESMTP id B9D237FFCA; Wed, 12 Sep 2018 16:22:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=y0p3kK6jEpXWIS53Fjbs4046rxM=; b= EcY712flp1KvJdICAWe04zDAmx5ie99nBc77x6J8oVtON5O4v7T+YMpkoIpb64ZD dUZpwwix+O6aiA9vp5hrdw+quWfQCxlzS+mVByGDOWwdYIp7GKgGDQRlg42ytnaP S52a8eDpQZ9jM4is+4noKc8B45c/pjzzU73tXp128vs= Received: from localhost.linkov.net (m91-129-104-147.cust.tele2.ee [91.129.104.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a21.g.dreamhost.com (Postfix) with ESMTPSA id 248157FFC5; Wed, 12 Sep 2018 16:22:36 -0700 (PDT) From: Juri Linkov To: martin rudalics Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET References: <87pnxmyjgt.fsf@mail.linkov.net> <87ftyfoakb.fsf@mail.linkov.net> <5B98B33D.7000605@gmx.at> Date: Thu, 13 Sep 2018 02:18:38 +0300 In-Reply-To: <5B98B33D.7000605@gmx.at> (martin rudalics's message of "Wed, 12 Sep 2018 08:33:33 +0200") Message-ID: <871s9ycnjl.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> There is still a problem how to catch a moment when an image-mode buffer >> is displayed after switching to it. > > "Switching to a buffer" means to display it ... > >> For example, when the selected window >> is resized while it displayed a non-image-mode buffer, then after that >> the current buffer switched to the image-mode buffer. > > ... so please reformulate this in terms of a sequence of some sort of > pseudo actions. In Emacs terminology, switching to a buffer implies > making it current but making a buffer current doesn't imply switching > to it. > >> I can't find a hook >> that could be activated to resize the image to fit the new sizes of the window. > > Tell us which action should trigger such a hook. It's not straightforward to find a hook that covers all cases, it seems at least it should be called when an image-mode buffer comes to the top of buffer-list, and the closest hook for that is buffer-list-update-hook. I see that when it's buffer-local, then it guarantees that the affected image-mode buffer is always current-buffer at the time of hook invocation. It's fired every time the image-mode buffer comes to the top, even when calling quit-window on another buffer that gives way to the image-mode buffer. The only case when buffer-list-update-hook doesn't run is when the image-mode buffer comes to the top by `C-x ' (previous-buffer), whereas `C-x ' (next-buffer) works fine. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 13 03:46:53 2018 Received: (at 32672) by debbugs.gnu.org; 13 Sep 2018 07:46:53 +0000 Received: from localhost ([127.0.0.1]:38694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0MKz-0000v6-Cd for submit@debbugs.gnu.org; Thu, 13 Sep 2018 03:46:53 -0400 Received: from mout.gmx.net ([212.227.17.21]:58797) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0MKx-0000uq-05 for 32672@debbugs.gnu.org; Thu, 13 Sep 2018 03:46:51 -0400 Received: from [192.168.1.101] ([213.162.73.2]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MLB89-1g0dJg2oYD-000HeY; Thu, 13 Sep 2018 09:46:41 +0200 Message-ID: <5B9A15DA.5000403@gmx.at> Date: Thu, 13 Sep 2018 09:46:34 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32672: 27.0.50; image resize on window resizing References: <87pnxmyjgt.fsf@mail.linkov.net> <87ftyfoakb.fsf@mail.linkov.net> <5B98B33D.7000605@gmx.at> <871s9ycnjl.fsf@mail.linkov.net> In-Reply-To: <871s9ycnjl.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:G3D/TOjtrGKe3uZfT+BeHoNeZbpDyBPToIMIEq0xXp6Mzw/8zva 8CVz79nnG6oNQMVFu316K9dbq7YbEJvYnpxOYx2QtKNcq6EVOiFgJsAjcvkOzxua5oyEdE0 elznymaR6V9qhVSD7f1AjC7dQl0mY1ExUHYq4dLqwOeumaZzkXFgEpMBem8KZF0gF2HtKaL 1IzT7DmgNUVtnw92xGedA== X-UI-Out-Filterresults: notjunk:1;V01:K0:5jvJ3EEi6Ik=:hD8IUsV/gUCxObEvAiTF8w 2mJ6cXTNR98+s9jiPMo48X1Mx9IPewQUJMHn5wLx6sbfCIx9GLG5S+EtK6ELhaFuhvpGmHKG5 K8HNr0/kooOndqgRLoeXDsKMoV6OSojqQ/1KY+LtUrssfybKA9U0Vrtl5EZALbBT7g6R1UHvR AxYZtr7YMDVX8gaIsptTp39JFmnE2IWdj6B8aE6nVCMgJnB3aDo1+D1RSodT5IhettusKySnS 83WjtcstZdWhYhfVC/vJrN0DtGaCk4ivxqmkjCvFOd0X1Ygm1H801IG8H5F7yGrE/NUkaeIWJ A9Z2r2/HPumIO25pa+HQwGh+Gs1VW4ef0qGj8ylBB3JigYJ6lbfimRp5KgkIrcTvM/Kk/BG+E 9uHrxm5RZkxJCBBmPj8NzUSYkKwXk0kRmlxzZd6ZAYSahFfUfbVgOCeDvmcusGvOzd0F8LrGZ SeU9s7qzS5fmYJKofBk/Sue0ASPjKRyMeG1JtQWLmBYdj5VJLt3X8gitK1yxuRX7WXM6k/x4i 2rR+auCgUFzA1A31HN1sBVFZn4GD5uFofQHyYesALh7TJ5oNiIu5BUMHnkUNBKn7QGh3eUtTD 7McqA95fDb2BAYOBo8pWubkhNvTf/iGEa6Ith7HOqnWl52hDR3JqFIeDx5XE8W5UFxrr5xYgE zVQm2Ks7LB9zpPhyASlkklUrcy/y2iws2QoYF4MdVNFuIu4a3dkbZEKL+04rV2OzNoIE2IOlz wii0g5kwfoEjzlBPHr2UT6X6Fzny13rtvUAhD+IFf0JkhzwKxB2ATsJJsTyGrD5mUSLpYiOsu a4S9tNlISCTAnvWOdVyADnbwXlylwlh09NU4sMciQtZOWPEhio= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > It's not straightforward to find a hook that covers all cases, it seems > at least it should be called when an image-mode buffer comes to the top > of buffer-list, and the closest hook for that is buffer-list-update-hook. I still don't get why you need to know whether the image-mode buffer comes to top in order to decide on resizing the image. > I see that when it's buffer-local, then it guarantees that the affected > image-mode buffer is always current-buffer at the time of hook invocation. There should not be any such guarantee. > It's fired every time the image-mode buffer comes to the top, even when > calling quit-window on another buffer that gives way to the image-mode buffer. > > The only case when buffer-list-update-hook doesn't run is when the > image-mode buffer comes to the top by `C-x ' (previous-buffer), > whereas `C-x ' (next-buffer) works fine. This must be a bug but I don't understand how it could happen. 'switch-to-prev-buffer' calls 'set-window-buffer-start-and-point' which calls 'set-window-buffer' which calls 'record-window-buffer' which should call 'buffer-list-update-hook'. Can you trace while it fails for you? Thanks, martin From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 13 19:22:08 2018 Received: (at 32672) by debbugs.gnu.org; 13 Sep 2018 23:22:08 +0000 Received: from localhost ([127.0.0.1]:39794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0aw4-00028K-8q for submit@debbugs.gnu.org; Thu, 13 Sep 2018 19:22:08 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:57506 helo=pdx1-sub0-mail-a31.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0aw2-00028C-4z for 32672@debbugs.gnu.org; Thu, 13 Sep 2018 19:22:06 -0400 Received: from pdx1-sub0-mail-a31.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a31.g.dreamhost.com (Postfix) with ESMTP id 454827F979; Thu, 13 Sep 2018 16:22:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=vPoHIxaHo5ci2kvY4CY/56oeFIo=; b= Bf0vWlcJRLp27uanDjF3yddRXh3AuIoLQdz//lq2lxk8fAma2NvoTYbTJYP0eYA3 VLfHY+LjbCq9qBCkzBBuGIOk1h4UJ+R/VWyuco64vz8yACdbTFrV0+vR8txnab3m bXJtKlj5Utd9flFMKpQpTmJDYIsl7ytouFyN1tsf+GM= Received: from localhost.linkov.net (m91-129-104-147.cust.tele2.ee [91.129.104.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a31.g.dreamhost.com (Postfix) with ESMTPSA id A8F0F7F978; Thu, 13 Sep 2018 16:22:02 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a31 X-DH-BACKEND: pdx1-sub0-mail-a31 From: Juri Linkov To: martin rudalics Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET References: <87pnxmyjgt.fsf@mail.linkov.net> <87ftyfoakb.fsf@mail.linkov.net> <5B98B33D.7000605@gmx.at> <871s9ycnjl.fsf@mail.linkov.net> <5B9A15DA.5000403@gmx.at> Date: Fri, 14 Sep 2018 02:20:15 +0300 In-Reply-To: <5B9A15DA.5000403@gmx.at> (martin rudalics's message of "Thu, 13 Sep 2018 09:46:34 +0200") Message-ID: <87efdxnfww.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> It's not straightforward to find a hook that covers all cases, it seems >> at least it should be called when an image-mode buffer comes to the top >> of buffer-list, and the closest hook for that is buffer-list-update-hook. > > I still don't get why you need to know whether the image-mode buffer > comes to top in order to decide on resizing the image. For example, visit an image, type `C-h i', resize the window, type `C-x k RET' (not `q', because `q' restores previous window sizes), then the image is not updated to fit the resized window. >> It's fired every time the image-mode buffer comes to the top, even when >> calling quit-window on another buffer that gives way to the image-mode buffer. >> >> The only case when buffer-list-update-hook doesn't run is when the >> image-mode buffer comes to the top by `C-x ' (previous-buffer), >> whereas `C-x ' (next-buffer) works fine. > > This must be a bug but I don't understand how it could happen. > 'switch-to-prev-buffer' calls 'set-window-buffer-start-and-point' > which calls 'set-window-buffer' which calls 'record-window-buffer' > which should call 'buffer-list-update-hook'. Can you trace while it > fails for you? Trying to put to image-mode: (add-hook 'buffer-list-update-hook (lambda () (message "buffer-list-update-hook %S" (current-buffer))) nil t) shows in *Messages* that it's called only when navigating away from the image-mode buffer, but not when coming back to the image-mode buffer, e.g. `C-x ', then resize the window, then type `C-x ', it's not called. Also it's not called in another direction: `C-x ', then resize the window, then type `C-x '. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 14 04:33:45 2018 Received: (at 32672) by debbugs.gnu.org; 14 Sep 2018 08:33:45 +0000 Received: from localhost ([127.0.0.1]:40033 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0jXt-00088K-Ig for submit@debbugs.gnu.org; Fri, 14 Sep 2018 04:33:45 -0400 Received: from mout.gmx.net ([212.227.15.18]:34083) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0jXr-000887-Cs for 32672@debbugs.gnu.org; Fri, 14 Sep 2018 04:33:43 -0400 Received: from [192.168.1.101] ([46.125.249.30]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MfVYB-1gApT30xQZ-00P6vC; Fri, 14 Sep 2018 10:33:34 +0200 Message-ID: <5B9B7253.5060808@gmx.at> Date: Fri, 14 Sep 2018 10:33:23 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32672: 27.0.50; image resize on window resizing 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> In-Reply-To: <87efdxnfww.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:eBs8Ta1pic8H6n/yE1PlMgJRHg4vjISpF7zUsnFWE45TYFoUJUR 4dT6MSKvud156c9S5nD1fnkSLNsn3/75GtgmTLOVndnFiXCJn7SDYKYOVyHw0jrXHBwxBe4 zyJC521Qs9OrzsSzkls1HWPMnaY2CTa0NVCzqsnDs1rzfML23jl/0bxCZMjAsqoe1lTYerT CJ9O5Q3UADitJhLSZXBCA== X-UI-Out-Filterresults: notjunk:1;V01:K0:6QSKKuCWs4U=:dDUUro2Uygv9NLtEJ5hKdn 16nv9yx91dOtkj4g4K/raK7QmUB6Ez6m3Oua5UjxFbptscHf8TLgniyEyFlJI//XYWTSiYOIh dZ9TOeFnhQmXUqvajh9Ci3c8Tuh6gXEmE7gF5MA4lecdpC4uNo8r8b+uqVt7JkCCCQeWCTg2p HUQnJtqujer+U+x0t9t4XEiNr7igBybJ2h/3xbqmXURl4fwK+u9ZhbCJy6u4YPLL2wpUTUMyx n/i3N6I2RFeGyMKGrxezdSMhu89x31SMpsSLaT38HT2uBsZEslFHiZmDtowxWe6OTLltm0/Cs dLzL/q8qIClE7pJRqvFdDh05k5yjAeNzUd6vSCNo9uKaRRAnI160RIYYWy6Rf53/nDWMdvQUr MgbfBzza6i78svpipF/0RtiASbXRIckXMXoH57T1hHUbr155jEUX5xUBtvcEwHeYkz9sNBCgH guFFX+xTQdipKzn8UNpxuBRGU74axj13OKPcomRq1R7edkzcnUMrR5+u130RCXCC8uW8XtavH +XOjfpUdQ3evGOtC/WC8L3F6IOf8ZzRX/koJhgXpSgQRA9bu6q0DEQwH0HYYcZGk4auJ+B8Dk hMhy4gXhY24ed9FHySiSZxj5RqzalexybkPuFUWYEQoJEdFAsQD0yLqXNPfzigPN56p2r7kem teowdGtuTu5m+hZ51ODJ8cEwATGwO0rpckbyZjdQHquJM3YCa7NT6HnlgUQtiJoN+knafiG3f kfCj4oNlNetPw7f6Eqh3eGGeGpRxF4KRx81EBeyNAQ2rgqEnVV8M3ULpCSdYfcbLNeRY3Xjii PotqWCS6OScxEyXMXPt1NrdKZj/8dQ0LvdlypVaoLw599W6LQE= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Trying to put to image-mode: > > (add-hook 'buffer-list-update-hook > (lambda () (message "buffer-list-update-hook %S" > (current-buffer))) nil t) > > shows in *Messages* that it's called only when navigating away from the > image-mode buffer, but not when coming back to the image-mode buffer, e.g. > `C-x ', then resize the window, then type `C-x ', > it's not called. Also it's not called in another direction: > `C-x ', then resize the window, then type `C-x '. I forgot that you wanted to make this buffer-local as well. We curently have no special semantics attached to the buffer-local version of this so yes: When the buffer is not current, its local hook is not run. To fix this, for example in 'bury-buffer-internal' we would have to add an extra /* Run buffer-list-update-hook. */ if (!NILP (Vrun_hooks)) call1 (Vrun_hooks, Qbuffer_list_update_hook); with BUFFER current. We probably could do that but I'm not very fond of it. The buffer list is decidedly more global than a window. And it's only the tip of an iceberg - how many more hooks would we have to adapt in a similar fashion? martin From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 15 19:49:36 2018 Received: (at 32672) by debbugs.gnu.org; 15 Sep 2018 23:49:36 +0000 Received: from localhost ([127.0.0.1]:41823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g1KJk-0003A3-FG for submit@debbugs.gnu.org; Sat, 15 Sep 2018 19:49:36 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:37904 helo=pdx1-sub0-mail-a20.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g1KJj-00039w-3P for 32672@debbugs.gnu.org; Sat, 15 Sep 2018 19:49:35 -0400 Received: from pdx1-sub0-mail-a20.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a20.g.dreamhost.com (Postfix) with ESMTP id 38E258103C; Sat, 15 Sep 2018 16:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=xJO0MEZZxr/cAbKaQAnMKF09tsI=; b= DBGFzi61aVEUm3XjIyGthkluqhdBbp2ZY56gKZh6e8iHmxfpFLOgKWt2FuHvD8g3 10d+Dea78gaREsMIL6x89xFuMyE0y8Nokdm22zK6BTi7zZNvO4HpTmYlxtDhtWoP YPK94frO/j9BodoyN7irLTec682RS7u+7wa4w7M4ENE= Received: from localhost.linkov.net (m91-129-107-237.cust.tele2.ee [91.129.107.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a20.g.dreamhost.com (Postfix) with ESMTPSA id 9DC3C80236; Sat, 15 Sep 2018 16:49:32 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a20 X-DH-BACKEND: pdx1-sub0-mail-a20 From: Juri Linkov To: martin rudalics Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET 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> Date: Sun, 16 Sep 2018 02:35:53 +0300 In-Reply-To: <5B9B7253.5060808@gmx.at> (martin rudalics's message of "Fri, 14 Sep 2018 10:33:23 +0200") Message-ID: <87pnxexr2m.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> Trying to put to image-mode: >> >> (add-hook 'buffer-list-update-hook >> (lambda () (message "buffer-list-update-hook %S" >> (current-buffer))) nil t) >> >> shows in *Messages* that it's called only when navigating away from the >> image-mode buffer, but not when coming back to the image-mode buffer, e.g. >> `C-x ', then resize the window, then type `C-x ', >> it's not called. Also it's not called in another direction: >> `C-x ', then resize the window, then type `C-x '. > > I forgot that you wanted to make this buffer-local as well. We > curently have no special semantics attached to the buffer-local > version of this so yes: When the buffer is not current, its local hook > is not run. To fix this, for example in 'bury-buffer-internal' we > would have to add an extra > > /* Run buffer-list-update-hook. */ > if (!NILP (Vrun_hooks)) > call1 (Vrun_hooks, Qbuffer_list_update_hook); > > with BUFFER current. We probably could do that but I'm not very fond > of it. The buffer list is decidedly more global than a window. And > it's only the tip of an iceberg - how many more hooks would we have to > adapt in a similar fashion? I agree that the buffer list is more global than a window, but OTOH it makes sense to use buffer-local hook for a buffer to get notified when it comes to the top of the buffer list. So this would be a good thing to have, unless there is another hook that gets called when a buffer becomes the current buffer, or at least displayed in a window. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 16 05:10:49 2018 Received: (at 32672) by debbugs.gnu.org; 16 Sep 2018 09:10:49 +0000 Received: from localhost ([127.0.0.1]:41920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g1T4q-0000e7-Ph for submit@debbugs.gnu.org; Sun, 16 Sep 2018 05:10:49 -0400 Received: from mout.gmx.net ([212.227.17.20]:60001) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g1T4p-0000dt-DW for 32672@debbugs.gnu.org; Sun, 16 Sep 2018 05:10:47 -0400 Received: from [192.168.1.101] ([212.95.5.6]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LbyUS-1fa8c71AlY-00jGtv; Sun, 16 Sep 2018 11:10:39 +0200 Message-ID: <5B9E1E0E.7070805@gmx.at> Date: Sun, 16 Sep 2018 11:10:38 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32672: 27.0.50; image resize on window resizing 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> In-Reply-To: <87pnxexr2m.fsf@mail.linkov.net> Content-Type: multipart/mixed; boundary="------------030600000705000905040102" X-Provags-ID: V03:K1:z+aLlBDSFF3YrQG4YKsfRy3S+ibLl71ZdnG9kBpH9Zdmta9I1AR 4sEKvI+dZA1C0MlzlfUMYUSQcRkHzJUuM99j7fJksAyGLESoilibb1UrRFri4LQ+P+jgHbw 1wluEZXMzGLyp8MpRrbTbgNC0BNg85EBQZiZzdOYO/aJNPre+aZCA/iRtfDFjVasFfVDY5k cdEuD5kZwTYv4KSs5DV3Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:i2XVA78KJ54=:4F/Hhzc9g3/Ms3MP4HQGGa 0El7FkcM6+PnGwmMKlSiWtETTd7WgpJuVNeFSa9qPWDsamYAxR/5e9086/6WBFIXRo9QGvVX+ UqlPMmnqLdk4p32K5gEs1y9MnDW7Wmj1NkWFGsqvUiWOW+xYvTH27ro2VJxHoFu3pJwDfn1ck C5Y+FAUiEoxvmwZvLULZ4IaSCeMu0qMwqwCCY8cugX5GCk3F6uVDXvMqyBtP6liiKtUP2xRPa keooZ8nHxYXrZliuJHXzFHvE/Hupb4sYI5PlfdknPpX9j0GE6XwFoC0LvVOCqdZk9qQ+2VVRG cYhAQ9W6Yv04UkvHUEAa3BYsqo9t1fHv0vuLnDy/CNYputBQ26orPuHP8FR/WlkyBDaTPGhEl mC/yhlNyRwOnaeBSWfCY7fBaQ5o1KPA/VdrN66gEZuyYoXR5lUAsjliMDC5L1bZOKLl7xYoi0 xtK6W53AUk0qYAJ4iKhuK2Qa5W6NYT5MY5vRm3S71Lxp9/0RJGqdpYNBg9lgJ0YGaTvrc+fGy YbBUS6uX63kPnZe+cqDQ7LFdalfXkLfEIDnyGUmbH4Bt89IvlhwSD6pDks1Yx0zZGGxBdYu/a Vz56pH+hb4Y8N9N+RdaS1NpThD6p2FlzLFstGmm6nJsgDlyaQ9x4gGF5ICjXMt9jNOX0l5ljr T1FkXUAJplIyi6hIQ+LD4GG5I2Xm/Lg1iawDSXOJpdktEDMn17sM69s0cFfNz6z0n0Hq0P+G2 BRyhzOijmNbVYAE75/SQ3kB0h/Y4/FXPbjXewqvF5QGVRmYtcD66N7T8T1+DWo6M2J+ArYfm+ DYPtTBjBYDqOm6JSnfKmLwXQMMkYg== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------030600000705000905040102 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit > I agree that the buffer list is more global than a window, but OTOH > it makes sense to use buffer-local hook for a buffer to get notified > when it comes to the top of the buffer list. So this would be a good thing > to have, unless there is another hook that gets called when a buffer > becomes the current buffer, or at least displayed in a window. I try to fix the problem you mentioned earlier, namely that > > it's called only when navigating away from the > > image-mode buffer, but not when coming back to the image-mode buffer, e.g. > > `C-x ', then resize the window, then type `C-x ', > > it's not called. Also it's not called in another direction: > > `C-x ', then resize the window, then type `C-x '. Please tell me if the attached patch works and what else should be done. Thanks, martin --------------030600000705000905040102 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" LS0tIGEvbGlzcC93aW5kb3cuZWwNCisrKyBiL2xpc3Avd2luZG93LmVsDQpAQCAtNDMwMSw5 ICs0MzAxLDkgQEAgc2V0LXdpbmRvdy1idWZmZXItc3RhcnQtYW5kLXBvaW50DQogICAoc2V0 cSB3aW5kb3cgKHdpbmRvdy1ub3JtYWxpemUtd2luZG93IHdpbmRvdyB0KSkNCiAgIChsZXQg KChzZWxlY3RlZCAoZXEgd2luZG93IChzZWxlY3RlZC13aW5kb3cpKSkNCiAJKGN1cnJlbnQg KGVxICh3aW5kb3ctYnVmZmVyIHdpbmRvdykgKGN1cnJlbnQtYnVmZmVyKSkpKQ0KLSAgICAo c2V0LXdpbmRvdy1idWZmZXIgd2luZG93IGJ1ZmZlcikNCiAgICAgKHdoZW4gKGFuZCBzZWxl Y3RlZCBjdXJyZW50KQ0KICAgICAgIChzZXQtYnVmZmVyIGJ1ZmZlcikpDQorICAgIChzZXQt d2luZG93LWJ1ZmZlciB3aW5kb3cgYnVmZmVyKQ0KICAgICAod2hlbiBzdGFydA0KICAgICAg IDs7IERvbid0IGZvcmNlIHdpbmRvdy1zdGFydCBoZXJlIChldmVuIGlmIFBPSU5UIGlzIG5p bCkuDQogICAgICAgKHNldC13aW5kb3ctc3RhcnQgd2luZG93IHN0YXJ0IHQpKQ0KZGlmZiAt LWdpdCBhL3NyYy93aW5kb3cuYyBiL3NyYy93aW5kb3cuYw0KaW5kZXggNDA5YjAxZi4uMzNl MTk3NSAxMDA2NDQNCi0tLSBhL3NyYy93aW5kb3cuYw0KKysrIGIvc3JjL3dpbmRvdy5jDQpA QCAtMzU3Myw0MCArMzU3MywzNiBAQCBkZXBlbmRzIG9uIHRoZSB2YWx1ZSBvZiAod2luZG93 LXN0YXJ0IFdJTkRPVyksIHNvIGlmIGNhbGxpbmcgdGhpcw0KIA0KIFRoaXMgZnVuY3Rpb24g cnVucyBgd2luZG93LXNjcm9sbC1mdW5jdGlvbnMnIGJlZm9yZSBydW5uaW5nDQogYHdpbmRv dy1jb25maWd1cmF0aW9uLWNoYW5nZS1ob29rJy4gICovKQ0KLSAgKHJlZ2lzdGVyIExpc3Bf T2JqZWN0IHdpbmRvdywgTGlzcF9PYmplY3QgYnVmZmVyX29yX25hbWUsIExpc3BfT2JqZWN0 IGtlZXBfbWFyZ2lucykNCisgICAgIChMaXNwX09iamVjdCB3aW5kb3csIExpc3BfT2JqZWN0 IGJ1ZmZlcl9vcl9uYW1lLCBMaXNwX09iamVjdCBrZWVwX21hcmdpbnMpDQogew0KLSAgcmVn aXN0ZXIgTGlzcF9PYmplY3QgdGVtLCBidWZmZXI7DQotICByZWdpc3RlciBzdHJ1Y3Qgd2lu ZG93ICp3ID0gZGVjb2RlX2xpdmVfd2luZG93ICh3aW5kb3cpOw0KKyAgTGlzcF9PYmplY3Qg b2xkX2J1ZmZlciwgbmV3X2J1ZmZlcjsNCisgIHN0cnVjdCB3aW5kb3cgKncgPSBkZWNvZGVf bGl2ZV93aW5kb3cgKHdpbmRvdyk7DQogDQogICBYU0VUV0lORE9XICh3aW5kb3csIHcpOw0K LSAgYnVmZmVyID0gRmdldF9idWZmZXIgKGJ1ZmZlcl9vcl9uYW1lKTsNCi0gIENIRUNLX0JV RkZFUiAoYnVmZmVyKTsNCi0gIGlmICghQlVGRkVSX0xJVkVfUCAoWEJVRkZFUiAoYnVmZmVy KSkpDQorICBvbGRfYnVmZmVyID0gdy0+Y29udGVudHM7DQorICBuZXdfYnVmZmVyID0gRmdl dF9idWZmZXIgKGJ1ZmZlcl9vcl9uYW1lKTsNCisgIENIRUNLX0JVRkZFUiAobmV3X2J1ZmZl cik7DQorICBpZiAoIUJVRkZFUl9MSVZFX1AgKFhCVUZGRVIgKG5ld19idWZmZXIpKSkNCiAg ICAgZXJyb3IgKCJBdHRlbXB0IHRvIGRpc3BsYXkgZGVsZXRlZCBidWZmZXIiKTsNCiANCi0g IHRlbSA9IHctPmNvbnRlbnRzOw0KLSAgaWYgKE5JTFAgKHRlbSkpDQotICAgIGVycm9yICgi V2luZG93IGlzIGRlbGV0ZWQiKTsNCi0gIGVsc2UNCisgIGlmICghRVEgKG9sZF9idWZmZXIs IG5ld19idWZmZXIpKQ0KICAgICB7DQotICAgICAgaWYgKCFFUSAodGVtLCBidWZmZXIpKQ0K LQl7DQotCSAgaWYgKEVRICh3LT5kZWRpY2F0ZWQsIFF0KSkNCi0JICAgIC8qIFdJTkRPVyBp cyBzdHJvbmdseSBkZWRpY2F0ZWQgdG8gaXRzIGJ1ZmZlciwgc2lnbmFsIGFuDQotCSAgICAg ICBlcnJvci4gICovDQotCSAgICBlcnJvciAoIldpbmRvdyBpcyBkZWRpY2F0ZWQgdG8gYCVz JyIsIFNEQVRBIChCVkFSIChYQlVGRkVSICh0ZW0pLCBuYW1lKSkpOw0KLQkgIGVsc2UNCi0J ICAgIC8qIFdJTkRPVyBpcyB3ZWFrbHkgZGVkaWNhdGVkIHRvIGl0cyBidWZmZXIsIHJlc2V0 DQotCSAgICAgICBkZWRpY2F0aW9uLiAgKi8NCi0JICAgIHdzZXRfZGVkaWNhdGVkICh3LCBR bmlsKTsNCi0NCi0JICBjYWxsMSAoUXJlY29yZF93aW5kb3dfYnVmZmVyLCB3aW5kb3cpOw0K LQl9DQorICAgICAgaWYgKEVRICh3LT5kZWRpY2F0ZWQsIFF0KSkNCisJLyogV0lORE9XIGlz IHN0cm9uZ2x5IGRlZGljYXRlZCB0byBpdHMgYnVmZmVyLCBzaWduYWwgYW4NCisJICAgZXJy b3IuICAqLw0KKwllcnJvciAoIldpbmRvdyBpcyBkZWRpY2F0ZWQgdG8gYCVzJyIsIFNEQVRB IChCVkFSIChYQlVGRkVSIChvbGRfYnVmZmVyKSwgbmFtZSkpKTsNCisgICAgICBlbHNlDQor CS8qIFdJTkRPVyBpcyB3ZWFrbHkgZGVkaWNhdGVkIHRvIGl0cyBidWZmZXIsIHJlc2V0DQor CSAgIGRlZGljYXRpb24uICAqLw0KKwl3c2V0X2RlZGljYXRlZCAodywgUW5pbCk7DQogDQog ICAgICAgdW5zaG93X2J1ZmZlciAodyk7DQogICAgIH0NCiANCi0gIHNldF93aW5kb3dfYnVm ZmVyICh3aW5kb3csIGJ1ZmZlciwgdHJ1ZSwgIU5JTFAgKGtlZXBfbWFyZ2lucykpOw0KKyAg c2V0X3dpbmRvd19idWZmZXIgKHdpbmRvdywgbmV3X2J1ZmZlciwgdHJ1ZSwgIU5JTFAgKGtl ZXBfbWFyZ2lucykpOw0KKw0KKyAgaWYgKCFFUSAob2xkX2J1ZmZlciwgbmV3X2J1ZmZlcikp DQorICAgIGNhbGwxIChRcmVjb3JkX3dpbmRvd19idWZmZXIsIHdpbmRvdyk7DQogDQogICBy ZXR1cm4gUW5pbDsNCiB9DQoNCg== --------------030600000705000905040102-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 16 19:49:22 2018 Received: (at 32672) by debbugs.gnu.org; 16 Sep 2018 23:49:22 +0000 Received: from localhost ([127.0.0.1]:42453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g1gn3-0000hM-Ui for submit@debbugs.gnu.org; Sun, 16 Sep 2018 19:49:22 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:33352 helo=pdx1-sub0-mail-a8.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g1gn2-0000hD-Kq for 32672@debbugs.gnu.org; Sun, 16 Sep 2018 19:49:21 -0400 Received: from pdx1-sub0-mail-a8.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a8.g.dreamhost.com (Postfix) with ESMTP id B0C19806A8; Sun, 16 Sep 2018 16:49:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=lgu9OsjfZodNu70FfPJbqM8zD9U=; b= mQ/yFDYbGFWYG8Sx8fUqqdZZVAU77uQMKep/YUufEEWF8cbFGA7TTl8wTlgwT3kH Re45f/HnLQ4S5EWQ/sE+VW7+r0oE1V8lezQ6Nyn7UOHzUaSgxYNzG+U80Sjoh52K ByfbG4xRVB7T3HILXsRQpW8SwJmghH1+Huz913GOR4E= Received: from localhost.linkov.net (m91-129-107-237.cust.tele2.ee [91.129.107.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a8.g.dreamhost.com (Postfix) with ESMTPSA id B5E03806A1; Sun, 16 Sep 2018 16:49:18 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a8 X-DH-BACKEND: pdx1-sub0-mail-a8 From: Juri Linkov To: martin rudalics Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET 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> Date: Mon, 17 Sep 2018 02:49:05 +0300 In-Reply-To: <5B9E1E0E.7070805@gmx.at> (martin rudalics's message of "Sun, 16 Sep 2018 11:10:38 +0200") Message-ID: <87h8ip2eby.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> I agree that the buffer list is more global than a window, but OTOH >> it makes sense to use buffer-local hook for a buffer to get notified >> when it comes to the top of the buffer list. So this would be a good thing >> to have, unless there is another hook that gets called when a buffer >> becomes the current buffer, or at least displayed in a window. > > I try to fix the problem you mentioned earlier, namely that > >> > it's called only when navigating away from the >> > image-mode buffer, but not when coming back to the image-mode buffer, e.g. >> > `C-x ', then resize the window, then type `C-x ', >> > it's not called. Also it's not called in another direction: >> > `C-x ', then resize the window, then type `C-x '. > > Please tell me if the attached patch works and what else should be > done. I tried but the hook still not called. Moreover, it broke something: after `C-x ' I need to type `C-x ' twice to get back to the original buffer. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 17 02:46:39 2018 Received: (at 32672) by debbugs.gnu.org; 17 Sep 2018 06:46:39 +0000 Received: from localhost ([127.0.0.1]:42547 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g1nIt-0000TH-K0 for submit@debbugs.gnu.org; Mon, 17 Sep 2018 02:46:39 -0400 Received: from mout.gmx.net ([212.227.15.15]:55613) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g1nIq-0000T4-Nq for 32672@debbugs.gnu.org; Mon, 17 Sep 2018 02:46:38 -0400 Received: from [192.168.1.101] ([213.162.73.114]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M4WNA-1fcZHr0u8C-00yizG; Mon, 17 Sep 2018 08:46:27 +0200 Message-ID: <5B9F4DBD.5020009@gmx.at> Date: Mon, 17 Sep 2018 08:46:21 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32672: 27.0.50; image resize on window resizing 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> In-Reply-To: <87h8ip2eby.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:hZ0EuDvBLdCRuQPjZ0aBg12GW9CE13KQQArs6Sls3oRGGLOC6yd m06JjgCrPtzFLpY2/pLCKOfH6YWMDaUdi/5okaTNWkX2OhPdlZKCUkpNZJqJ/HFOfyflGO6 OXe7ulstcEKUBqIkfAlzsu3/BeHHwycBolmNG/cg3PhVT7h5sT33OMLKsaN0saEh9xwJnLB J9acFQKanF36+3+j90ucQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:5RbhF7KYKmo=:NjZjBb26ARkm6kAkrYS5Vn Yi/5kwVdIBRl3oz+6Jh4ixcUQfVerL48Fbf3Zd5Rfv9bQDQGEuQPsgrW1DpqBPqwImOavag1Y H6pBBIeAL2xo42iFXRwgK9q+jkOedO/YIkQyjfcriyRtDQTV5EF465k5CWDIuQKd85MsRoYL1 mzgYAWX/YUT8DrTzXOJQesPIWbPB9f64a63dexBVL7y0BVuNkdcdgvdJuF5O1sDesx62dF6+K ynxPu/BrTHNwg1ZLb40fNFVEozbUksvfdhTEu39C0ZB5j2gyvyL9vT8P3FVGcwGttIfu0+MeL b55fAXIevSUCRzhxLIxWB+ASEiNvWSUoO6jfaoJX83gDIgyknsD5SCbxrQLFEkrOhfgifPQk+ K3oTwaqPd5SyjTbJjc6eZlDFJha94P9OyTyN6gszvxlPNlM8jVQKpe0C7sgbZIm3C0F//goQZ lOt8t49VlX4wDeb9gK2xzNczwCoh7vu7SCPCqvzdweZmADoXlD3WR6W6HbJJ+tn9W1p5gwUsC MHpT04cmA6Jbr5K3bslmU3wum+DFOUqEsrpo2qXus67aspUzjrMXt0gXwDd8J6WYjZB20x15c qdZ77clvvSKMfkdhc0A0MQ2dL43cva9F1Ow7JqEbSKkT5P85hKCaMEhpM3xAeUJo4FWaB6iIE wcy8eCmaAGIXns1yIi94EMQRlaNNs702LBprUqe+rBzbfa+UdSoxfURpeymfdGJcZxSABN4Qb Z+cNohln4ThfymyCjqa/kkzx8QCFE+BsKre8R0eCUTNQYAdzQbDV3OKY7rF0NX5kwm2dWKqK6 1BqdblkZm3Da6Se4DHcCBWHYp6JxXkF3kZvP7jxhDgG33n6oRM= X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > I tried but the hook still not called. Moreover, it broke something: > after `C-x ' I need to type `C-x ' twice to get back > to the original buffer. Suppose with emacs -Q I load the following code: (defvar count 0) (defun foo () (setq count (1+ count)) (message "%s ... current: %s ... window-buffer: %s" count (current-buffer) (window-buffer))) (with-current-buffer "*scratch*" (add-hook 'buffer-list-update-hook 'foo nil t)) This gets me an initial 1 ... current: *scratch* ... window-buffer: *scratch* When I now type C-x and then C-x I get 2 ... current: *scratch* ... window-buffer: *scratch* and my window shows *scratch*. What do you get? martin From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 17 18:38:50 2018 Received: (at 32672) by debbugs.gnu.org; 17 Sep 2018 22:38:50 +0000 Received: from localhost ([127.0.0.1]:43444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g22AL-0005tq-S6 for submit@debbugs.gnu.org; Mon, 17 Sep 2018 18:38:50 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:38526 helo=pdx1-sub0-mail-a21.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g22AJ-0005ti-RH for 32672@debbugs.gnu.org; Mon, 17 Sep 2018 18:38:48 -0400 Received: from pdx1-sub0-mail-a21.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a21.g.dreamhost.com (Postfix) with ESMTP id B5AE57F11B; Mon, 17 Sep 2018 15:38:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=KPju27CH7m4vnMx76LeLxcNBgdo=; b= i23t85UtO3id5K2FesYHsNvRVNuVAnSad4m3TdJ4MlM8avjqGhb39H3n3JJrkWPd H23NdDFIuiaR0hshmMS1seID+MFWs8pNNhkghkW6613riLrcT1ufqJEHOGeKR7Up mV6o4bM2WzEHIkaRIxrricjEous5qycG2PE+vdGR/LE= Received: from localhost.linkov.net (m91-129-107-237.cust.tele2.ee [91.129.107.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a21.g.dreamhost.com (Postfix) with ESMTPSA id A705B7E435; Mon, 17 Sep 2018 15:38:45 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a21 X-DH-BACKEND: pdx1-sub0-mail-a21 From: Juri Linkov To: martin rudalics Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET 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> Date: Tue, 18 Sep 2018 01:35:27 +0300 In-Reply-To: <5B9F4DBD.5020009@gmx.at> (martin rudalics's message of "Mon, 17 Sep 2018 08:46:21 +0200") Message-ID: <877ejjzr9s.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> I tried but the hook still not called. Moreover, it broke something: >> after `C-x ' I need to type `C-x ' twice to get back >> to the original buffer. > > Suppose with emacs -Q I load the following code: > > (defvar count 0) > > (defun foo () > (setq count (1+ count)) > (message "%s ... current: %s ... window-buffer: %s" > count (current-buffer) (window-buffer))) > > (with-current-buffer "*scratch*" > (add-hook 'buffer-list-update-hook 'foo nil t)) > > This gets me an initial > > 1 ... current: *scratch* ... window-buffer: *scratch* > > When I now type C-x and then C-x I get > > 2 ... current: *scratch* ... window-buffer: *scratch* > > and my window shows *scratch*. What do you get? 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* 2 ... current: *scratch* ... window-buffer: *info* which is in an inconsistent state, 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* 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*. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 19 04:23:19 2018 Received: (at 32672) by debbugs.gnu.org; 19 Sep 2018 08:23:19 +0000 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 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 Received: from [192.168.1.101] ([212.95.5.68]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MPZuP-1g7Eb416rh-004hVO; Wed, 19 Sep 2018 10:23:07 +0200 Message-ID: <5BA20763.8070305@gmx.at> Date: Wed, 19 Sep 2018 10:22:59 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32672: 27.0.50; image resize on window resizing 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> In-Reply-To: <877ejjzr9s.fsf@mail.linkov.net> Content-Type: multipart/mixed; boundary="------------080005020001040809050402" X-Provags-ID: V03:K1:qNWgv4cqE62ghIdEC5BV5s6pOO+TRCdjWzcB1gTuOq7j/SPeKTV IJk5eUmImCf6HLc4FMOm1hMbBjYOml9KITvOiLjH0CVdSw3Je/Kx4KTUADXcKeNRHI+/Hc1 TP2hyB5BZLZ9KorF3YnY1fy6i/UKFMWXoANkrEZaTioySateO2cawxR1qjRxBu2m7ojzcPn 6RWccXZ3zOB3/QZUkSi+Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:TkochWEEQ3g=:LznOzoa16knBfZNGpQxj5L 6CPZepeYpTZOY7ofpzVtpvOve4+Q4SDolqha8zhyFZ7CIlpROPMrhkvfSw/wZAUrmGONEBfsl w8L9XYwdwGkBGlfnL+Ni6jYE0jdxOAykFt1oNmpiCnWdR36Xqy7G/riHoiu+MuaGhG89IdVAm E3E5tME0t+cn0R9If/K0tTDWWdMciH2PDXQjPxW63iJ3ebdIHYtPNEJJ7SHgPeG5aiZdWptrd v9/LbJVQDaNwDnGW2MtKxq5zTPl6ksOnznZIMBEQCPGFKIr0Dn2Qc8om3jrV/PeQdyE862H8k JZEg5jjiBD7lr/0nn3MIXexQnGo4kz2uplbaOLyJ7rJ9Fh9M8CkoNBDOl3aQTCF6P2F63QgJ4 8o3/EnLzSWBvYTtrw9wDVGsQpz1Irky6huff2Wzpa8Wgt5ONwr5Z+NMv7QgRdSA+ncRcBjvO1 0djsXj373mAzrLz9hjKjg39uN+EgQoBt7lckCUL8SuYszxi/taTKydRUPoho1mfVn61C4J7Kf /kIptNIsSsjiG//zaAqF3MIC6cfB6Ps8Vm/E4rcAB7xEDneal/WgHDsIsNCZCt+qYeWY1bHW/ GlnsP+P8HzMSFUjUAC9gVN7SfioByIsk2ixxgOjxTmrwhYkykSVEcqIjJjCf3XunbG1KqTt9/ pxOO9fTIxEr6+LjPNY+ua8DZtBe67horY6xOcJOEazVacco75T5EZv54LTKWgEW/wWEu9dZfx my9mbl7T2vmMTEmW4mirRYzyUE0qTiQTmSKVp/l1ZzqYi8MM0GxfS+7dE144NEm0oe0NGxgui cJozhHxCucAH/QLqlnJT+r795gqxw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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 OCkuCiAJCQkgICAgICAgcG9pbnQgd2luZG93LXBvaW50LWluc2VydGlvbi10eXBlKSkpKSkK IAkgIChzZXQtd2luZG93LXByZXYtYnVmZmVycwotCSAgIHdpbmRvdyAoY29ucyBlbnRyeSAo d2luZG93LXByZXYtYnVmZmVycyB3aW5kb3cpKSkpKQotCi0gICAgICAocnVuLWhvb2tzICdi dWZmZXItbGlzdC11cGRhdGUtaG9vaykpKSkKKwkgICB3aW5kb3cgKGNvbnMgZW50cnkgKHdp bmRvdy1wcmV2LWJ1ZmZlcnMgd2luZG93KSkpKSkpKSkKIAogKGRlZnVuIHVucmVjb3JkLXdp bmRvdy1idWZmZXIgKCZvcHRpb25hbCB3aW5kb3cgYnVmZmVyKQogICAiVW5yZWNvcmQgQlVG RkVSIGluIFdJTkRPVy4KQEAgLTQzMDEsOSArNDI5OSw5IEBAIHNldC13aW5kb3ctYnVmZmVy LXN0YXJ0LWFuZC1wb2ludAogICAoc2V0cSB3aW5kb3cgKHdpbmRvdy1ub3JtYWxpemUtd2lu ZG93IHdpbmRvdyB0KSkKICAgKGxldCAoKHNlbGVjdGVkIChlcSB3aW5kb3cgKHNlbGVjdGVk LXdpbmRvdykpKQogCShjdXJyZW50IChlcSAod2luZG93LWJ1ZmZlciB3aW5kb3cpIChjdXJy ZW50LWJ1ZmZlcikpKSkKLSAgICAoc2V0LXdpbmRvdy1idWZmZXIgd2luZG93IGJ1ZmZlcikK ICAgICAod2hlbiAoYW5kIHNlbGVjdGVkIGN1cnJlbnQpCiAgICAgICAoc2V0LWJ1ZmZlciBi dWZmZXIpKQorICAgIChzZXQtd2luZG93LWJ1ZmZlciB3aW5kb3cgYnVmZmVyKQogICAgICh3 aGVuIHN0YXJ0CiAgICAgICA7OyBEb24ndCBmb3JjZSB3aW5kb3ctc3RhcnQgaGVyZSAoZXZl biBpZiBQT0lOVCBpcyBuaWwpLgogICAgICAgKHNldC13aW5kb3ctc3RhcnQgd2luZG93IHN0 YXJ0IHQpKQpkaWZmIC0tZ2l0IGEvc3JjL3dpbmRvdy5jIGIvc3JjL3dpbmRvdy5jCmluZGV4 IDQwOWIwMWYuLmQ3NjU1NjQgMTAwNjQ0Ci0tLSBhL3NyYy93aW5kb3cuYworKysgYi9zcmMv d2luZG93LmMKQEAgLTM1NzMsNDAgKzM1NzMsMzggQEAgZGVwZW5kcyBvbiB0aGUgdmFsdWUg b2YgKHdpbmRvdy1zdGFydCBXSU5ET1cpLCBzbyBpZiBjYWxsaW5nIHRoaXMKIAogVGhpcyBm dW5jdGlvbiBydW5zIGB3aW5kb3ctc2Nyb2xsLWZ1bmN0aW9ucycgYmVmb3JlIHJ1bm5pbmcK IGB3aW5kb3ctY29uZmlndXJhdGlvbi1jaGFuZ2UtaG9vaycuICAqLykKLSAgKHJlZ2lzdGVy IExpc3BfT2JqZWN0IHdpbmRvdywgTGlzcF9PYmplY3QgYnVmZmVyX29yX25hbWUsIExpc3Bf T2JqZWN0IGtlZXBfbWFyZ2lucykKKyAgICAgKExpc3BfT2JqZWN0IHdpbmRvdywgTGlzcF9P YmplY3QgYnVmZmVyX29yX25hbWUsIExpc3BfT2JqZWN0IGtlZXBfbWFyZ2lucykKIHsKLSAg cmVnaXN0ZXIgTGlzcF9PYmplY3QgdGVtLCBidWZmZXI7Ci0gIHJlZ2lzdGVyIHN0cnVjdCB3 aW5kb3cgKncgPSBkZWNvZGVfbGl2ZV93aW5kb3cgKHdpbmRvdyk7CisgIExpc3BfT2JqZWN0 IG9sZF9idWZmZXIsIG5ld19idWZmZXI7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBkZWNvZGVf bGl2ZV93aW5kb3cgKHdpbmRvdyk7CiAKICAgWFNFVFdJTkRPVyAod2luZG93LCB3KTsKLSAg YnVmZmVyID0gRmdldF9idWZmZXIgKGJ1ZmZlcl9vcl9uYW1lKTsKLSAgQ0hFQ0tfQlVGRkVS IChidWZmZXIpOwotICBpZiAoIUJVRkZFUl9MSVZFX1AgKFhCVUZGRVIgKGJ1ZmZlcikpKQor ICBvbGRfYnVmZmVyID0gdy0+Y29udGVudHM7CisgIG5ld19idWZmZXIgPSBGZ2V0X2J1ZmZl ciAoYnVmZmVyX29yX25hbWUpOworICBDSEVDS19CVUZGRVIgKG5ld19idWZmZXIpOworICBp ZiAoIUJVRkZFUl9MSVZFX1AgKFhCVUZGRVIgKG5ld19idWZmZXIpKSkKICAgICBlcnJvciAo IkF0dGVtcHQgdG8gZGlzcGxheSBkZWxldGVkIGJ1ZmZlciIpOwogCi0gIHRlbSA9IHctPmNv bnRlbnRzOwotICBpZiAoTklMUCAodGVtKSkKLSAgICBlcnJvciAoIldpbmRvdyBpcyBkZWxl dGVkIik7Ci0gIGVsc2UKKyAgaWYgKCFFUSAob2xkX2J1ZmZlciwgbmV3X2J1ZmZlcikpCiAg ICAgewotICAgICAgaWYgKCFFUSAodGVtLCBidWZmZXIpKQotCXsKLQkgIGlmIChFUSAody0+ ZGVkaWNhdGVkLCBRdCkpCi0JICAgIC8qIFdJTkRPVyBpcyBzdHJvbmdseSBkZWRpY2F0ZWQg dG8gaXRzIGJ1ZmZlciwgc2lnbmFsIGFuCi0JICAgICAgIGVycm9yLiAgKi8KLQkgICAgZXJy b3IgKCJXaW5kb3cgaXMgZGVkaWNhdGVkIHRvIGAlcyciLCBTREFUQSAoQlZBUiAoWEJVRkZF UiAodGVtKSwgbmFtZSkpKTsKLQkgIGVsc2UKLQkgICAgLyogV0lORE9XIGlzIHdlYWtseSBk ZWRpY2F0ZWQgdG8gaXRzIGJ1ZmZlciwgcmVzZXQKLQkgICAgICAgZGVkaWNhdGlvbi4gICov Ci0JICAgIHdzZXRfZGVkaWNhdGVkICh3LCBRbmlsKTsKLQotCSAgY2FsbDEgKFFyZWNvcmRf d2luZG93X2J1ZmZlciwgd2luZG93KTsKLQl9CisgICAgICBpZiAoRVEgKHctPmRlZGljYXRl ZCwgUXQpKQorCS8qIFdJTkRPVyBpcyBzdHJvbmdseSBkZWRpY2F0ZWQgdG8gaXRzIGJ1ZmZl ciwgc2lnbmFsIGFuCisJICAgZXJyb3IuICAqLworCWVycm9yICgiV2luZG93IGlzIGRlZGlj YXRlZCB0byBgJXMnIiwgU0RBVEEgKEJWQVIgKFhCVUZGRVIgKG9sZF9idWZmZXIpLCBuYW1l KSkpOworICAgICAgZWxzZQorCS8qIFdJTkRPVyBpcyB3ZWFrbHkgZGVkaWNhdGVkIHRvIGl0 cyBidWZmZXIsIHJlc2V0CisJICAgZGVkaWNhdGlvbi4gICovCisJd3NldF9kZWRpY2F0ZWQg KHcsIFFuaWwpOwogCi0gICAgICB1bnNob3dfYnVmZmVyICh3KTsKKyAgICAgIGNhbGwxIChR cmVjb3JkX3dpbmRvd19idWZmZXIsIHdpbmRvdyk7CiAgICAgfQogCi0gIHNldF93aW5kb3df YnVmZmVyICh3aW5kb3csIGJ1ZmZlciwgdHJ1ZSwgIU5JTFAgKGtlZXBfbWFyZ2lucykpOwor ICB1bnNob3dfYnVmZmVyICh3KTsKKworICBzZXRfd2luZG93X2J1ZmZlciAod2luZG93LCBu ZXdfYnVmZmVyLCB0cnVlLCAhTklMUCAoa2VlcF9tYXJnaW5zKSk7CisKKyAgaWYgKCFOSUxQ IChWcnVuX2hvb2tzKSAmJiAhRVEgKG9sZF9idWZmZXIsIG5ld19idWZmZXIpKQorICAgIGNh bGwxIChWcnVuX2hvb2tzLCBRYnVmZmVyX2xpc3RfdXBkYXRlX2hvb2spOwogCiAgIHJldHVy biBRbmlsOwogfQpAQCAtNjQxNSw3ICs2NDEzLDEyIEBAIHN0cnVjdCBzYXZlZF93aW5kb3cK IAkgICAgICAmJiBCVUZGRVJfTElWRV9QIChYQlVGRkVSIChwLT5idWZmZXIpKSkKIAkgICAg LyogSWYgYSB3aW5kb3cgd2UgcmVzdG9yZSBnZXRzIGFub3RoZXIgYnVmZmVyLCByZWNvcmQg dGhlCiAJICAgICAgIHdpbmRvdydzIG9sZCBidWZmZXIuICAqLwotCSAgICBjYWxsMSAoUXJl Y29yZF93aW5kb3dfYnVmZmVyLCB3aW5kb3cpOworCSAgICB7CisJICAgICAgY2FsbDEgKFFy ZWNvcmRfd2luZG93X2J1ZmZlciwgd2luZG93KTsKKworCSAgICAgIGlmICghTklMUCAoVnJ1 bl9ob29rcykpCisJCWNhbGwxIChWcnVuX2hvb2tzLCBRYnVmZmVyX2xpc3RfdXBkYXRlX2hv b2spOworCSAgICB9CiAJfQogCiAgICAgICAvKiBEaXNhbGxvdyB4X3NldF93aW5kb3dfc2l6 ZSwgdGVtcG9yYXJpbHkuICAqLwoK --------------080005020001040809050402-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 19 19:25:07 2018 Received: (at 32672) by debbugs.gnu.org; 19 Sep 2018 23:25:07 +0000 Received: from localhost ([127.0.0.1]:46144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g2lqE-0005WT-Tn for submit@debbugs.gnu.org; Wed, 19 Sep 2018 19:25:07 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:38500 helo=pdx1-sub0-mail-a11.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g2lqC-0005WJ-E1 for 32672@debbugs.gnu.org; Wed, 19 Sep 2018 19:25:04 -0400 Received: from pdx1-sub0-mail-a11.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a11.g.dreamhost.com (Postfix) with ESMTP id 5E15880087; Wed, 19 Sep 2018 16:25:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=w2vezGVwYf+GUlCrgQ6J1wHkjec=; b= QShM1GAmbZmqemU0QAwZcrg5fiYWMz2t7dopCBcPbZy5mC0c8cvgmPvRFigi1hWl dyR0lx9Gt2i79WROIbHQTLQh9rD8MYzOTe2UEYY2tQkzgV1OHHyZ8NaQrkItvWam aktQNieeuRgbts54qiy1qbvgi5G5r40xvAa7u6Gqus8= Received: from localhost.linkov.net (m91-129-107-237.cust.tele2.ee [91.129.107.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a11.g.dreamhost.com (Postfix) with ESMTPSA id 59B888007B; Wed, 19 Sep 2018 16:25:02 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a11 X-DH-BACKEND: pdx1-sub0-mail-a11 From: Juri Linkov To: martin rudalics Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET 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> <5BA20763.8070305@gmx.at> Date: Thu, 20 Sep 2018 02:15:34 +0300 In-Reply-To: <5BA20763.8070305@gmx.at> (martin rudalics's message of "Wed, 19 Sep 2018 10:22:59 +0200") Message-ID: <875zz1t6y1.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> 2 ... current: *scratch* ... window-buffer: *info* >> >> which is in an inconsistent state, > > ... not really - look at the backtrace: But the problem is that the buffer-local hook will have such idiomatic code: (with-current-buffer (window-buffer window) ... where window-buffer will return a wrong 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: > > And this one comes from burying the *info* buffer. What should we do > instead? I don't know. In this particular feature request I'm going to use debounce, but for general case I don't see how to optimize it. >> 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, now the problem is not reproducible. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 20 03:34:44 2018 Received: (at 32672) by debbugs.gnu.org; 20 Sep 2018 07:34:44 +0000 Received: from localhost ([127.0.0.1]:46276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g2tU2-0001L0-TJ for submit@debbugs.gnu.org; Thu, 20 Sep 2018 03:34:44 -0400 Received: from mout.gmx.net ([212.227.17.20]:34889) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g2tU0-0001Km-Ur for 32672@debbugs.gnu.org; Thu, 20 Sep 2018 03:34:41 -0400 Received: from [192.168.1.101] ([213.162.73.211]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MSq5p-1gCTkg2UOj-00RsV3; Thu, 20 Sep 2018 09:34:31 +0200 Message-ID: <5BA34D7E.4030509@gmx.at> Date: Thu, 20 Sep 2018 09:34:22 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32672: 27.0.50; image resize on window resizing 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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> In-Reply-To: <875zz1t6y1.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:mAJgX6A/rzqSFt4cqXNy7S8dxC2pPcwL80AH3xDTyz0VnJ0gDht DD7wRuIUXLUeNp36ka9GNRGjLY1Xyuyz/4MBJH3jrIOhBRmeRt39RvMTxsqzP1iCGAmoN4D IDjb5AFm6ypgIBoM6TmtiVQ/2+NuSpAKM+0+PyGmJtWlQ5m1zVtk2tW+koNDfFIftySH/cb 9yy/Bgsm9RnADppynmLqw== X-UI-Out-Filterresults: notjunk:1;V01:K0:aZi80DLTpvQ=:nL1r27CneXE7Tx8whMFbor Tcp0gdHQs37ZjnOceiKzXld+VQZDQxnmWODXmZf+s/K9QHe4+XtwqQyrijq01c4QnluzVUtet lwhuARS19w3NVQ/nkwkKAD+IlgGUBntOW7tmA8AzvrdSZwn/w9/Ep4McIP6jHF14ViQNCW3/K WOdmPReAoE3aUtdsWKtgJ+cuuiHALTqTWNCcg/HkyGzMPc15W91cjEVN+B5kH3X4Q3EFsAOxm 4WGuS0wgXvZmq7MIpl786+43Pe45LLCZGbTjmmm+YMLNHZihr7bwzmjcbmEWedGRT6wvaosfA HPiBkM1wKyFRW/aVmaR2C0mMAkSZlWbZHZvJqHu8qEKEp6JzNlEdN/NkIJmr5V8OAbnNbJayI kY3+sU4oJBdyn/AMJ6Yku8ZVFaUAc2k2oEbpaHJck7Lc2AFSCk8fS5rpd3wPC6FiOcZPvqmff wGhcJpi9LvASM91lGAfr4iGTZU4q8JgQazxIqBcty3KvKIwvIcXWwVn1PPPbRa0nbpjohaQG8 tDA78Zxx62Bo0ItP5ydqCbBL5LtxINayuQjU3pA0X62hjVM7L9j+ez5l+SWqfASH24iWVre+C edZ0XOotd04EWOU0P/lEpiujyCcWrfDYBxI/AbOryBUtMrON2M85K1+hZCDZSwssfUBBW4tms ICPI/9I6lHJQrEcaVCTDQ+yj2uPzpd0Spbca+V1eF7jMs/Xf/akYKwqD/QEVzcH8sgZU7wgnE tkYzwb8jKGaUwknMQYRo/l+Xyow9CWEAENddtjAvVfyQxIV65FOko2y93+VV8b7f6DfqjDWtC F/QiMNJixxq2ZjNSA7Cyec346QQFXTBeWTR0pYgoIsPwHczHQ8= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>> 2 ... current: *scratch* ... window-buffer: *info* >>> >>> which is in an inconsistent state, >> >> ... not really - look at the backtrace: > > But the problem is that the buffer-local hook will have such idiomatic code: > > (with-current-buffer (window-buffer window) > ... Where does 'window' come from? At the time 'buffer-list-update-hook' gets called, there's no guarantee that the buffer whose local hook runs is even shown in a window. > where window-buffer will return a wrong buffer. It's the right buffer at the time you run this hook. I'm afraid that whatever we do here it will get us in a mess that strikes back sooner or later. Maybe we really should run a 'select-window-hook' instead. martin From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 20 19:56:05 2018 Received: (at 32672) by debbugs.gnu.org; 20 Sep 2018 23:56:05 +0000 Received: from localhost ([127.0.0.1]:47466 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g38nk-0000gC-UQ for submit@debbugs.gnu.org; Thu, 20 Sep 2018 19:56:05 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:60866 helo=pdx1-sub0-mail-a36.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g38nj-0000g4-Kp for 32672@debbugs.gnu.org; Thu, 20 Sep 2018 19:56:03 -0400 Received: from pdx1-sub0-mail-a36.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a36.g.dreamhost.com (Postfix) with ESMTP id C89C67EDA7; Thu, 20 Sep 2018 16:56:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=HvrcDLJVAxpZk32Nm/4mKPpCqNc=; b= mGDE37D5FMSsiQIoNGKN52kFaAlT7Z+OFQdPVn2KS8/ZBy2vYbP/coKqfAx5sXpU 8kfYp5LswKPFIg/FmeAo98zRUPEWLVhi+n+gHcB2Gjkc/sGVCD1FoQnlhg2JV+BG iBDwwshi7hhGG2LVVbExMAwrbDI+8GdmZYUc2XEBpds= Received: from localhost.linkov.net (m91-129-107-237.cust.tele2.ee [91.129.107.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a36.g.dreamhost.com (Postfix) with ESMTPSA id D366B7EDB7; Thu, 20 Sep 2018 16:56:01 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a36 X-DH-BACKEND: pdx1-sub0-mail-a36 From: Juri Linkov To: martin rudalics Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET 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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> Date: Fri, 21 Sep 2018 02:15:45 +0300 In-Reply-To: <5BA34D7E.4030509@gmx.at> (martin rudalics's message of "Thu, 20 Sep 2018 09:34:22 +0200") Message-ID: <87fty3sp6a.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> But the problem is that the buffer-local hook will have such idiomatic code: >> >> (with-current-buffer (window-buffer window) >> ... > > Where does 'window' come from? At the time 'buffer-list-update-hook' > gets called, there's no guarantee that the buffer whose local hook > runs is even shown in a window. Thank you, now it's possible to finish this feature, it gets 'window' using get-buffer-window-list: diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 19fa28d440..3355ee6109 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -574,6 +574,9 @@ image-mode (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t) (add-hook 'after-revert-hook 'image-after-revert-hook nil t) + (add-hook 'window-size-change-functions (debounce 'image-size-window-change 1) nil t) + (add-hook 'buffer-list-update-hook 'image-size-buffer-change nil t) + (run-mode-hooks 'image-mode-hook) (let ((image (image-get-display-property)) (msg1 (substitute-command-keys @@ -822,6 +826,42 @@ image-after-revert-hook (get-buffer-window-list (current-buffer) 'nomini 'visible)) (image-toggle-display-image))) +(defun image-size-window-change (&optional frame) + (let (buffers) + (walk-windows (lambda (window) + (with-current-buffer (window-buffer window) + (when (derived-mode-p 'image-mode) + (push (current-buffer) buffers)))) + 'nomini (or frame 'visible)) + (mapc (lambda (buffer) (image-size-buffer-change buffer)) + (delq nil (delete-dups buffers))))) + +(defun image-size-buffer-change (&optional buffer) + (with-current-buffer (or buffer (current-buffer)) + (when (derived-mode-p 'image-mode) + (let* ((spec (image-get-display-property)) + (spec (and (eq (car-safe spec) 'image) spec)) + (max-width (plist-get (cdr spec) :max-width)) + (max-height (plist-get (cdr spec) :max-height)) + (windows (and (or max-width max-height) + (get-buffer-window-list + (current-buffer) 'nomini 'visible))) + min-width min-height min-window) + (mapc (lambda (window) + (let* ((edges (window-inside-pixel-edges window)) + (width (- (nth 2 edges) (nth 0 edges))) + (height (- (nth 3 edges) (nth 1 edges)))) + (setq min-width (if min-width (min min-width width) width)) + (setq min-height (if min-height (min min-height height) height)) + (when (and (= min-width width) + (= min-height height)) + (setq min-window window)))) + windows) + (when (or (and min-width max-width (not (= min-width max-width))) + (and min-height max-height (not (= min-height max-height)))) + (with-selected-window min-window + (image-toggle-display-image))))))) + ;;; Animated images From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 21 02:34:37 2018 Received: (at 32672) by debbugs.gnu.org; 21 Sep 2018 06:34:37 +0000 Received: from localhost ([127.0.0.1]:47579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g3F1R-0002pZ-3d for submit@debbugs.gnu.org; Fri, 21 Sep 2018 02:34:37 -0400 Received: from mout.gmx.net ([212.227.17.20]:52757) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g3F1O-0002pL-JA for 32672@debbugs.gnu.org; Fri, 21 Sep 2018 02:34:35 -0400 Received: from [192.168.1.101] ([213.162.73.217]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MUkxk-1gHdfB1mNo-00YEJV; Fri, 21 Sep 2018 08:34:25 +0200 Message-ID: <5BA490E5.5090506@gmx.at> Date: Fri, 21 Sep 2018 08:34:13 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32672: 27.0.50; image resize on window resizing 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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> In-Reply-To: <87fty3sp6a.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:6Q/+xd7R7nryUQAHOEDWjLBo1XRlTn1Ev85vuWKfD+UH7utgBIE qinE2/H/ba123Vc/rC4e8GMmzHym62LfQy6RFXSOVoLS3vSJsC0UHBqYvg8+Fn0ZZJv/5Kj HR+GDi6rOoKYcGxmpLkerCS+Ztj5P2rxgtKkLcnQ9Dd5vYGE6NBxokEL4txisQbWK+9ATVd 478k6kwiT8DIBtYIaWdaw== X-UI-Out-Filterresults: notjunk:1;V01:K0:l2KUFbHEvOU=:GzT6otMPhV6eMsFX696BZN glGQUlpDD4xv2iZFSkQC83kYGMj2p1Bgo8yrAuGtAOuYbyH22EhIOej/5RQGj2W2dnUlIiBWV OfeqxYXkf3gxyYgd6Y5/xaBoxbXocSkj2DLpv81Hhv3x8m98tNAWiUlyscz1IsUoSGfC/KC9o maRMkQAyPuKGtAAYdlefSNU6Z4SeyiNnV0i5MVQIb+TyM5x3r/uEdfhEGkOTTQu+5IL5IxWb+ 2XcFbm7wVrBHdvPwHM5DPuPvz20f4DeUw+pthUtyL3KZp37QtZezAhNE8IEzNLMKwHq2EGW5o q3V0uEt1FbkSfSdHswfJP8Ot7oKVMwB4iX3oC45MDuqSUN1T8p1Z1IsYi79JafnuOUtSRcJuT dR4p6+wIKyHPWHju9uybiF3jXFpk8rkxXYxhkCbJMF1/fFqhgDo1xM/ngPL6WXqirfSIyblFe sA6CMAzF1u9bUwIArUVUSGToja/OVaInnObpMsQ3bmTKKSVnsnIJ20T1UGy6dwvGuKj3LKLTl 70OdxkXy9zeByVYa2wBE/RRq9oJEH+MoLTiXXcY4inaH0RW/UcjHOZLlrwjlI74RWRGEoIBse nppOu5q1wcdi9FFTD3H6jGTmdf6VikWBrnDMnDfVXxstklcuC2Z3qcl0+YuBc6DPqTynxonvO RsLsNL3TYittcm7NakJu0S8T2V59oS+u5vyNPGKwSIwPb/x8tFSGDYJkY+Uihkds7skfBlJfC VrOOuLCqKy+OWJkUAHRMnjPG5BWEcYZoAGiJtAEvVWlcHfWe2/Y6byJVuNiKEQ3zAWkkTB2Qg xL0bqSQU6LaicEN6lLCFGEc7RFMBja3omEWMJ5w98TmG3M+srk= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t) > (add-hook 'after-revert-hook 'image-after-revert-hook nil t) > + (add-hook 'window-size-change-functions (debounce 'image-size-window-change 1) nil t) > + (add-hook 'buffer-list-update-hook 'image-size-buffer-change nil t) Shouldn't you debounce the call to 'image-size-buffer-change' as well? After all, the buffer list seems to change more often than the size of windows. In either case you probably want me to install the 'buffer-list-update-hook' changes. Correct? martin From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 22 18:42:21 2018 Received: (at 32672) by debbugs.gnu.org; 22 Sep 2018 22:42:21 +0000 Received: from localhost ([127.0.0.1]:50013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g3qbV-0000cr-Bj for submit@debbugs.gnu.org; Sat, 22 Sep 2018 18:42:21 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:34576 helo=pdx1-sub0-mail-a31.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g3qbT-0000cj-E4 for 32672@debbugs.gnu.org; Sat, 22 Sep 2018 18:42:20 -0400 Received: from pdx1-sub0-mail-a31.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a31.g.dreamhost.com (Postfix) with ESMTP id 2EAFF7F382; Sat, 22 Sep 2018 15:42:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=sLNgik6nJyg0nXYfwRBbYQCs+64=; b= WkA/68w0gbw2S0AqFLesZhQWnNFGzDknGdBI2J7K4xd2hty5SZAVCL8cwjtkWO68 BygEjc0f06+8RbGkTw7r1Ql4EGA3Q9o8MbQ6edRVvnIvPXmvXq9yrVse1ByaDT0n vLBO1cpXH6ljB7ewB+SFlxPCmVHWVPrQiBwmPnSlAJk= Received: from localhost.linkov.net (m91-129-111-128.cust.tele2.ee [91.129.111.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a31.g.dreamhost.com (Postfix) with ESMTPSA id 483877F381; Sat, 22 Sep 2018 15:42:14 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a31 X-DH-BACKEND: pdx1-sub0-mail-a31 From: Juri Linkov To: martin rudalics Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET 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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> Date: Sun, 23 Sep 2018 01:15:06 +0300 In-Reply-To: <5BA490E5.5090506@gmx.at> (martin rudalics's message of "Fri, 21 Sep 2018 08:34:13 +0200") Message-ID: <87zhw9xjpx.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t) >> (add-hook 'after-revert-hook 'image-after-revert-hook nil t) >> + (add-hook 'window-size-change-functions (debounce 'image-size-window-change 1) nil t) >> + (add-hook 'buffer-list-update-hook 'image-size-buffer-change nil t) > > Shouldn't you debounce the call to 'image-size-buffer-change' as well? > After all, the buffer list seems to change more often than the size of > windows. When I tried debounce for buffer-list-update-hook, it used the last call in sequence: 1 ... current: *scratch* ... window-buffer: *scratch* 2 ... current: *scratch* ... window-buffer: *info* that was unsuitable for the logic of 'image-size-buffer-change'. So maybe instead of 'debounce', we need to implement and use 'throttle' or at least implement the 'immediate' option that uses the first call: https://css-tricks.com/debouncing-throttling-explained-examples/ > In either case you probably want me to install the > 'buffer-list-update-hook' changes. Correct? Yes, please install it, if you see no more regressions. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 23 04:26:54 2018 Received: (at 32672) by debbugs.gnu.org; 23 Sep 2018 08:26:55 +0000 Received: from localhost ([127.0.0.1]:50279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g3zjC-0000Zm-OI for submit@debbugs.gnu.org; Sun, 23 Sep 2018 04:26:54 -0400 Received: from mout.gmx.net ([212.227.15.18]:45401) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g3zjA-0000ZZ-KP for 32672@debbugs.gnu.org; Sun, 23 Sep 2018 04:26:53 -0400 Received: from [192.168.1.101] ([212.95.5.115]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LtJAR-1ff45w0Yp9-012rcu; Sun, 23 Sep 2018 10:26:43 +0200 Message-ID: <5BA74E3D.5030903@gmx.at> Date: Sun, 23 Sep 2018 10:26:37 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32672: 27.0.50; image resize on window resizing 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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> In-Reply-To: <87zhw9xjpx.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:3qw9A33el2moDwL0TdmdpmH7FjQ6haoRMgHT4pE2+aOBEGT7nSR IFfHAAtl8HyyXSee0C5MtE+5PXaLk0agq6eK3SfjHPaNsl2fXFO+3L9q2tuczEKmFz1VuO0 RVX+/kgeJpz4UMYennDdApJKwxAVRDUh7+LkmHlmN1sbTAQShLfokU5VK3YiL2ArKpv0aY/ EwxghOy6CTucAUuWSCl1w== X-UI-Out-Filterresults: notjunk:1;V01:K0:zAM21dclUGw=:K+uVbgvNXQoFvHkYKfSuGE NpDIdKipLgFcRTgWlGteC2ZWc2cddJ9IXIhRoEcdeNbkzqLwUAirN8Q5O4tuWXkkXN2HWy69F z0y5OFeU3a6Pj4rKl4PkrKRL1ikxWLYcwQqjmZvLJv6DUhR5N93ASPC795lYa9fNOCJ7c981V +m/9kSzAARVjUnA5Q1H9dSHdnHK6Rvx/HIoT0d63SWTXq0Q69k2girwd/QbJnvHinpVSTPKNH gwBeKpwBIeLYZY91zrz0H2c/1LH/hhfav95/1x8KJ7sU0Y8HJ8+77yikO0+FBONrdByXDcKiv qppr0m+TPbguqxr0ZWB3YymOXvN72r2OdZptjMUgyPg2BuGylSUGoZQlP9OdLynPfdKPrFnyw aUsoYGp/+7WjBOKbnmh/bgVlC2yo7Go6P4NwYprV2iirSKAFoSRyTEfWRLYSMIlQhRp542P5x Qa59m9EKB07v9s/Nd46wM0n9BDa+yvMkXhsDRGbOCN3GtEC7zaidxSgNa9NbjJEqvUcGHIABj I202O9gEmKmqITp7i51UqpLp5kGMuyXG7xLevvWkKq7CKPZLdf03A+fd6C25fn76yAsFJT3R1 P66qhMcpOVjXRtAJuSbcmTxb2ykRz6oSO8BoSkHcKs5v+KQxk/BrC82J7x2osdTaoXB8T/d5e BKoZo4UcUmOpsj9U2dD4P7wtg3G4S3lMwslwEmafjA2DTXX9t9MJeEiTMvMmR/9YHn7neOCL/ suzBE8mKZmnjobEYepGVDyk+/QnfV8F9zDXTgvNHEvl/kkAsS9R2Zei3PyreD8qZYeLa6FOaf tpZ8olThkooPgUfru/Pd6cv8u64xizx7/g+kzNzx3LYLjyxMgs= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> Shouldn't you debounce the call to 'image-size-buffer-change' as well? >> After all, the buffer list seems to change more often than the size of >> windows. > > When I tried debounce for buffer-list-update-hook, it used the last call > in sequence: > > 1 ... current: *scratch* ... window-buffer: *scratch* > 2 ... current: *scratch* ... window-buffer: *info* > > that was unsuitable for the logic of 'image-size-buffer-change'. I'm afraid that 'buffer-list-update-hook' is too coarse for your purpose - it gets called too often for unrelated events like creating or killing some completely unrelated buffer. If you think that running a hook after selecting a window with NORECORD nil would fit the bill better, let's try it. Many people have asked for such a hook and we always rejected it (Bug#7381, Bug#16436). Maybe it is time to reconsider. > So maybe instead of 'debounce', we need to implement and use 'throttle' > or at least implement the 'immediate' option that uses the first call: > > https://css-tricks.com/debouncing-throttling-explained-examples/ We'd probably need to come up with examples from our code base in order to decide what to implement and how. martin From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 23 17:03:04 2018 Received: (at 32672) by debbugs.gnu.org; 23 Sep 2018 21:03:04 +0000 Received: from localhost ([127.0.0.1]:51151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4BWx-00086p-VI for submit@debbugs.gnu.org; Sun, 23 Sep 2018 17:03:04 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:42470 helo=pdx1-sub0-mail-a31.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4BWu-00086P-Id for 32672@debbugs.gnu.org; Sun, 23 Sep 2018 17:03:01 -0400 Received: from pdx1-sub0-mail-a31.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a31.g.dreamhost.com (Postfix) with ESMTP id 89BCE7F32E; Sun, 23 Sep 2018 14:02:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=linkov.net; bh=1NNL3n UUtWpPwuvBLzIxrx4n83I=; b=ZkWOmIeIC7yFO50mJuqcneG6bY9osCeshGTwZL CSTmWx3m8dqbRsJx1iMUu7fzqfyOLYza+3OmS50FX+/djNthG+Cz1evP0t0wCYtr EtZwN5AqfS9JHQWdk++P0HSN+OpUNLqTSXAAbQd3CT3+x3ow0SYfkno06KVPvhxw h//jc= Received: from localhost.linkov.net (m91-129-111-128.cust.tele2.ee [91.129.111.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a31.g.dreamhost.com (Postfix) with ESMTPSA id 2370A7F6EA; Sun, 23 Sep 2018 14:02:57 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a31 X-DH-BACKEND: pdx1-sub0-mail-a31 From: Juri Linkov To: martin rudalics Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET 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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> Date: Sun, 23 Sep 2018 23:39:56 +0300 In-Reply-To: <5BA74E3D.5030903@gmx.at> (martin rudalics's message of "Sun, 23 Sep 2018 10:26:37 +0200") Message-ID: <87va6wt79n.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > I'm afraid that 'buffer-list-update-hook' is too coarse for your > purpose - it gets called too often for unrelated events like creating > or killing some completely unrelated buffer. I agree that 'buffer-list-update-hook' is unsuitable for this task. > If you think that running a hook after selecting a window with > NORECORD nil would fit the bill better, let's try it. Many people > have asked for such a hook and we always rejected it (Bug#7381, > Bug#16436). Maybe it is time to reconsider. In (info "(elisp) Selecting Windows") I see explanations why there is no separate hook whenever a window gets selected. But when I tried (advice-add 'select-window :before (lambda (window &optional norecord) (message "select-window %S" window))) it's clear it's unsuitable either. It's not called when needed, e.g. when a window displays a new buffer after navigating to it with 'C-x ' (previous-buffer). However, I get exactly what is needed with (advice-add 'set-window-buffer :before (lambda (window buffer-or-name &optional keep-margins) (message "set-window-buffer %S %S" window buffer-or-name)= )) It's called every time when a buffer is displayed in a window. But unfortunately it has no hook, and (info "(elisp) Buffers and Windows"= ) says that set-window-buffer runs window-configuration-change-hook (too general for this task since called too often) and window-scroll-functions (also called too often). Regarding window-scroll-functions, it would be too strange to use it to catch set-window-buffer calls. (info "(elisp) Window Hooks") says: There are three actions that can change this: scrolling the window, switching buffers in the window, and changing the size of the window. The first two actions run =E2=80=98window-scroll-functions=E2=80=99; th= e last runs =E2=80=98window-size-change-functions=E2=80=99. Shouldn't the first two actions run separate hooks? Moreover, it seems window-scroll-functions doesn't work even for its purpose: it's not called after scrolling, e.g. not called after 'C-l' (recenter-top-bottom) - tried with different prefix args. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 24 04:23:01 2018 Received: (at 32672) by debbugs.gnu.org; 24 Sep 2018 08:23:01 +0000 Received: from localhost ([127.0.0.1]:51281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4M8y-0001Zj-VR for submit@debbugs.gnu.org; Mon, 24 Sep 2018 04:23:01 -0400 Received: from mout.gmx.net ([212.227.17.21]:51215) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4M8x-0001ZS-7B for 32672@debbugs.gnu.org; Mon, 24 Sep 2018 04:22:59 -0400 Received: from [192.168.1.101] ([212.95.5.130]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M3vCA-1fnEfD1MtW-00rYnQ; Mon, 24 Sep 2018 10:22:49 +0200 Message-ID: <5BA89ED5.4050207@gmx.at> Date: Mon, 24 Sep 2018 10:22:45 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32672: 27.0.50; image resize on window resizing 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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> In-Reply-To: <87va6wt79n.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:UoGmwsupHqC09nJq4PWw/GTPWzskG3hwkFnLeBueYotTjKbBGl7 DEjxkvYavNSkMmzfwJpC86KQNiqhHf2RVQbQNteNbc7WVdS3OOZorzqW+6gLTgVGc75Mfuc 50MZ63QjSJF7PBuUASYZLvi5IgvOMYU9D8b+cWh6DbunPZaoVut8c0/4FpkFEHcoLg4hc2+ DWS5Q+m21Hwfk7z3K2GEw== X-UI-Out-Filterresults: notjunk:1;V01:K0:HVYvEfJ1oSc=:9v9OQ/M9kofzal+1Y4Q0Q9 zbn/RSyzbyJsR4DT2K6YYWQXmCDsyt13qL7o/Xp+ymiai+bBdIMrHLgwGsW167uOH/IOon30f 8WMhlCDcH+fIwBuVtMnnzSLByAeDHc1GTsERHOrXV2Sw9hj15rzSDsA2en140QHHohVhz/cin MsmAJrB+RYIMrUm3xTjXeA+Weqtk8sMFxuWB8hFE2MQ8kaxTqXY5VuQJvWh/o2uCqjl1jtO4y mtM+0sEB6Ohj05X2lWSWOHERTv1URAR5EfxLUE69FrVWuq2VDRj33kQo0If0blu8cJUbu50mm vwRRsF5tr85oNfxtjenJcbAZwBzXlJ3FU5SdnBz0uaqglTQbq6OFkJ373xyvseQV/SzzBQifY l/20mxtCiYBSaLU6W08sqOpJszcYSNvrl7zLuZJ61UnoMw53lBoe6Pra4/gWTj341bLeQGMLG oGMnp7niB+N3I+/ac7e695nJANZduAnT6eFB+dbF31oguaron42HVQNJ5vKP5X9aJEV06jm+T xSey8XvmVz4YmQ6tXxdR/PUmz0+K1u5uB52GG2atuOaPOJ+wk5Ypbd/cUeUAALqdIJLySydYy ItG3bRNNflPWX0ywACG33nqDk+lfZoRkx/pteEChivaUJl99MsredS+DvZ68jfLcVRBncSzfK oEWz1BwrcGrPwPQUVyXcT6NjaWU0XIN3EdXZ5+6G7LmAcyUTh1rLoakI7mCLKiUoMUPkH9lqo iEv019wlf6bSkj+XTyoxiJeaLwUcHk1dkElabniyF3VaVSigeQCu7iznma1mKpvtt2EGsQVMu 763LqvlJEndkzUSBEiP/OdBx6Bw7veeiQLW9z50q19EohOoDz4= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > But when I tried > > (advice-add 'select-window :before > (lambda (window &optional norecord) > (message "select-window %S" window))) > > it's clear it's unsuitable either. It's not called when needed, > e.g. when a window displays a new buffer after navigating to it > with 'C-x ' (previous-buffer). Because the selected window does not change, obviously. > However, I get exactly what is needed with > > (advice-add 'set-window-buffer :before > (lambda (window buffer-or-name &optional keep-margins) > (message "set-window-buffer %S %S" window buffer-or-n= ame))) > > It's called every time when a buffer is displayed in a window. > > But unfortunately it has no hook, and (info "(elisp) Buffers and Windo= ws") says > that set-window-buffer runs window-configuration-change-hook (too gene= ral > for this task since called too often) Because we run it also whenever a window changes size which is silly. What else do we have 'window-size-change-functions' for? I wanted to change that but apparently ducked out. > and window-scroll-functions > (also called too often). > Regarding window-scroll-functions, it would be too strange to use > it to catch set-window-buffer calls. > > (info "(elisp) Window Hooks") says: > > There are three actions that can change this: scrolling the window,= > switching buffers in the window, and changing the size of the windo= w. > The first two actions run =E2=80=98window-scroll-functions=E2=80=99= ; the last runs > =E2=80=98window-size-change-functions=E2=80=99. > > Shouldn't the first two actions run separate hooks? > > Moreover, it seems window-scroll-functions doesn't work even > for its purpose: it's not called after scrolling, e.g. not called > after 'C-l' (recenter-top-bottom) - tried with different prefix args. Maybe because the buffer of the scrolled window is not current when you call it. I don't know what to do. We run hooks too often and do not provide sufficient information when running them. Sometimes we even hide information when running a hook. The problem is that changing the current situation will have us either run even more hooks or cause protests when a hook is no more run where it was run before. martin From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 24 04:35:40 2018 Received: (at 32672) by debbugs.gnu.org; 24 Sep 2018 08:35:40 +0000 Received: from localhost ([127.0.0.1]:51305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4MLE-0001v7-IA for submit@debbugs.gnu.org; Mon, 24 Sep 2018 04:35:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52831) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4MLC-0001us-Iq for 32672@debbugs.gnu.org; Mon, 24 Sep 2018 04:35:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4ML3-0003jI-Vt for 32672@debbugs.gnu.org; Mon, 24 Sep 2018 04:35:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59002) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4ML3-0003j0-S3; Mon, 24 Sep 2018 04:35:29 -0400 Received: from [176.228.60.248] (port=1597 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g4ML3-0006VG-FA; Mon, 24 Sep 2018 04:35:29 -0400 Date: Mon, 24 Sep 2018 11:35:23 +0300 Message-Id: <83in2vb8dw.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-reply-to: <5BA89ED5.4050207@gmx.at> (message from martin rudalics on Mon, 24 Sep 2018 10:22:45 +0200) Subject: Re: bug#32672: 27.0.50; image resize on window resizing 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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> <5BA89ED5.4050207@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > Date: Mon, 24 Sep 2018 10:22:45 +0200 > From: martin rudalics > Cc: 32672@debbugs.gnu.org > > I don't know what to do. We run hooks too often and do not provide > sufficient information when running them. Sometimes we even hide > information when running a hook. The problem is that changing the > current situation will have us either run even more hooks or cause > protests when a hook is no more run where it was run before. I agree. I think Lisp programs that use hooks provided by display-related code should generally expect to be called in many unrelated situations, and do whatever it takes by themselves to detect when it's "their" use case. Expectations or requests for more focused hooks are impractical or even not feasible to implement, because core code knows very little about the Lisp application which uses the hook. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 24 08:25:29 2018 Received: (at 32672) by debbugs.gnu.org; 24 Sep 2018 12:25:29 +0000 Received: from localhost ([127.0.0.1]:51436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4Pvd-0003cH-DH for submit@debbugs.gnu.org; Mon, 24 Sep 2018 08:25:29 -0400 Received: from mout.gmx.net ([212.227.17.21]:55831) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4Pvc-0003bs-Es for 32672@debbugs.gnu.org; Mon, 24 Sep 2018 08:25:28 -0400 Received: from [192.168.1.101] ([212.95.5.130]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MACmL-1ftjbt3vI1-00BJE1; Mon, 24 Sep 2018 14:25:21 +0200 Message-ID: <5BA8D7AB.5030106@gmx.at> Date: Mon, 24 Sep 2018 14:25:15 +0200 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#32672: 27.0.50; image resize on window resizing 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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> <5BA89ED5.4050207@gmx.at> <83in2vb8dw.fsf@gnu.org> In-Reply-To: <83in2vb8dw.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:jNCfJmnFwmBNL1uYHuWIAvWvAPXvrKU18KsqppcB/0OQSQug0dw 1SxoqapfpXZzy7+rG2uy6uO8fvUSXV/fGkFjnDtnYW6akXdqZm15Cnhjv4yMzlK/bhnmilD 9CVVqhTjEppK8qGYJxHYpEuzfv9yKHnqxzGH1tR4QSCtOw4ANEqkpf4mPBQoQLEAeAVeXtP +hVDOtfe5zj3wUtSizH9Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:k44q6CkQ0o8=:Q5jEyGWzNjET5TybRgKCof LxSFvqdxdMeQ/e/AjcyUFvWdXAmG64mqC75w8mQ9y+7WSp8/qWLASVAglMkLHi4V7NXZeJ1kL KHJ0xk12ECQmMtBLBNdQ4yRf/Z2suJUDLdNahUT4EhZ31JMJrv7S6jkMZDWAIjYUHSawpLVy/ 3sXQXaQZG+IP2AgzNCQhwwIvVo+p0qYogn+EQ/6B4xpn1LFHKhI38Psd5UruY7Yh9bu7GNNGb R+khn7Lf4UchNkGDDyu1rmML9NRlVe8iczKxC1MswkYUbKZONARhmW0IiwA2Tp3uA67Oi5XY4 g9l3gNpnoagBD0z+dYVwTbb2plp0Gll6dQ2w7gbgJ9BBP3Fac1Q1CNxR01lbqI/iI9AlflPu8 ZZ7ywsBrUu2tOGYICmIGmSNq243g9dXvKdZKxU1fEOIBf5oKxeBF4/x+C9tGvblQjn35YEIYI F4UVqfX+x9bRJWA6eUq6kxpSVVSVu9rQDACbKTRZMiLCvSSM6hjl0fkAA+ZfERkqVzgtzfuNx JjKCHLaLL0IUOpp246yADaaCst51kyprFmQFVqrLhwwSyX8R/wL8rLMRKQnmp5q4qUkSI6W7A VUVk9NHlnysEN6kwkH/0EZXYbWKCYkJAdtMalt6Qrp0skyloNKzWbJVTAlae5mmz/GZ0BNLXv v6WgozUkY3mJiClnooiEvAA+DCwLCFf1fCn4oG7zxuGMriotHFICzUaY41n30zlSWgxVrefAP WRa3HuXwjWtyVLv8zHTF7TcF8UgQ3Ygi20f3Om0UoBpxLyjgWjxtiS8oM0LxtC4BTO8K+JB80 /TLzOOrbGwOp87t55L3AlOodimPAmuqQ9PtYAE5Vl5tTBx/w4I= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> I don't know what to do. We run hooks too often and do not provide >> sufficient information when running them. Sometimes we even hide >> information when running a hook. The problem is that changing the >> current situation will have us either run even more hooks or cause >> protests when a hook is no more run where it was run before. > > I agree. I think Lisp programs that use hooks provided by > display-related code should generally expect to be called in many > unrelated situations, and do whatever it takes by themselves to detect > when it's "their" use case. Expectations or requests for more focused > hooks are impractical or even not feasible to implement, because core > code knows very little about the Lisp application which uses the hook. 'window-configuration-change-hook' is a great mess and is not display-related. What users really need IMO is a single hook say 'window-state-change-functions' that we'd call in redisplay_internal in lieu of 'window-size-change-functions'. We would run it if something in the state of a frame's root window changed (including size changes, changes of the windows' start positions and the selected window) and additionally provide a list of the differences in the frame's previous window state and the one redisplay is about to use. But such a change would be incompatible and the hook would consequently have to be run in parallel with our present hooks. martin From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 24 08:47:10 2018 Received: (at 32672) by debbugs.gnu.org; 24 Sep 2018 12:47:10 +0000 Received: from localhost ([127.0.0.1]:51466 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4QGb-0004Aq-SB for submit@debbugs.gnu.org; Mon, 24 Sep 2018 08:47:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54294) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4QGZ-0004Aa-T8 for 32672@debbugs.gnu.org; Mon, 24 Sep 2018 08:47:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4QGQ-0000hU-72 for 32672@debbugs.gnu.org; Mon, 24 Sep 2018 08:47:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4QGP-0000hM-He; Mon, 24 Sep 2018 08:46:58 -0400 Received: from [176.228.60.248] (port=3511 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g4QGO-0007iP-OW; Mon, 24 Sep 2018 08:46:57 -0400 Date: Mon, 24 Sep 2018 15:46:50 +0300 Message-Id: <83d0t3awqt.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-reply-to: <5BA8D7AB.5030106@gmx.at> (message from martin rudalics on Mon, 24 Sep 2018 14:25:15 +0200) Subject: Re: bug#32672: 27.0.50; image resize on window resizing 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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> <5BA89ED5.4050207@gmx.at> <83in2vb8dw.fsf@gnu.org> <5BA8D7AB.5030106@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > Date: Mon, 24 Sep 2018 14:25:15 +0200 > From: martin rudalics > CC: juri@linkov.net, 32672@debbugs.gnu.org > > > I agree. I think Lisp programs that use hooks provided by > > display-related code should generally expect to be called in many > > unrelated situations, and do whatever it takes by themselves to detect > > when it's "their" use case. Expectations or requests for more focused > > hooks are impractical or even not feasible to implement, because core > > code knows very little about the Lisp application which uses the hook. > > 'window-configuration-change-hook' is a great mess and is not > display-related. It is for the purposes of this discussion, since it's related to changes in what windows display which buffers and which frames show what windows. > What users really need IMO is a single hook say > 'window-state-change-functions' that we'd call in redisplay_internal > in lieu of 'window-size-change-functions'. redisplay_internal knows very little about changes in window configurations, so I predict using this new hook will be as messy as with the existing ones. > We would run it if something in the state of a frame's root window > changed (including size changes, changes of the windows' start > positions and the selected window) and additionally provide a list > of the differences in the frame's previous window state and the one > redisplay is about to use. We'd need to compute this list of changes first, and for that we will need a whole slew of new variables and flags. Currently, redisplay is built on the opposite assumption: that each operation which could potentially require redrawing some window(s) or frame(s) sets the corresponding flags of the object that needs to be redrawn, without any "explanation" of why that flag was set. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 24 13:37:27 2018 Received: (at 32672) by debbugs.gnu.org; 24 Sep 2018 17:37:27 +0000 Received: from localhost ([127.0.0.1]:52304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4UnW-0003Ao-NF for submit@debbugs.gnu.org; Mon, 24 Sep 2018 13:37:26 -0400 Received: from mout.gmx.net ([212.227.15.15]:49277) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4UnU-0003Ab-Nx for 32672@debbugs.gnu.org; Mon, 24 Sep 2018 13:37:25 -0400 Received: from [192.168.1.100] ([212.95.5.41]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MEnX8-1fyRKS1GCQ-00G0rs; Mon, 24 Sep 2018 19:37:14 +0200 Message-ID: <5BA920C4.1060204@gmx.at> Date: Mon, 24 Sep 2018 19:37:08 +0200 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#32672: 27.0.50; image resize on window resizing 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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> <5BA89ED5.4050207@gmx.at> <83in2vb8dw.fsf@gnu.org> <5BA8D7AB.5030106@gmx.at> <83d0t3awqt.fsf@gnu.org> In-Reply-To: <83d0t3awqt.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:0oQIpycOAJY5YtDubTQAX7SZTlYPWCWmZP3c9AaSxAK4AMSwOMF pfsha5TOMPfjelWFK6uWDL+TIHAh4wjUD9rW0gEPVaWzNkNILrXfpKcDZIBDaPn1xTly/gD zM+29giO/xvNpZTG+C+yR96w3GOe+sGt2QGYwixLTFLovZFgw+laFT3IIrMQtilF5JJR4Ko E474QOFQfvNsM3txN2E0Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:OUv5HOEhDsI=:R/jGA9fW3/ngshJm6vtCxH sAxncroh/D9o5xrPK40bK92f78ueDE0c5ftycwSVQfUFpV9d/hh8TPJFgGhqOQTfVwD4Nes8J tj2t4HxPJ8NS5H5FclcWpAdSJuIFTj51CLgx0YU18a6FD8EZWlY7CwXPqypPFhbBjOBugK3k5 9b9SbHKCkhUVvDZ+p9WQuTl6ngMtdxahlw9xd58dy3S7BOZDqt/CEmNzLx0miyYc6C+zxb+Tr wSfM35l8PKXe9fmw1rzGd9pqsdUYZKyBoMR0V0mM8hcW0Q4JK/h97rvo+Q6K1vGHx2P+RNOew 77laailvfklx4NjG8GRvEF86EJpVXCme4u1neLWLANTqrz8wRc7csRBDURqK3y5bllPYKET+4 D5e2gvY7bUNCHEhu0vXWnAyM7Edz8m9r7VFh51g/Nxsx6aOvzXQgx1GI8RXPi3xTnWSPui6Ah ln6MKvBx7AzGOrOXycV1WgCXEpQWZ8aB7QT4i2hbDubHPTeIZoHyNJNgRAwHXyCTERufutVNG 7r+6Xe34Fl0lZteBVtUq4aBNwd/0y1BSyfj+se05OXw27/3Iz3/Vmy9AUVc86P5oIh5W7Gork XJdQI1hdM9xvp3HiJR7aMc9SMbpGiUaaWwsSKaYOOJAydcF1lWGi05cb1ATpvfOSbjS/ozAF0 pF9SgN3eeoRMyL5Qld8QD+VzhtBA/CWlXvEJlC/OIvq9fKZidsTaWSue8xqs5a9pmb7WnHnXw EDXG2TofoEqRMQKJa/jli1XN+TOzBdlhvs1XgF6MDuuvwx8Pyadr3NI+T1/Dmjciewr6HaPkT wAcu4bEgDuO29M6Sk98PARKEJSlLsYFVZR/fJPKQAM4SOQHIBo= X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> 'window-configuration-change-hook' is a great mess and is not >> display-related. > > It is for the purposes of this discussion, since it's related to > changes in what windows display which buffers and which frames show > what windows. The point I tried to make was that currently running that hook is not coupled to the eventual display of windows but to things that happen before. >> What users really need IMO is a single hook say >> 'window-state-change-functions' that we'd call in redisplay_internal >> in lieu of 'window-size-change-functions'. > > redisplay_internal knows very little about changes in window > configurations, so I predict using this new hook will be as messy as > with the existing ones. 'redisplay_internal' per se should not have to know anything about these changes. It would call a simple function that calculates for every window whether it already existed at the time of the last redisplay and whether one of its sizes, its position, buffer, point, or start position changed since then. In addition we could trace the state of its parameters and other things like its dedicatedness. >> We would run it if something in the state of a frame's root window >> changed (including size changes, changes of the windows' start >> positions and the selected window) and additionally provide a list >> of the differences in the frame's previous window state and the one >> redisplay is about to use. > > We'd need to compute this list of changes first, and for that we will > need a whole slew of new variables and flags. Currently, redisplay is > built on the opposite assumption: that each operation which could > potentially require redrawing some window(s) or frame(s) sets the > corresponding flags of the object that needs to be redrawn, without > any "explanation" of why that flag was set. As I said, redisplay would not have to care about that at all. It would simply call 'window-state-change-functions' where it calls 'window-size-change-functions' now. And running 'window-state-change-functions' would use one boolean set (among others) instead of where 'run-window-configuration-change-hook' gets called now and which it resets. Iff that boolean was set, it would start to find all windows where a relevant change occurred and run the functions. Buffer-locally iff a window shows the buffer for which the local hook was set and something changed for that window. The great advantage for users and application programmers would be that their functions would run once only and only if something really changed since last redisplay. Basically, it would extend the current behavior of 'window-size-change-functions' to all window changing functions. And we could extend it in the sense that the users may customize which changes should run their function without inventing future hooks for them (admittedly 'add-hook' would then need a fifth argument or some special interpretation of LOCAL for that). martin From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 24 13:53:30 2018 Received: (at 32672) by debbugs.gnu.org; 24 Sep 2018 17:53:30 +0000 Received: from localhost ([127.0.0.1]:52324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4V33-0003ZL-VU for submit@debbugs.gnu.org; Mon, 24 Sep 2018 13:53:30 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4V31-0003Z5-4L for 32672@debbugs.gnu.org; Mon, 24 Sep 2018 13:53:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4V2r-0001Sn-S0 for 32672@debbugs.gnu.org; Mon, 24 Sep 2018 13:53:21 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39742) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4V2r-0001Sj-Ny; Mon, 24 Sep 2018 13:53:17 -0400 Received: from [176.228.60.248] (port=4378 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g4V2q-0003oK-Ib; Mon, 24 Sep 2018 13:53:17 -0400 Date: Mon, 24 Sep 2018 20:53:07 +0300 Message-Id: <83r2hiaikc.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-reply-to: <5BA920C4.1060204@gmx.at> (message from martin rudalics on Mon, 24 Sep 2018 19:37:08 +0200) Subject: Re: bug#32672: 27.0.50; image resize on window resizing 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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> <5BA89ED5.4050207@gmx.at> <83in2vb8dw.fsf@gnu.org> <5BA8D7AB.5030106@gmx.at> <83d0t3awqt.fsf@gnu.org> <5BA920C4.1060204@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > Date: Mon, 24 Sep 2018 19:37:08 +0200 > From: martin rudalics > CC: juri@linkov.net, 32672@debbugs.gnu.org > > As I said, redisplay would not have to care about that at all. It > would simply call 'window-state-change-functions' where it calls > 'window-size-change-functions' now. And running > 'window-state-change-functions' would use one boolean set (among > others) instead of where 'run-window-configuration-change-hook' gets > called now and which it resets. Iff that boolean was set, it would > start to find all windows where a relevant change occurred and run the > functions. Buffer-locally iff a window shows the buffer for which the > local hook was set and something changed for that window. Those functions will need to keep track of the changes, or record the previous state attributes somewhere, to do their job, right? Are you saying that these are already recorded/tracked? If not, they will need to be added, which was the point I was making. > The great advantage for users and application programmers would be > that their functions would run once only and only if something really > changed since last redisplay. Even the "once" part might be problematic, because redisplay_internal sometimes re-runs its code more than once, as you know. The "really changed since last redisplay" is even trickier, because a given redisplay cycle doesn't always finish all of its job, it can stop in the middle and return after doing only part of what needs to be done, in which case some of the windows are not updated, and we will have lost our point of reference. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 24 15:14:14 2018 Received: (at 32672) by debbugs.gnu.org; 24 Sep 2018 19:14:14 +0000 Received: from localhost ([127.0.0.1]:52339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4WJC-0005Uc-Gg for submit@debbugs.gnu.org; Mon, 24 Sep 2018 15:14:14 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:38528 helo=pdx1-sub0-mail-a31.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4WJB-0005UT-23 for 32672@debbugs.gnu.org; Mon, 24 Sep 2018 15:14:13 -0400 Received: from pdx1-sub0-mail-a31.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a31.g.dreamhost.com (Postfix) with ESMTP id 1F5FB7F979; Mon, 24 Sep 2018 12:14:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=linkov.net; bh=4IxZmT WBW1OvjnsQBM82cfhWOQ8=; b=11xHsXVuH76hD4OmJ1fCw94fkv0+wpVwXGOxJC aj9j9iumka2Qe4rdqif02WTiO0PsQqCFVqd0LRrJzfcPO3VAm+b6ObZfLwW2piJL Q9xlAR5NlLtRNeRsOB7cb7uAk+Yw/BDThlB5rwBNuhe4nWGwWHW8e0Pc4/WvSFEz jHLLI= Received: from localhost.linkov.net (m91-129-111-128.cust.tele2.ee [91.129.111.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a31.g.dreamhost.com (Postfix) with ESMTPSA id 316A67F6EA; Mon, 24 Sep 2018 12:14:10 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a31 X-DH-BACKEND: pdx1-sub0-mail-a31 From: Juri Linkov To: martin rudalics Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET 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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> <5BA89ED5.4050207@gmx.at> Date: Mon, 24 Sep 2018 21:31:13 +0300 In-Reply-To: <5BA89ED5.4050207@gmx.at> (martin rudalics's message of "Mon, 24 Sep 2018 10:22:45 +0200") Message-ID: <87d0t3gicm.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> But unfortunately it has no hook, and (info "(elisp) Buffers and Windo= ws") says >> that set-window-buffer runs window-configuration-change-hook (too gene= ral >> for this task since called too often) > > Because we run it also whenever a window changes size which is silly. > What else do we have 'window-size-change-functions' for? I wanted to > change that but apparently ducked out. Maybe because taking out window size change notifications from window-configuration-change-hook is a backward-incompatible change? >> and window-scroll-functions (also called too often). > >> Regarding window-scroll-functions, it would be too strange to use >> it to catch set-window-buffer calls. >> >> (info "(elisp) Window Hooks") says: >> >> There are three actions that can change this: scrolling the window, >> switching buffers in the window, and changing the size of the windo= w. >> The first two actions run =E2=80=98window-scroll-functions=E2=80=99= ; the last runs >> =E2=80=98window-size-change-functions=E2=80=99. >> >> Shouldn't the first two actions run separate hooks? Please also answer this question. I believe this is the crucial question for this request. >> Moreover, it seems window-scroll-functions doesn't work even >> for its purpose: it's not called after scrolling, e.g. not called >> after 'C-l' (recenter-top-bottom) - tried with different prefix args. > > Maybe because the buffer of the scrolled window is not current when > you call it. Sorry, actually it works, I missed the logged messages because the conten= t of the *Messages* buffer is not refreshed to show new logged messages from the calls of the window-scroll-functions hook such as (add-to-list 'window-scroll-functions (lambda (window display-start) (message "window-scroll-functions %S %S %S" window (window-buffer window) display-start))) This means that C-l (recenter-top-bottom) doesn't redisplay the frame - which is strange since it calls 'recenter' with non-nil arg REDISPLAY. Only after switching to the *Messages* buffer with 'C-x o' it gets redisplayed and all previously emitted messages appear in it. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 24 15:14:19 2018 Received: (at 32672) by debbugs.gnu.org; 24 Sep 2018 19:14:19 +0000 Received: from localhost ([127.0.0.1]:52342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4WJG-0005Uu-QR for submit@debbugs.gnu.org; Mon, 24 Sep 2018 15:14:18 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:38590 helo=pdx1-sub0-mail-a31.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4WJF-0005Ul-8W for 32672@debbugs.gnu.org; Mon, 24 Sep 2018 15:14:17 -0400 Received: from pdx1-sub0-mail-a31.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a31.g.dreamhost.com (Postfix) with ESMTP id 698617F96C; Mon, 24 Sep 2018 12:14:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=00THENhPT79kx4h7/L3xe7fy56M=; b= YRXD5sqK7nmTRsAW4PzCFNU6WjiNav855t3qSpLte1j9r4AzGVvoVi3JqH/z/GSj SCoCA2ySsggSLBFPa6PsB2kOLrkJqMrgaI8Sv7J6GPeh+lHJam525OdvEiO2rncR PKqpqA27bZtwYC2L7jsRUNHu015l64CkHOxhXgGlwPc= Received: from localhost.linkov.net (m91-129-111-128.cust.tele2.ee [91.129.111.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a31.g.dreamhost.com (Postfix) with ESMTPSA id 4D62F7F29D; Mon, 24 Sep 2018 12:14:15 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a31 X-DH-BACKEND: pdx1-sub0-mail-a31 From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET References: <87pnxmyjgt.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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> <5BA89ED5.4050207@gmx.at> <83in2vb8dw.fsf@gnu.org> Date: Mon, 24 Sep 2018 21:38:59 +0300 In-Reply-To: <83in2vb8dw.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 24 Sep 2018 11:35:23 +0300") Message-ID: <87a7o6ewxw.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: martin rudalics , 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> I don't know what to do. We run hooks too often and do not provide >> sufficient information when running them. Sometimes we even hide >> information when running a hook. The problem is that changing the >> current situation will have us either run even more hooks or cause >> protests when a hook is no more run where it was run before. > > I agree. I think Lisp programs that use hooks provided by > display-related code should generally expect to be called in many > unrelated situations, and do whatever it takes by themselves to detect > when it's "their" use case. Expectations or requests for more focused > hooks are impractical or even not feasible to implement, because core > code knows very little about the Lisp application which uses the hook. I think window hook calls should be consistent at least with own inner logic, e.g. as the semantics of the window-size-change-functions hook name suggests it should be called when the window size is not the same as was before, window-configuration-change-hook is called when the result of window-state-get is not the same as it was before, etc. This poses a question what a programmer is supposed to do when a hook is more general, how to filter out the wanted notifications when the hook is fired more often than needed. We already have a working solution in form of window-pixel-width-before-size-change, that could be extended to other hooks, thus they could report the reason of their calls exposing more their meta information, e.g. window-configuration-change-hook to report that only one buffer in one particular window was switched. So either we need more specific hooks, or allow general hooks report the details inscluding the reasons of their calls. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 24 15:31:39 2018 Received: (at 32672) by debbugs.gnu.org; 24 Sep 2018 19:31:39 +0000 Received: from localhost ([127.0.0.1]:52373 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4Wa3-0005y6-3B for submit@debbugs.gnu.org; Mon, 24 Sep 2018 15:31:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4Wa1-0005xu-FU for 32672@debbugs.gnu.org; Mon, 24 Sep 2018 15:31:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4WZt-0003sR-9d for 32672@debbugs.gnu.org; Mon, 24 Sep 2018 15:31:32 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41265) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4WZt-0003sL-4q; Mon, 24 Sep 2018 15:31:29 -0400 Received: from [176.228.60.248] (port=2523 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g4WZr-0003sv-Va; Mon, 24 Sep 2018 15:31:29 -0400 Date: Mon, 24 Sep 2018 22:31:15 +0300 Message-Id: <83lg7qae0s.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-reply-to: <87a7o6ewxw.fsf@mail.linkov.net> (message from Juri Linkov on Mon, 24 Sep 2018 21:38:59 +0300) Subject: Re: bug#32672: 27.0.50; image resize on window resizing References: <87pnxmyjgt.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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> <5BA89ED5.4050207@gmx.at> <83in2vb8dw.fsf@gnu.org> <87a7o6ewxw.fsf@mail.linkov.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32672 Cc: rudalics@gmx.at, 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Juri Linkov > Cc: martin rudalics , 32672@debbugs.gnu.org > Date: Mon, 24 Sep 2018 21:38:59 +0300 > > I think window hook calls should be consistent at least with own inner logic, > e.g. as the semantics of the window-size-change-functions hook name suggests > it should be called when the window size is not the same as was before, > window-configuration-change-hook is called when the result of window-state-get > is not the same as it was before, etc. My point is that these expectations are hard to meet with the current design. Most of those hooks are called from the display engine, which normally has no idea what was changed since the last redisplay, in terms of window dimensions and buffers displayed in each window. You must keep in mind that Emacs has the MVC (model-view-controller) design, where the View part -- redisplay -- basically just reflects on the glass what it finds in the various Lisp data structures at the moment when redisplay is invoked. It doesn't track changes in windows, frames, and buffers. But the users of those hooks want to be invoked when some such change happened. And that is the crux of the problem. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 25 03:27:05 2018 Received: (at 32672) by debbugs.gnu.org; 25 Sep 2018 07:27:05 +0000 Received: from localhost ([127.0.0.1]:52794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4hkP-0005AI-JJ for submit@debbugs.gnu.org; Tue, 25 Sep 2018 03:27:05 -0400 Received: from mout.gmx.net ([212.227.15.15]:40771) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4hkN-00059k-QM for 32672@debbugs.gnu.org; Tue, 25 Sep 2018 03:27:04 -0400 Received: from [192.168.1.101] ([46.125.249.3]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lg0sd-1fP27a3JV5-00pcrL; Tue, 25 Sep 2018 09:26:53 +0200 Message-ID: <5BA9E337.5000806@gmx.at> Date: Tue, 25 Sep 2018 09:26:47 +0200 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#32672: 27.0.50; image resize on window resizing 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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> <5BA89ED5.4050207@gmx.at> <83in2vb8dw.fsf@gnu.org> <5BA8D7AB.5030106@gmx.at> <83d0t3awqt.fsf@gnu.org> <5BA920C4.1060204@gmx.at> <83r2hiaikc.fsf@gnu.org> In-Reply-To: <83r2hiaikc.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:IZHdQ5jwPnAdA57Xm/0W8RNOVgVuW3x3LruNf7DfrL50Hgb9vgS 9smWwTly7LHage6X50ItBCM+3FYTiy6P+pvRk0qecfypm5EwkHDBB7/gQpE82EsJY0yHQLa Lbl3K0rD0jCc+/FNDGcA69yOygDijuppmijg4bTPH6b+FkYN3+DjovU0y1jbNeZMZfZEk3h YmPy4c0KeCWrZ1QRh++Kw== X-UI-Out-Filterresults: notjunk:1;V01:K0:pTwkAkOC0Ao=:0Z9KQmb1ntlP85QIjV1T9O AYju4E8EGZj7jc30yFId8Fm1WAwYsE2SnAsi5PQmlqZt/UlkhQTeT0oxmjenBM7jWrIuuHKVc 9yMfluNzCL4g65A/CxlF4UC9z8NG63QKq0cesBNH94p4Q/ZVvVI5aDEw0UymnT0trpvdslOW9 3CIBy4eQa++Pdxcl6q8fUDO88gwZ7LbXbScU+pFy+1UYHMNRQAvnDgOUP8Bzi94YW5UPZNEtd cIZtgZ2SLtaTNHY1lfXM8jhfRd3xfGVWUlu5pN7qKFzHJtMPCpZ3Dy4WR6hJhX8W36DqipDBO jLkSICSiJDt4I5ZvFmqdzmRBSujukdvDmPcRkgjUcgHBCHeQ+d65bPPBQKntUUm4Uyu5BjLdU OEQwp+CFC6wGhfTKQhz3KiP8d2I9LLMeRt0Wi6SoGMl/syXYlNJ/cW9gCiAV05+uTcQDSwMQh C/SbMiciW79cPJZDEfa3OZNhZI69+FsqGFn4RlIf9j16mN5tQniKe7Gnv85k/sOhp0ymZYU9f uCstrnRLo15tfvzgDTxPD3kD3RYFpDJ7HA+qRZ1fN7/nxcKrcj4bfeK7guRFu1a9NSaTVultw YtZbCU0gkfjY8zGNNQ0pEffo/+G5Dd+bou6LTFGiIsT/OIDVbnT162+XieVQIIVZGNJG/2JW9 1x6EeS0gFUVq4uODrnDmQC0S3YMst6Sa5mYNhTxpxUqyBsnQ2PIRWZJ8zr3i1MlzHJgRw0Eby w9ujWQTAQCGc4sw+oq2gqXf/7cNaHYAao1FFC4O/4bXvBWB4rcu+LV/4fdsKUg2z7CP5R1ZTY 1jTgQiZrys/ZeWW2YoIG0FZ5cdWuF/c/hdkSIT+tGU4xI58+uE= X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: >> As I said, redisplay would not have to care about that at all. It >> would simply call 'window-state-change-functions' where it calls >> 'window-size-change-functions' now. And running >> 'window-state-change-functions' would use one boolean set (among >> others) instead of where 'run-window-configuration-change-hook' gets >> called now and which it resets. Iff that boolean was set, it would >> start to find all windows where a relevant change occurred and run the >> functions. Buffer-locally iff a window shows the buffer for which the >> local hook was set and something changed for that window. > > Those functions will need to keep track of the changes, or record the > previous state attributes somewhere, to do their job, right? Are you > saying that these are already recorded/tracked? If not, they will > need to be added, which was the point I was making. [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.15.15 listed in list.dnswl.org] 1.3 RCVD_IN_RP_RNBL RBL: Relay in RNBL, https://senderscore.org/blacklistlookup/ [212.227.15.15 listed in bl.score.senderscore.com] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (rudalics[at]gmx.at) -0.0 SPF_PASS SPF: sender matches SPF record X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >> As I said, redisplay would not have to care about that at all. It >> would simply call 'window-state-change-functions' where it calls >> 'window-size-change-functions' now. And running >> 'window-state-change-functions' would use one boolean set (among >> others) instead of where 'run-window-configuration-change-hook' gets >> called now and which it resets. Iff that boolean was set, it would >> start to find all windows where a relevant change occurred and run the >> functions. Buffer-locally iff a window shows the buffer for which the >> local hook was set and something changed for that window. > > Those functions will need to keep track of the changes, or record the > previous state attributes somewhere, to do their job, right? Are you > saying that these are already recorded/tracked? If not, they will > need to be added, which was the point I was making. I'm not sure what you mean with "Those functions". Running 'window-size-change-functions' already records the current sizes in preparation for the call during next redisplay. 'window-state-change-functions' would do the same for the values it manages. >> The great advantage for users and application programmers would be >> that their functions would run once only and only if something really >> changed since last redisplay. > > Even the "once" part might be problematic, because redisplay_internal > sometimes re-runs its code more than once, as you know. The "really > changed since last redisplay" is even trickier, because a given > redisplay cycle doesn't always finish all of its job, it can stop in > the middle and return after doing only part of what needs to be done, > in which case some of the windows are not updated, and we will have > lost our point of reference. What you mention here would affect 'window-size-change-functions' already now. I see no great harm in that. If running 'window-size-change-functions' succeeds, callers will have adapted to the new sizes and no further calls are necessary. If it fails, the old sizes will continue to exist and the functions will be called (maybe again) during the next internal redisplay. martin From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 25 03:27:56 2018 Received: (at 32672) by debbugs.gnu.org; 25 Sep 2018 07:27:56 +0000 Received: from localhost ([127.0.0.1]:52797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4hlD-0005Ba-TA for submit@debbugs.gnu.org; Tue, 25 Sep 2018 03:27:56 -0400 Received: from mout.gmx.net ([212.227.15.15]:42535) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4hlC-0005BO-2N for 32672@debbugs.gnu.org; Tue, 25 Sep 2018 03:27:54 -0400 Received: from [192.168.1.101] ([46.125.249.3]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MS5xC-1gBl0t2Wvi-00TGTn; Tue, 25 Sep 2018 09:27:45 +0200 Message-ID: <5BA9E36B.8040300@gmx.at> Date: Tue, 25 Sep 2018 09:27:39 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32672: 27.0.50; image resize on window resizing 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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> <5BA89ED5.4050207@gmx.at> <87d0t3gicm.fsf@mail.linkov.net> In-Reply-To: <87d0t3gicm.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:QfBl3TJwzDYqJz3kIX1EPbZWfPJULWa9xpqCXjx6hKLs8z4PTlK 2Mfm/kpDkKhWIuhv7Grhkxu5uk6EskjEUxmmFFNQNgVBMnXh1kdW2MEY7M0gcLJ9T27hpzt PNoqIkGKfV3hJOK/nfetiBEjODLwr9FnfB+dB3wttdm9qZwZArk5L5SZzZWByXIJn6udesS nZLdCpdIeY9aNjHcpzP2w== X-UI-Out-Filterresults: notjunk:1;V01:K0:jWriWOK6J1o=:75KQEg4j8SOQrNrswZ/Nwb 5w2BRfJxNNE8k4PQUA6la2mIpTnEdNd/0byVx91g2x9v1rSsHbxtx2f8TNeGnX+ONWsLwM+zC UeDWLsl/88aLSXNTIEbx5EsRI3DosYDqgNT1T+ORY/NnjgsfyXs7fdbIhOaVZHYdFfmg8Eib6 9pC8Mo4EZyfchDc1ZdJXA9BNpKea1OaJmnpGUoNRJj0yBtXMDYvi8G+5Q2AiCGRpDnQ/UjQ0y E274UldWkCzKZsClS4eDUk2tqKtn1lM6UmZYdixlrAaRwESx3KWgqam/xhHNSoP8lncvZi0Kx U7w02o8soMZhLaQ3U8TbrYbfr9SYo0qi4eW4nAkKoXuMbUquikBo/X7dIDDX7P3PVasI48CoU oED8KvYkdtMhczKIdlc/X5qij6vd6XoN8cpOsGUqCv1D7ObDKGUao9rjVJlrD8OWo6CWJ7QDq ScVPgRrj/cUvhLr+6g8dt8uSHnWgroQ45nI+r/EBB3rID3m9C8p9iG8xPaQC4Jp9JpVJd76SL 8XVL6NZ1ZYzn5xAJWC1XIjgpmTOsraSLdwrdV4i0pGRd4MslNR8qyCCCSSvAyM2o9VSEoSXpf 1tlif2VyPb1br5/BW2OhDFmEbKRLxzhArUXgWgDr2JfwELPRxG2g6OlwztetiwvJlS7XND8rD oXnxzVJV6xZliUF0Az6Iaq1i8FSDXYaG4HiLCNwmFbgJAckISzr8dQ/1wFGUzLaNMCf7CHriJ cf2STXgAyyZk+JKxMQZCg95eWNxppYJ8pTZuVzq4hgmcsh8LlKOdtDNxa+IDJidEl8MyXSV1N HGIcDBVAcxBHjI9xxO0ucJOidRvaTUJgNMBCVRmTQYo0+HZt2M= X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > Maybe because taking out window size change notifications from > window-configuration-change-hook is a backward-incompatible change? Certainly so. But we now have the situation that only parts of the size changes are reflected in calls of 'window-configuration-change-hook'. I almost certainly will reinstate the call for frame size changes because of Bug#32720. But I won't cover minibuffer window induced size changes. Apparently there's no harm in that because most callers of 'window-configuration-change-hook' are only interested in changes of window widths (and as such will be affected when the body width of a window changes with its total width unchanged). [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.15.15 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (rudalics[at]gmx.at) -0.0 SPF_PASS SPF: sender matches SPF record 1.3 RCVD_IN_RP_RNBL RBL: Relay in RNBL, https://senderscore.org/blacklistlookup/ [212.227.15.15 listed in bl.score.senderscore.com] X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Maybe because taking out window size change notifications from > window-configuration-change-hook is a backward-incompatible change? Certainly so. But we now have the situation that only parts of the size changes are reflected in calls of 'window-configuration-change-hook'. I almost certainly will reinstate the call for frame size changes because of Bug#32720. But I won't cover minibuffer window induced size changes. Apparently there's no harm in that because most callers of 'window-configuration-change-hook' are only interested in changes of window widths (and as such will be affected when the body width of a window changes with its total width unchanged). >>> and window-scroll-functions (also called too often). >> >>> Regarding window-scroll-functions, it would be too strange to use >>> it to catch set-window-buffer calls. >>> >>> (info "(elisp) Window Hooks") says: >>> >>> There are three actions that can change this: scrolling the wind= ow, >>> switching buffers in the window, and changing the size of the wi= ndow. >>> The first two actions run =E2=80=98window-scroll-functions=E2=80= =99; the last runs >>> =E2=80=98window-size-change-functions=E2=80=99. >>> >>> Shouldn't the first two actions run separate hooks? > > Please also answer this question. I believe this is the crucial quest= ion > for this request. I have no answer to this question. But note that switching buffers also runs 'window-configuration-change-hook'. The latter is not run when just the start position of that window's buffer changes. > Sorry, actually it works, I missed the logged messages because the con= tent > of the *Messages* buffer is not refreshed to show new logged messages > from the calls of the window-scroll-functions hook such as > > (add-to-list 'window-scroll-functions > (lambda (window display-start) > (message "window-scroll-functions %S %S %S" > window (window-buffer window) display-start= ))) > > This means that C-l (recenter-top-bottom) doesn't redisplay the frame = - > which is strange since it calls 'recenter' with non-nil arg REDISPLAY.= > Only after switching to the *Messages* buffer with 'C-x o' it gets > redisplayed and all previously emitted messages appear in it. I never recenter so I have no idea what to expect from that function. But from the doc I assume that you have to set 'recenter-redisplay' appropriately. martin From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 25 03:28:06 2018 Received: (at 32672) by debbugs.gnu.org; 25 Sep 2018 07:28:06 +0000 Received: from localhost ([127.0.0.1]:52802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4hlO-0005CU-60 for submit@debbugs.gnu.org; Tue, 25 Sep 2018 03:28:06 -0400 Received: from mout.gmx.net ([212.227.15.15]:54799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4hlM-0005Bk-VG for 32672@debbugs.gnu.org; Tue, 25 Sep 2018 03:28:05 -0400 Received: from [192.168.1.101] ([46.125.249.3]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lhwgc-1fRV790rvG-00n8nk; Tue, 25 Sep 2018 09:27:57 +0200 Message-ID: <5BA9E378.9090105@gmx.at> Date: Tue, 25 Sep 2018 09:27:52 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov , Eli Zaretskii Subject: Re: bug#32672: 27.0.50; image resize on window resizing References: <87pnxmyjgt.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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> <5BA89ED5.4050207@gmx.at> <83in2vb8dw.fsf@gnu.org> <87a7o6ewxw.fsf@mail.linkov.net> In-Reply-To: <87a7o6ewxw.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:vUtMU1P+KmqE9UNmoH+KIVGtcU9ZqnBeCNfGYSj+GWBd9CPWYfM DinZzbFHEXch8kg6SQoQn1hauwgy/fKofJcQ6F3B4qZXo3goYzSWnefWPUR9Lh6uT2OCrwZ /Mm3BPH79FPKnPZDgx8rTwU0IHZgvaCaXsRfvHoBvm0MuuSHlMJx6ZqvH/vW0cOmyG4sCtx MlNO7XOIUI5UrxZlCedTQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:fvVWsxJV3uc=:zHnXmb8mhzIKVIJALrjuHQ Hl4UM7+MX3Ay+u81M4cVIDpIBflh/IZHH5JREUyx/XCP6HlfVEozP4I52lAPnMPLoZGTPsPRG q2bJ2Y1W9P/4Raj/hRS6L+11uRrKffOq8JiTgEl50Gq7U2v7LQHsMGt4NmPIxnSrTSUmFMoTR ijAUcw2ZRblFoC01ecIC0pVmvJiMPGR2AgCBCR8rUiEIW+ak1ku3Te/z5jmh8Q88xuQdNoDoY rlBXJBLQiAgIRok+AO/LTaEWO96aAekQ5zhspF/qwrRgKauA6Kj6JAuR/bSTrqxH3ADJgfTEp JvRPQSzgvHB+dU1IPvJKIaM9qylGG8bykoykFTo9ntWuyVFgnOMr9FhdIVeHyRlsPmhqRDcwp 0/5D3fqouTXhs/iezVm13fnGBSw3O8xYdrIybim61/Xj+iTKxrO8lqVf/+UPEb+6L0tWp6Sxk SGy2ATBNgIV17Rj22oX24L0g6ycNnhN1jEIcb/a3oQzbOXnHeHvBPcG/TnFs1YX58xc1vgwzK NfOySzmjDh5IDDGZZv9hVV9p/fs29iDqJtLjfP5B4o+falkbuqfk8SuEI4T1XCFcijVhk/Dwn R05UwfNSLv4XHc5HGQAizixT4DaR0izBVwlJ/HjEc5ePfZaSjymmKKz8Na2XEX2n5CDopfA8c Upe5DeCduHDbtzR1kZpC9xFy2wL3oONlfC4LIWbdpHpqD0E69DwN6diG0ugI0+qmsaMTJkjUJ nCuBv3tN4ai6n30W7QUZgaTZtcS+pixJVvMdNxrU4q87/WrvD1wNlFpj4npfc4DtbgRA4nlAd W9PO4vbHkyShih84S7dE3fzqDM4hF6bsylg09fL9akSmja09fo= X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > I think window hook calls should be consistent at least with own inner logic, > e.g. as the semantics of the window-size-change-functions hook name suggests > it should be called when the window size is not the same as was before, > window-configuration-change-hook is called when the result of window-state-get > is not the same as it was before, etc. [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.15.15 listed in list.dnswl.org] 1.3 RCVD_IN_RP_RNBL RBL: Relay in RNBL, https://senderscore.org/blacklistlookup/ [212.227.15.15 listed in bl.score.senderscore.com] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (rudalics[at]gmx.at) -0.0 SPF_PASS SPF: sender matches SPF record X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > I think window hook calls should be consistent at least with own inner logic, > e.g. as the semantics of the window-size-change-functions hook name suggests > it should be called when the window size is not the same as was before, > window-configuration-change-hook is called when the result of window-state-get > is not the same as it was before, etc. Tying 'window-configuration-change-hook' to 'window-state-get' would be considerably more than we do now or what I'd propose. We probably shouldn't care about a specific window's scroll bars or margins there. martin From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 25 05:19:30 2018 Received: (at 32672) by debbugs.gnu.org; 25 Sep 2018 09:19:30 +0000 Received: from localhost ([127.0.0.1]:52860 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4jVC-00080d-8f for submit@debbugs.gnu.org; Tue, 25 Sep 2018 05:19:30 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43329) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4jVA-00080P-4S for 32672@debbugs.gnu.org; Tue, 25 Sep 2018 05:19:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4jV0-0005ra-4F for 32672@debbugs.gnu.org; Tue, 25 Sep 2018 05:19:22 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4jUy-0005rK-Kr; Tue, 25 Sep 2018 05:19:18 -0400 Received: from [176.228.60.248] (port=2092 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g4jUx-0004uo-2J; Tue, 25 Sep 2018 05:19:16 -0400 Date: Tue, 25 Sep 2018 12:19:09 +0300 Message-Id: <837eja9boy.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-reply-to: <5BA9E337.5000806@gmx.at> (message from martin rudalics on Tue, 25 Sep 2018 09:26:47 +0200) Subject: Re: bug#32672: 27.0.50; image resize on window resizing 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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> <5BA89ED5.4050207@gmx.at> <83in2vb8dw.fsf@gnu.org> <5BA8D7AB.5030106@gmx.at> <83d0t3awqt.fsf@gnu.org> <5BA920C4.1060204@gmx.at> <83r2hiaikc.fsf@gnu.org> <5BA9E337.5000806@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > Date: Tue, 25 Sep 2018 09:26:47 +0200 > From: martin rudalics > CC: juri@linkov.net, 32672@debbugs.gnu.org > > >> As I said, redisplay would not have to care about that at all. It > >> would simply call 'window-state-change-functions' where it calls > >> 'window-size-change-functions' now. And running > >> 'window-state-change-functions' would use one boolean set (among > >> others) instead of where 'run-window-configuration-change-hook' gets > >> called now and which it resets. Iff that boolean was set, it would > >> start to find all windows where a relevant change occurred and run the > >> functions. Buffer-locally iff a window shows the buffer for which the > >> local hook was set and something changed for that window. > > > > Those functions will need to keep track of the changes, or record the > > previous state attributes somewhere, to do their job, right? Are you > > saying that these are already recorded/tracked? If not, they will > > need to be added, which was the point I was making. > > I'm not sure what you mean with "Those functions". I mean window-state-change-functions, what else? > Running 'window-size-change-functions' already records the current > sizes in preparation for the call during next redisplay. > 'window-state-change-functions' would do the same for the values it > manages. We are talking about hypothetical function(s), so it may well be that there's some misunderstanding. My point is that accurate recording of window-size changes is hard, because the various variables used for that might be outdated (e.g., due top a redisplay cycle that didn't complete). Also, redisplay_internal, which calls those functions, will sometimes call them more than once in a redisplay cycle (see the 'retry' label and code that jumps back to it). Bottom line is what I said up-thread: Lisp programs cannot expect those hook calls to be too accurate and focused, they need to be prepared to handle many irrelevant calls, and they had better have their own bookkeeping regarding window dimensions etc. > > Even the "once" part might be problematic, because redisplay_internal > > sometimes re-runs its code more than once, as you know. The "really > > changed since last redisplay" is even trickier, because a given > > redisplay cycle doesn't always finish all of its job, it can stop in > > the middle and return after doing only part of what needs to be done, > > in which case some of the windows are not updated, and we will have > > lost our point of reference. > > What you mention here would affect 'window-size-change-functions' > already now. I see no great harm in that. Neither do I; my point, once again, is that expectations should be quite low. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 25 13:56:28 2018 Received: (at 32672) by debbugs.gnu.org; 25 Sep 2018 17:56:28 +0000 Received: from localhost ([127.0.0.1]:53993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4rZU-0006qm-Jk for submit@debbugs.gnu.org; Tue, 25 Sep 2018 13:56:28 -0400 Received: from mout.gmx.net ([212.227.15.19]:54467) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4rZS-0006qZ-Ts for 32672@debbugs.gnu.org; Tue, 25 Sep 2018 13:56:27 -0400 Received: from [192.168.1.100] ([213.162.73.255]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M5Lmp-1fqLKZ4Aed-00zYK8; Tue, 25 Sep 2018 19:56:17 +0200 Message-ID: <5BAA76B9.8090007@gmx.at> Date: Tue, 25 Sep 2018 19:56:09 +0200 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#32672: 27.0.50; image resize on window resizing 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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> <5BA89ED5.4050207@gmx.at> <83in2vb8dw.fsf@gnu.org> <5BA8D7AB.5030106@gmx.at> <83d0t3awqt.fsf@gnu.org> <5BA920C4.1060204@gmx.at> <83r2hiaikc.fsf@gnu.org> <5BA9E337.5000806@gmx.at> <837eja9boy.fsf@gnu.org> In-Reply-To: <837eja9boy.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:jQc4VCUdx4iiIG88pbOeB4eGhXE4ozw1MVaGEdHBzBeMkJh5K3Z q/FngrezuFBdjOzNlGXhyalk7ardx0FaA0lCelxbZEOXNSReWD7/REh6JS6SbG194nIG6pK 5H5yKfZ95236dJ7LpZmFFKJBSx3xAtfTdHmTaP+6GUGNMFigTDARwU1uOFoiXJPAZLGK8oZ JUIEeQVj/FBLK6xF3HDew== X-UI-Out-Filterresults: notjunk:1;V01:K0:6y2L+3lBxNk=:TlS57s4lyWyBsFP3J7RE5w NkXk7WkH1Nujx6qrOmFOc8SCez/DuftSsEU4avcIeWiABAQ4ES8vZUJA6EcEZ9rwRyT9zU1N9 QZPQcXUpfVQA/3WtQSsDyFcynIlvdErlVuBrrrE+q+9DylSlhLn6UEB1MkT+3SKmMN33V5gvR 86mh2ECnRUg6AEznp3smJjPlnwskVmIUjYQSV6U8qRltuNFzXBbrUJkfEJYYyn0oM2OO2Uvyf HLEyjSyp5F4+Zy/UvdRFLQ0xpqBoXo5lG6EZeM3RvORO4gzsRL+7swJl7unkFp6jcwoQIWqSH HwQeWUTy40bvyQzpKeQG5IG3YjLtPH9DRJ448XgUH9CBzRMj2B3zOdJUJNNI6C07dEAlBwUqY qFSnYmz83uJGHFqARMZ3QjyBeqsb4mcRcpNA/9hQmh8TZx8+p9WZCN2CyCociHP+Mt+5gIbtC fm6txVCPbMNssuherqArKeiWMfXygTe9uf/YrfJiGGrmLkpaL5qsWv3S3u3+JQS29tkd2vzf9 XH0KTbBKb2yfp+bR2+tYAAehBS5qDZ9ICc54qQqcDQ0v86CsZzZjI8NO9dXHAWx4aEM9jpIxd gJ6+KZBTi2Wvj5KOFWtZMN/kEepj/h5V0RT5lLQjUrmFsv0A8ei95r7KeY3tSUJJ493jCS9Ic 7Ft4aCIePFX4iBLWy1VVFvoMl4R5QVf0hQcznFhFQz2zojir5iGgvY39c0iaE44Vf4AVJKB4r 17u/Nm8fecikEaAror1c0NsbCreUcgieW0wr+myT51r/SkQoQBIKxU1IzPQw8htj0VUQ8seMC 7MM5jxrPEmDQsl3L+ImfCJW3j83fwH1Jk85m7+dH8lJEPSqfOU= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> I'm not sure what you mean with "Those functions". > > I mean window-state-change-functions, what else? That would be a hook and would indeed have to do the work. But why the plural? > We are talking about hypothetical function(s), so it may well be that > there's some misunderstanding. My point is that accurate recording of > window-size changes is hard, because the various variables used for > that might be outdated (e.g., due top a redisplay cycle that didn't > complete). Also, redisplay_internal, which calls those functions, > will sometimes call them more than once in a redisplay cycle (see the > 'retry' label and code that jumps back to it). > > Bottom line is what I said up-thread: Lisp programs cannot expect > those hook calls to be too accurate and focused, they need to be > prepared to handle many irrelevant calls, and they had better have > their own bookkeeping regarding window dimensions etc. 'window-size-change-functions' is not hypothetical and guards itself against running twice for unchanged window sizes. I don't really understand what you doubt here - I rewrote it in its current form because you once said (when discussing Bug#21333) that > I believe window-size-change-functions is meant for taking notice of > resizes done by the user or some Lisp code, not for automated resizes > whose sole purpose is to allow some message be read in its entirety. > If you agree, then the current behavior will make sense to you. > > If anything, IMO we should _reduce_ the number of unrelated events > that trigger a call to these functions. For example, currently any > command that reads from the minibuffer will trigger it, because when > read-from-minibuffer exits, it restores the window configuration by > calling set-window-configuration, which is documented to trigger these > functions. That just doesn't make any sense to me, since most reads > from the minibuffer don't resize any windows! and in a later post you said > I'd say, don't set the "size changed" flag unless the size really > changed. and now it seems that you think that a similar argument does not apply when running 'window-configuration-change-hook'. I'd still need to see a hypothetical example where the same redisplay cycle would run 'window-size-change-functions' functions twice when no sizes actually changed. martin From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 25 14:31:36 2018 Received: (at 32672) by debbugs.gnu.org; 25 Sep 2018 18:31:36 +0000 Received: from localhost ([127.0.0.1]:54012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4s7U-0007iB-72 for submit@debbugs.gnu.org; Tue, 25 Sep 2018 14:31:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51927) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4s7S-0007hw-EO for 32672@debbugs.gnu.org; Tue, 25 Sep 2018 14:31:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4s7J-0001YA-7L for 32672@debbugs.gnu.org; Tue, 25 Sep 2018 14:31:29 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4s7I-0001Xu-Q8; Tue, 25 Sep 2018 14:31:25 -0400 Received: from [176.228.60.248] (port=1504 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g4s7H-0008QT-2U; Tue, 25 Sep 2018 14:31:24 -0400 Date: Tue, 25 Sep 2018 21:31:10 +0300 Message-Id: <83sh1x8m4x.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-reply-to: <5BAA76B9.8090007@gmx.at> (message from martin rudalics on Tue, 25 Sep 2018 19:56:09 +0200) Subject: Re: bug#32672: 27.0.50; image resize on window resizing 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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> <5BA89ED5.4050207@gmx.at> <83in2vb8dw.fsf@gnu.org> <5BA8D7AB.5030106@gmx.at> <83d0t3awqt.fsf@gnu.org> <5BA920C4.1060204@gmx.at> <83r2hiaikc.fsf@gnu.org> <5BA9E337.5000806@gmx.at> <837eja9boy.fsf@gnu.org> <5BAA76B9.8090007@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > Date: Tue, 25 Sep 2018 19:56:09 +0200 > From: martin rudalics > CC: juri@linkov.net, 32672@debbugs.gnu.org > > > Bottom line is what I said up-thread: Lisp programs cannot expect > > those hook calls to be too accurate and focused, they need to be > > prepared to handle many irrelevant calls, and they had better have > > their own bookkeeping regarding window dimensions etc. > > 'window-size-change-functions' is not hypothetical and guards itself > against running twice for unchanged window sizes. I don't really > understand what you doubt here - I rewrote it in its current form > because you once said (when discussing Bug#21333) that > > > I believe window-size-change-functions is meant for taking notice of > > resizes done by the user or some Lisp code, not for automated resizes > > whose sole purpose is to allow some message be read in its entirety. > > If you agree, then the current behavior will make sense to you. > > > > If anything, IMO we should _reduce_ the number of unrelated events > > that trigger a call to these functions. For example, currently any > > command that reads from the minibuffer will trigger it, because when > > read-from-minibuffer exits, it restores the window configuration by > > calling set-window-configuration, which is documented to trigger these > > functions. That just doesn't make any sense to me, since most reads > > from the minibuffer don't resize any windows! > > and in a later post you said > > > I'd say, don't set the "size changed" flag unless the size really > > changed. > > and now it seems that you think that a similar argument does not apply > when running 'window-configuration-change-hook'. All true and agreed, but it doesn't contradict my main point. We could (and do) try to be as accurate as possible, but there are limits to that that cannot be easily lifted, not without some serious redesign. > I'd still need to see a hypothetical example where the same redisplay > cycle would run 'window-size-change-functions' functions twice when no > sizes actually changed. We have better things to do with our free time than discuss hypothetical examples. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 25 15:37:07 2018 Received: (at 32672) by debbugs.gnu.org; 25 Sep 2018 19:37:07 +0000 Received: from localhost ([127.0.0.1]:54030 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4t8s-0000pm-Rl for submit@debbugs.gnu.org; Tue, 25 Sep 2018 15:37:07 -0400 Received: from pop.dreamhost.com ([64.90.62.162]:36602 helo=pdx1-sub0-mail-a31.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4t8q-0000pd-U5 for 32672@debbugs.gnu.org; Tue, 25 Sep 2018 15:37:05 -0400 Received: from pdx1-sub0-mail-a31.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a31.g.dreamhost.com (Postfix) with ESMTP id F356C7F6F6; Tue, 25 Sep 2018 12:37:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=V/3Kr/dcCFpQvCu0xGawezMRWkI=; b= atf2fCbE/FGmpo4fIoIqoFwJWB9UTGsLhwMexSCN09Sks3rg35bFrspeCih2O4PJ G0KNHAHuIuqLsf0IP26tHgxiUnv3H8xIXz7H8j74h3IAqTY3I4ypJ37C+tUCUDle X+/SB1VhwBy0KzmLyUEpZGTaAhaEXvqtXBLP2cbHL4g= Received: from localhost.linkov.net (m91-129-111-128.cust.tele2.ee [91.129.111.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a31.g.dreamhost.com (Postfix) with ESMTPSA id C3B757F37D; Tue, 25 Sep 2018 12:37:02 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a31 X-DH-BACKEND: pdx1-sub0-mail-a31 From: Juri Linkov To: martin rudalics Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET References: <87pnxmyjgt.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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> <5BA89ED5.4050207@gmx.at> <83in2vb8dw.fsf@gnu.org> <87a7o6ewxw.fsf@mail.linkov.net> <5BA9E378.9090105@gmx.at> Date: Tue, 25 Sep 2018 22:24:16 +0300 In-Reply-To: <5BA9E378.9090105@gmx.at> (martin rudalics's message of "Tue, 25 Sep 2018 09:27:52 +0200") Message-ID: <871s9hjvgn.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: Eli Zaretskii , 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> I think window hook calls should be consistent at least with own inner logic, >> e.g. as the semantics of the window-size-change-functions hook name suggests >> it should be called when the window size is not the same as was before, >> window-configuration-change-hook is called when the result of window-state-get >> is not the same as it was before, etc. > > Tying 'window-configuration-change-hook' to 'window-state-get' would > be considerably more than we do now or what I'd propose. We probably > shouldn't care about a specific window's scroll bars or margins there. Your proposed window-state-change-functions would match window-state-get very well, e.g. it could call the hook with an argument containing alist of values that really changed, where elements of the alist could have the same keys as in alist returned from window-state-get, for example: (add-hook 'window-state-change-functions (lambda (window alist) ...) nil t) where 'alist' could have such keys and values of changes: (buffer "*scratch*") - means the buffer was switched in the window (selected) - the window was selected (start . #) - the same meaning as for window-scroll-functions (pixel-width . 672) (pixel-height . 557) - the same meaning as for window-size-change-functions maybe also include (pixel-width-before-size-change . 672) (pixel-height-before-size-change . 557) with the same meaning as window-pixel-width-before-size-change and window-pixel-height-before-size-change or with shorter names (prev-pixel-width . 672) (prev-pixel-height . 557) then it makes sense to add also (prev-buffer "*scratch*") (prev-start . #) Or maybe simpler to call the hook with two arguments containing the whole state data structures: (add-hook 'window-state-change-functions (lambda (window prev-state next-state) ...)) but then it's difficult for its consumer to find the differences. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 26 04:51:23 2018 Received: (at 32672) by debbugs.gnu.org; 26 Sep 2018 08:51:23 +0000 Received: from localhost ([127.0.0.1]:54373 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g55XX-0006TD-Dl for submit@debbugs.gnu.org; Wed, 26 Sep 2018 04:51:23 -0400 Received: from mout.gmx.net ([212.227.15.15]:53291) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g55XW-0006Sy-FM for 32672@debbugs.gnu.org; Wed, 26 Sep 2018 04:51:22 -0400 Received: from [192.168.1.101] ([213.162.73.24]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MeP5b-1gP6rt0dBP-00QDX0; Wed, 26 Sep 2018 10:51:14 +0200 Message-ID: <5BAB487D.1000303@gmx.at> Date: Wed, 26 Sep 2018 10:51:09 +0200 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32672: 27.0.50; image resize on window resizing References: <87pnxmyjgt.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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> <5BA89ED5.4050207@gmx.at> <83in2vb8dw.fsf@gnu.org> <87a7o6ewxw.fsf@mail.linkov.net> <5BA9E378.9090105@gmx.at> <871s9hjvgn.fsf@mail.linkov.net> In-Reply-To: <871s9hjvgn.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:vAbDfRJtXUr1c4lsIj2rHDo0MZ/uDAR7gPjgfTk94DEBlrG2arK T7Q/9qspQgfm3kKIUpy86SLPO+tvcH3xrJ1s70D+z5wuIbgJxR/XV5daixY86Cbt8q5kV1D Yh0VoQmKTBnL1P9yqufZI6NDIdDLf2FZiR9KmIygDma8THqymdCZnkUIausWdT9GoQI9q48 1yp6JgqQgOdq2eFd3zzFw== X-UI-Out-Filterresults: notjunk:1;V01:K0:MQefMgvRUGQ=:S9HetseMYLEDF3t3PXoXDg rbfZJSE/vGbY06hNHbbUSls8ue4GoqqDsuerze3lOY+rPFbfXl2IyFg6Fcdm5EoGlx/ySxEBV LdmEvagtpCTzoWAvzn4/SZnaot2kXymncz0E+l9w6kB39o2BZ/dNvgiD8q8NBIJqMQDcuOVBB f59vQ78qCU7jsDAkDfQv94IsrlQmPsaouWwhGQF44idKHG2lesxrK0rJBSZGgZDLjNTebMiIG +HvwA0bt8xsYa5mB2guErYTEPJNjjpB0ESkjT2woCCvT09t9vpca0xoaiTjEwC+T1r0nOfIY9 E1nKYz0JGIlOop1THrjfWI5uNyzVosaar4zd9u7FcWR70t0fZMky2hR4wmF4hnOJgfYpMmMVm te2qfbzsTVwj/OIQ6UsTAHHnGMXXW/DEb6zZRS932AuJOUxdzuv+qQSClLJlKHVuXQN2rGIBf pBZCNNOU1uscYUEj/oEST+P9wpi88aGmxy/OQsCXSJSMYjdwkDx4Mmt6rkrI/2s1W2ZgugAuM UA6fnZR0tvHLrUUnAKEJpzNNvlmOHE8Dr8qah+l7VqQTtFiEWEsmiiCHEhJmdRo0Puc7b2q5A tEWjS5dTrLE4VxHjQRqZ1qf/h1drBv+ZeUmM72OK6+rUg/G2ZMmYUduI1DPqVAV8yBsjmTpWH qDaioi4wPGLigImV8oYhxMValT7PyQJxTqCkPm9Rvr/Fu6Sq+1WmaVeqEqbq6gvaw0hj8iGIm x9bbDkJ2p5V6Z/UJh2ScvN0xbVUeTjcDDte4ekMIN3WHhETtHo9sRiRbjYXwzV0Y6wII1IMfC 2RySxCnLEvOU6EIBkAkhNS8y4N00iF/M0jAXGzEBlldhLous0w= X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: Eli Zaretskii , 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Your proposed window-state-change-functions would match window-state-get > very well, e.g. it could call the hook with an argument containing alist > of values that really changed, where elements of the alist could have > the same keys as in alist returned from window-state-get, Retaining the nomenclature of 'window-state-get' is part of the plan. But I'm not sure whether we want to retain all of what is recorded in a window state. > for example: > > (add-hook 'window-state-change-functions (lambda (window alist) ...) nil t) > > where 'alist' could have such keys and values of changes: > > (buffer "*scratch*") - means the buffer was switched in the window (buffer . #) rather > (selected) - the window was selected Yes. But this would be stored on a per frame basis. > (start . #) - the same meaning as for > window-scroll-functions > > (pixel-width . 672) (pixel-height . 557) - the same meaning as for > window-size-change-functions Yes. And maybe the body size in pixels as well. > maybe also include > > (pixel-width-before-size-change . 672) > (pixel-height-before-size-change . 557) > > with the same meaning as window-pixel-width-before-size-change > and window-pixel-height-before-size-change > > or with shorter names > > (prev-pixel-width . 672) > (prev-pixel-height . 557) > > then it makes sense to add also > > (prev-buffer "*scratch*") > > (prev-start . #) That's one way to do that. I'm not yet sure whether there's a need for a function like 'window-prev-buffer' getting me the buffer shown the last time redisplay called 'window-state-change-functions'. If not, we could encapsulate all information for the user in the alist as you propose. > Or maybe simpler to call the hook with two arguments > containing the whole state data structures: > > (add-hook 'window-state-change-functions (lambda (window prev-state next-state) ...)) > > but then it's difficult for its consumer to find the differences. That would be considerably simpler to implement. martin From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 27 16:20:20 2018 Received: (at 32672) by debbugs.gnu.org; 27 Oct 2018 20:20:20 +0000 Received: from localhost ([127.0.0.1]:45779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGV4G-00005X-Ih for submit@debbugs.gnu.org; Sat, 27 Oct 2018 16:20:20 -0400 Received: from catfish.maple.relay.mailchannels.net ([23.83.214.32]:18563) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGV4D-00005O-Ol for 32672@debbugs.gnu.org; Sat, 27 Oct 2018 16:20:18 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 009E8682EB2; Sat, 27 Oct 2018 20:20:16 +0000 (UTC) Received: from pdx1-sub0-mail-a3.g.dreamhost.com (unknown [100.96.16.121]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id B8D35682B0B; Sat, 27 Oct 2018 20:20:15 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a3.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Sat, 27 Oct 2018 20:20:15 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Language-Wide-Eyed: 09cf817f7a42bc1e_1540671615850_3257493458 X-MC-Loop-Signature: 1540671615850:3380731031 X-MC-Ingress-Time: 1540671615850 Received: from pdx1-sub0-mail-a3.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a3.g.dreamhost.com (Postfix) with ESMTP id 714F07F694; Sat, 27 Oct 2018 13:20:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=nU5midnIpgQ8gVed5TvCAzDDy6I=; b= qtMK2Z3Tybkj9/iQE3WXrNPXfOBsMxPPg/R0DtsK1/kQ34bkNBIS5vX1wDuzVpZS Kx+gxm1rkq6vikdSACxGhIkoHc0z49n7KkP0hKO17lempGHc6YfFXVKXHhUp93c/ QwpgNonCsKP32zfXuAYIPXROcmOlXYJ/6WA14JCrD5o= Received: from mail.jurta.org (m91-129-105-154.cust.tele2.ee [91.129.105.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a3.g.dreamhost.com (Postfix) with ESMTPSA id 560D07F68E; Sat, 27 Oct 2018 13:20:12 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a3 From: Juri Linkov To: martin rudalics Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET References: <87pnxmyjgt.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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> <5BA89ED5.4050207@gmx.at> <83in2vb8dw.fsf@gnu.org> <87a7o6ewxw.fsf@mail.linkov.net> <5BA9E378.9090105@gmx.at> <871s9hjvgn.fsf@mail.linkov.net> <5BAB487D.1000303@gmx.at> Date: Sat, 27 Oct 2018 22:38:37 +0300 In-Reply-To: <5BAB487D.1000303@gmx.at> (martin rudalics's message of "Wed, 26 Sep 2018 10:51:09 +0200") Message-ID: <87zhuzgx9u.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrheeggdduheduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesmhdtreertdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdehrdduheegnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddthedrudehgedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehruhgurghlihgtshesghhmgidrrghtnecuvehluhhsthgvrhfuihiivgeptd X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: Eli Zaretskii , 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain >> Your proposed window-state-change-functions would match window-state-get >> very well, e.g. it could call the hook with an argument containing alist >> of values that really changed, where elements of the alist could have >> the same keys as in alist returned from window-state-get, > > Retaining the nomenclature of 'window-state-get' is part of the plan. > But I'm not sure whether we want to retain all of what is recorded in > a window state. > >> for example: >> >> (add-hook 'window-state-change-functions (lambda (window alist) ...) nil t) >> >> where 'alist' could have such keys and values of changes: >> >> (buffer "*scratch*") - means the buffer was switched in the window > > (buffer . #) rather Here is a complete implementation that works well when tested on display-buffer-directionally in bug#32790 (it doesn't handle window-point because then the hook is called too often): --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=window-state-change-functions.1.el Content-Transfer-Encoding: quoted-printable (defvar window-state-change-functions nil) (defvar window-state-change-prev nil) (defun window-state-change-pre-command () (setq window-state-change-prev (mapcar (lambda (window) `(,window (buffer . ,(window-buffer window)) (selected . ,(eq window (selected-window))) (start . ,(window-start window)))) (window-list nil 'nomini)))) (add-hook 'pre-command-hook 'window-state-change-pre-command) (defun window-state-change-post-command () (mapc (lambda (window) (let ((prev (cdr (assq window window-state-change-prev))) alist) (when prev (unless (eq (cdr (assq 'buffer prev)) (window-buffer w= indow)) (push `(buffer ,(cdr (assq 'buffer prev)) ,(window-buffer w= indow)) alist)) (unless (eq (cdr (assq 'selected prev)) (eq window (selecte= d-window))) (push `(selected ,(cdr (assq 'selected prev)) ,(eq window (= selected-window))) alist)) (unless (eq (cdr (assq 'start prev)) (window-start wind= ow)) (push `(start ,(cdr (assq 'start prev)) ,(window-start wind= ow)) alist))) (when alist (run-hook-with-args 'window-state-change-functions window ali= st)))) (window-list nil 'nomini))) (add-hook 'post-command-hook 'window-state-change-post-command) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 28 04:59:22 2018 Received: (at 32672) by debbugs.gnu.org; 28 Oct 2018 08:59:22 +0000 Received: from localhost ([127.0.0.1]:46646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGgun-0008Jj-RA for submit@debbugs.gnu.org; Sun, 28 Oct 2018 04:59:22 -0400 Received: from mout.gmx.net ([212.227.15.18]:36099) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGguk-0008JU-US for 32672@debbugs.gnu.org; Sun, 28 Oct 2018 04:59:19 -0400 Received: from [192.168.1.101] ([212.95.5.102]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MJByE-1gJQjW1tgA-002oZE; Sun, 28 Oct 2018 09:59:08 +0100 Received: from [192.168.1.101] ([212.95.5.102]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MJByE-1gJQjW1tgA-002oZE; Sun, 28 Oct 2018 09:59:08 +0100 Message-ID: <5BD57A59.2070502@gmx.at> Date: Sun, 28 Oct 2018 09:59:05 +0100 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32672: 27.0.50; image resize on window resizing References: <87pnxmyjgt.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> <5BA20763.8070305@gmx.at> <875zz1t6y1.fsf@mail.linkov.net> <5BA34D7E.4030509@gmx.at> <87fty3sp6a.fsf@mail.linkov.net> <5BA490E5.5090506@gmx.at> <87zhw9xjpx.fsf@mail.linkov.net> <5BA74E3D.5030903@gmx.at> <87va6wt79n.fsf@mail.linkov.net> <5BA89ED5.4050207@gmx.at> <83in2vb8dw.fsf@gnu.org> <87a7o6ewxw.fsf@mail.linkov.net> <5BA9E378.9090105@gmx.at> <871s9hjvgn.fsf@mail.linkov.net> <5BAB487D.1000303@gmx.at> <87zhuzgx9u.fsf@mail.linkov.net> In-Reply-To: <87zhuzgx9u.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:LwR3Fx6z++0tmjVKIajNuasfTJ3NjHKTPfF7yru9UYgQZRdAj49 /+jmi8AP4Rg8OBxQtmhPmymUd8N9V5G9BrASlwXeq6lPu7vlyRnwexc7q6LNgccjLDmXdhx wSRIY3RiGWXWikFARBQ9pBjrdtSPuWTxdzIm5elucB0JWG/Vs7YilH4A9tu/57qnrz1rJ67 2Rcax/NPR87K7ylXs8wDg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V01:K0:RbFKWtixwFA=:zBZMnANNpeXhhay/zsY9pi y2+dPchahHnWCieVJ96nO2JDpxeChkGjlX810G62podNXAZGJuOvG07CAfd2B8iZuCKRabpiA xj4u2RKNmYZoqnfCbxf8Qbd8bsEWc9JQU+WQw88KYVKoz4dhkZ0O1sm8SBuxIuHuFjJ47aE9n 56uEISjSYJabnZxWALeLqb7mhZM4G8iOTa9TpJtdSV3YXVT8uABVjIU6Vku1VcEyT9uD+Mieu 2MODYW3xdhV9YHzXlNh1CsWLh+/j6AbOqutJ11fQZniwkBcwvUA8m8z+rpvIcFLLU0bIB/4qp 5Ds/+EYNehkqgDp/E2uATjCISRHgK7/ctU6YY7PbANFFM59Nj5yvVGI7NrIB9Aw07RQHSLiuj VXRLCkaXpl7vYiJZ4I0srNPR4sakFsgPLLi/gLVk89m4aTSH61JiEAMT0Nueeh8PrSJHiLtVt Ci1AB8MLJ7njYFsvUHhomapcdKe07bb/13XzuhYGkCgFPxJR5wGxMDjcqamOyqbs1uAd6RCiP VyJSagTnW/hFw7uFu200GSQfd0IRjT98w4wdVcjTEZL9/cwL29qqc7jkEO7SZuAxooLW/V7Rj qPo0KzDk280kBv34g6dt64ff1b8qtGDGDKudbUSGhSDfe5B6uzQlnxhFpGdBbElS3xVBqxKau T9xyrXpM6cw8dnmpd4zrAj1EuFbYNDqCAnIHeEMad87maF12CoLwtKe+KmqPoOYzCo4THk7UI UP3ogp13bwRaTeK0V6HCXKHo+i+KTC2aLFHjuEtBdXkTBEgqhVmsWlJtAbIxlYN2Y9zrCvVxN IypSaAubYQiMyPgdkZb/InADw5dWgDlcDmya84JkGQSlJFBv4k= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32672 Cc: Eli Zaretskii , 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>> Your proposed window-state-change-functions would match window-state-get >>> very well, e.g. it could call the hook with an argument containing alist >>> of values that really changed, where elements of the alist could have >>> the same keys as in alist returned from window-state-get, >> >> Retaining the nomenclature of 'window-state-get' is part of the plan. >> But I'm not sure whether we want to retain all of what is recorded in >> a window state. ... > Here is a complete implementation that works well when tested > on display-buffer-directionally in bug#32790 But tying this to the execution of commands misses the point that we would have to react to state changes whenever a frame is redisplayed. That is, we would miss all asynchronous, non-command-bound changes in a frame. What 'window-state-change-functions' would have to do IMO is: (1) Record, for each frame, whether window states might have changed since the last redisplay of the frame. That means to set a frame's flag whenever the buffer of a window, its selectedness or its start point changed. The reason I'd do this is to avoid the costly pre-analysis in (2), for example, after each self-insertion or any other change of buffer text. (2) During redisplay, check whether that flag was set and if so compare all windows on that frame with the state recorded during last redisplay. As we do for 'window-size-change-functions' already now but also check all window related things like those from (1). If and only if something changed, run the functions on 'window-state-change-functions' providing them information of what has changed - a new window w was made, the buffer of window w has changed and b was its buffer during last redisplay, w was selected and ww was the window selected during last redisplay and so on. Or just give them the old state with, say, window buffers instead of window buffer names and the previous and next buffers of each window elided (these would be too costly to maintain and analyze, I think). Thereafter, record the new state of the frame and clear the flag. This would improve on the current 'window-configuration-change-hook' in two regards: We'd run it less often (remember the number of calls you cited earlier) and we'd run it more accurately (that is, only when and always when something did really change). The hard part to code such a thing is _how_ to provide the information of what has changed. There are three major elements: (a) Windows that were added. Trivial. (b) Windows that were deleted. Trivial. (c) Windows where something changed (size, buffer, start position, dedicatedness, a window parameter, 'quit-restore' ???, ...). Non-trivial. Note that not providing that information will mean that the function run by the hook would have to manually compare the old state with the present one in order to find out what has changed, much as what they would do for size changes already now. > (it doesn't handle > window-point because then the hook is called too often): I suppose we could but only when it's written back, that is, changing point of the buffer shown in the selected window wouldn't count but writing it back into 'window-point' when selecting another window would. But in principle I agree with what you mean here. martin From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 26 18:50:12 2018 Received: (at 32672) by debbugs.gnu.org; 26 Dec 2018 23:50:12 +0000 Received: from localhost ([127.0.0.1]:38049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcIwA-0006Xb-Or for submit@debbugs.gnu.org; Wed, 26 Dec 2018 18:50:11 -0500 Received: from bird.maple.relay.mailchannels.net ([23.83.214.17]:4016) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcIw4-0006Wu-VG for 32672@debbugs.gnu.org; Wed, 26 Dec 2018 18:50:05 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id F3815283499; Wed, 26 Dec 2018 23:49:59 +0000 (UTC) Received: from pdx1-sub0-mail-a49.g.dreamhost.com (unknown [100.96.26.166]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 957C7283940; Wed, 26 Dec 2018 23:49:59 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a49.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Wed, 26 Dec 2018 23:49:59 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Oafish-Spot: 53db41ca72329a14_1545868199794_4096371742 X-MC-Loop-Signature: 1545868199794:321197706 X-MC-Ingress-Time: 1545868199793 Received: from pdx1-sub0-mail-a49.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a49.g.dreamhost.com (Postfix) with ESMTP id 55A227FC63; Wed, 26 Dec 2018 15:49:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=Kf0Xh0BfgTxYceKbhQw3bbxeG+M=; b= yxl3xGcchveNqXEsHG7YM5MdxR/EeC9FsdP217BOe564w6wsnf7uQ2xR28WitCNl 5ND/M6GtvvcARH/wbitJ0uVoU7ROE/ck7D/0whIQ2IYSFm2oKslF/rOvbtkV1FOs 2MylGtrhIPpf1m6d4If1FhYJqiTVB/TDjqhH6q/90nc= Received: from mail.jurta.org (m91-129-108-193.cust.tele2.ee [91.129.108.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a49.g.dreamhost.com (Postfix) with ESMTPSA id 6ADB57FC6E; Wed, 26 Dec 2018 15:49:56 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a49 From: Juri Linkov To: 32672@debbugs.gnu.org Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET References: <87pnxmyjgt.fsf@mail.linkov.net> Date: Thu, 27 Dec 2018 01:42:54 +0200 In-Reply-To: <87pnxmyjgt.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 09 Sep 2018 18:54:27 +0300") Message-ID: <87r2e3j1mp.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrtddugddugecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtkedrudelfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdekrdduleefpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepfedvieejvdesuggvsggsuhhgshdrghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: martin rudalics X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Using new hooks I noticed only one problem that when the same image buffer is displayed in several windows then using `other-window' to switch between them, the selection-change hook is not always called. diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 92ba577b4f..0d6a0b8d04 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -574,6 +574,10 @@ image-mode (add-hook 'change-major-mode-hook #'image-toggle-display-text nil t) (add-hook 'after-revert-hook #'image-after-revert-hook nil t) + (add-hook 'window-size-change-functions (debounce #'image-window-change 1) nil t) + (add-hook 'window-state-change-functions (debounce #'image-window-change 1) nil t) + (add-hook 'window-selection-change-functions (debounce #'image-window-change 1) nil t) + (run-mode-hooks 'image-mode-hook) (let ((image (image-get-display-property)) (msg1 (substitute-command-keys @@ -828,6 +832,19 @@ image-after-revert-hook (get-buffer-window-list (current-buffer) 'nomini 'visible)) (image-toggle-display-image))) +(defun image-window-change (window) + (when (and (eq window (selected-window)) (derived-mode-p 'image-mode)) + (let ((spec (image-get-display-property))) + (when (eq (car-safe spec) 'image) + (let* ((image-width (plist-get (cdr spec) :max-width)) + (image-height (plist-get (cdr spec) :max-height)) + (window-edges (window-inside-pixel-edges window)) + (window-width (- (nth 2 window-edges) (nth 0 window-edges))) + (window-height (- (nth 3 window-edges) (nth 1 window-edges)))) + (when (or (not (= image-width window-width)) + (not (= image-height window-height))) + (image-toggle-display-image))))))) + ;;; Animated images From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 27 04:37:06 2018 Received: (at 32672) by debbugs.gnu.org; 27 Dec 2018 09:37:06 +0000 Received: from localhost ([127.0.0.1]:38175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcS6E-0006UU-EK for submit@debbugs.gnu.org; Thu, 27 Dec 2018 04:37:06 -0500 Received: from mout.gmx.net ([212.227.15.19]:47369) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcS6C-0006Tl-UU for 32672@debbugs.gnu.org; Thu, 27 Dec 2018 04:37:05 -0500 Received: from [192.168.1.101] ([46.125.250.89]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M23zf-1hWCLc24Jn-00u5lQ; Thu, 27 Dec 2018 10:36:55 +0100 Message-ID: <5C249D2F.6020803@gmx.at> Date: Thu, 27 Dec 2018 10:36:47 +0100 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov , 32672@debbugs.gnu.org Subject: Re: bug#32672: 27.0.50; image resize on window resizing References: <87pnxmyjgt.fsf@mail.linkov.net> <87r2e3j1mp.fsf@mail.linkov.net> In-Reply-To: <87r2e3j1mp.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:jVLzhFtZcbCSNYdPoaEnp9o84bOPk1uxiNR7lb4gcmzpXwGZhsd KNh/FCkAwBotZnyuB4/xFUsIkX7L6niY+EmLCkF+jR9UnFRRVatJARVQgDFoDLJwpnpaklk 1yoMC8Z6o0e4kJnX+kH3hzsyyoacfCEcWr7O6Icjse135kj374wioHuuh5lV91AWr5b/50/ BDT1yBCTJWMf6oHwn91VA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:1IoxLuOJ9Pg=:yDV9MDrbJXgbY0xOq4ibzO GvMIISuCOmI5jU/W66gn0XSCp00p5hA8dZtKkZADl3Rl2NmHWCM4BHtyRQdR9GBDgGPOppiC2 4LvfrgWErY+TaMA2ZN6wqL56pijj92/Gg62rVIX7Bbahmcm4X2TRm/a+cAxkfyT3SVtzuHOmV aXq/m9TeC1YxB1byU+emb4F/tcqT8YEm1/ar36tONSW6j32QhA5Aai1hTmy/OVyaPOHG/el3K Tm9t0vueBJ1rszd6Ua+y8IV388d0LKvMN4M2ekWBEH0HFVm4wrl+Go7H5r28hBfZz1LVRk2gL aED7v8E6c3cIvbW5NWv7d9K9YeAp1h4tWPFMjzVcLC5cE1y8goqbvLtrqUENPGpuGkKE9xpEr nwFBAETdcZRMDze9eoVNMAdSqUSgzBTWA0SqHy8HLOPRrLYXihcQBocWQoq2YDaqlNkgadQUU OP66YzxhHrDP1j9JojjACk6Ot7IlqELR2ALRLYsrB32Na8BN/xPgtdLP65teruhO0oxpErPRL 1LbcixrEQb/54bCHhXNb8SerlGJHdqi33QpI5SWourXRRc6HN3sG0T3M6kX/f0uXHMvxhaxH1 dqIXhBQhYE+uEmid1sG+U4A3sF5GzOkGDcWTI2gtJA6PP6mRBR/hxrm0/hxwW1cJTdNo1Z7fD WHFPbpEgJ53DPlaV67gDqPo2+tz/gyq1NrOdX4RAqk58dwHRAcbOC5FhwN9TdfdofwL0qswnE bQR28zUbhJMIJ+jL2UPAYVed3Khi4elwsPF8pxnJOH4cqgDm2QKhk2nHdXJZVb6/YHYUfwzmG PDbsKrSnqpQcEkynYmOJMmQ3MRS3PVdRTX/S9AZhs6YAOPN9jg+Z36GRLSm2M0vFq1dyM/zsf /e6x2j/uULX9Z3FWgczvnXQzreoRvICYHWVW73zjgtfln/riLVTu34F4SlwtpkecL4vXwOXf2 ED6DcZqiU7A== X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 32672 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) > Using new hooks I noticed only one problem that when the same image buffer is > displayed in several windows then using `other-window' to switch between them, > the selection-change hook is not always called. I can't imagine that to fail - it's too elementary. Can you give an 'other-window' scenario without images? martin From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 27 10:48:41 2018 Received: (at 32672) by debbugs.gnu.org; 27 Dec 2018 15:48:41 +0000 Received: from localhost ([127.0.0.1]:39465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcXtp-0003gY-5m for submit@debbugs.gnu.org; Thu, 27 Dec 2018 10:48:41 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcXtn-0003gK-KI for 32672@debbugs.gnu.org; Thu, 27 Dec 2018 10:48:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gcXtf-0001QJ-DY for 32672@debbugs.gnu.org; Thu, 27 Dec 2018 10:48:34 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40196) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcXtd-0001P3-Fm; Thu, 27 Dec 2018 10:48:30 -0500 Received: from [176.228.60.248] (port=2707 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gcXtb-0002fD-Ul; Thu, 27 Dec 2018 10:48:29 -0500 Date: Thu, 27 Dec 2018 17:48:28 +0200 Message-Id: <83lg4b6kdv.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-reply-to: <87r2e3j1mp.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 27 Dec 2018 01:42:54 +0200) Subject: Re: bug#32672: 27.0.50; image resize on window resizing References: <87pnxmyjgt.fsf@mail.linkov.net> <87r2e3j1mp.fsf@mail.linkov.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Juri Linkov > Date: Thu, 27 Dec 2018 01:42:54 +0200 > > +(defun image-window-change (window) > + (when (and (eq window (selected-window)) (derived-mode-p 'image-mode)) > + (let ((spec (image-get-display-property))) > + (when (eq (car-safe spec) 'image) > + (let* ((image-width (plist-get (cdr spec) :max-width)) > + (image-height (plist-get (cdr spec) :max-height)) > + (window-edges (window-inside-pixel-edges window)) > + (window-width (- (nth 2 window-edges) (nth 0 window-edges))) > + (window-height (- (nth 3 window-edges) (nth 1 window-edges)))) > + (when (or (not (= image-width window-width)) > + (not (= image-height window-height))) > + (image-toggle-display-image))))))) What happoens in Emacs that was not built with Imagemagick? Should we perhaps do nothing in this hook in that case? From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 27 16:24:24 2018 Received: (at 32672) by debbugs.gnu.org; 27 Dec 2018 21:24:24 +0000 Received: from localhost ([127.0.0.1]:39577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcd8i-0005f6-Di for submit@debbugs.gnu.org; Thu, 27 Dec 2018 16:24:24 -0500 Received: from goldenrod.birch.relay.mailchannels.net ([23.83.209.74]:15460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcd8h-0005ey-7a for 32672@debbugs.gnu.org; Thu, 27 Dec 2018 16:24:23 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 0CFF3682B5C; Thu, 27 Dec 2018 21:24:22 +0000 (UTC) Received: from pdx1-sub0-mail-a68.g.dreamhost.com (unknown [100.96.26.166]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id BF50F6833F5; Thu, 27 Dec 2018 21:24:21 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a68.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Thu, 27 Dec 2018 21:24:22 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Harmony-Cooing: 786d2c2a23d62696_1545945861912_2433173429 X-MC-Loop-Signature: 1545945861912:557326109 X-MC-Ingress-Time: 1545945861911 Received: from pdx1-sub0-mail-a68.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a68.g.dreamhost.com (Postfix) with ESMTP id 55E597FD0D; Thu, 27 Dec 2018 13:24:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=TOSF3VSzeKLfZCvu9m9LRZ3Ma7E=; b= nIboggNQezEbL5XDn+ft3VMjpC3B4fgtHSh/OTNEV+8m8D/jJeBD2i4Spxzm/0tr YB+WzOsUUj8cizq29JSiOMdIY69R+D4Adl5ieWsDgwIjCQLFnzPrJH9wGrJbCpSu 57KWu+yEpLu52/i733A8Gin3/HaCT3Jej0iHcMJ+uYw= Received: from mail.jurta.org (m91-129-108-193.cust.tele2.ee [91.129.108.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a68.g.dreamhost.com (Postfix) with ESMTPSA id 1139E7FD0C; Thu, 27 Dec 2018 13:24:19 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a68 From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET References: <87pnxmyjgt.fsf@mail.linkov.net> <87r2e3j1mp.fsf@mail.linkov.net> <83lg4b6kdv.fsf@gnu.org> Date: Thu, 27 Dec 2018 22:58:04 +0200 In-Reply-To: <83lg4b6kdv.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 27 Dec 2018 17:48:28 +0200") Message-ID: <87a7kq4rhf.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrtdefgdekkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtkedrudelfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdekrdduleefpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepvghlihiisehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgepud X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> +(defun image-window-change (window) >> + (when (and (eq window (selected-window)) (derived-mode-p 'image-mode)) >> + (let ((spec (image-get-display-property))) >> + (when (eq (car-safe spec) 'image) >> + (let* ((image-width (plist-get (cdr spec) :max-width)) >> + (image-height (plist-get (cdr spec) :max-height)) >> + (window-edges (window-inside-pixel-edges window)) >> + (window-width (- (nth 2 window-edges) (nth 0 window-edges))) >> + (window-height (- (nth 3 window-edges) (nth 1 window-edges)))) >> + (when (or (not (= image-width window-width)) >> + (not (= image-height window-height))) >> + (image-toggle-display-image))))))) > > What happens in Emacs that was not built with Imagemagick? Should we > perhaps do nothing in this hook in that case? Let's hope that native image scaling will handle this properly. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 27 16:45:56 2018 Received: (at 32672) by debbugs.gnu.org; 27 Dec 2018 21:45:56 +0000 Received: from localhost ([127.0.0.1]:39592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcdTY-0006Cj-Ck for submit@debbugs.gnu.org; Thu, 27 Dec 2018 16:45:56 -0500 Received: from catfish.maple.relay.mailchannels.net ([23.83.214.32]:11783) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcdTW-0006CZ-GM for 32672@debbugs.gnu.org; Thu, 27 Dec 2018 16:45:54 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 355F85E38D7; Thu, 27 Dec 2018 21:45:53 +0000 (UTC) Received: from pdx1-sub0-mail-a68.g.dreamhost.com (unknown [100.96.26.166]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E824F5E37C2; Thu, 27 Dec 2018 21:45:52 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a68.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Thu, 27 Dec 2018 21:45:53 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Share-Descriptive: 0e619bac5fccb125_1545947153066_218640453 X-MC-Loop-Signature: 1545947153066:3683460963 X-MC-Ingress-Time: 1545947153066 Received: from pdx1-sub0-mail-a68.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a68.g.dreamhost.com (Postfix) with ESMTP id 953E67FCFE; Thu, 27 Dec 2018 13:45:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=CiiT3vQW6GXE7H55Qi4VcMudtws=; b= CTzyjPROHCqExc4SZrY2P1koUYdjG2d0TpZITPRlTomCXhzNJZG5jFno/Vij1CkF V0BGhmDKu2R+TTY7XVeLLCjZM72Fo7PySNo42K31sex400QCksZYRMM9gBAnHB/r LHA7wm8hwE+AS3LDhv9aIZEWHdedetb0U/HwpwbvsDY= Received: from mail.jurta.org (m91-129-108-193.cust.tele2.ee [91.129.108.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a68.g.dreamhost.com (Postfix) with ESMTPSA id 447A57FD07; Thu, 27 Dec 2018 13:45:50 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a68 From: Juri Linkov To: martin rudalics Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET References: <87pnxmyjgt.fsf@mail.linkov.net> <87r2e3j1mp.fsf@mail.linkov.net> <5C249D2F.6020803@gmx.at> Date: Thu, 27 Dec 2018 23:41:59 +0200 In-Reply-To: <5C249D2F.6020803@gmx.at> (martin rudalics's message of "Thu, 27 Dec 2018 10:36:47 +0100") Message-ID: <87y38azly0.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrtdefgdelfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtkedrudelfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdekrdduleefpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtoheprhhuuggrlhhitghssehgmhigrdgrthenucevlhhushhtvghrufhiiigvpedu X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> Using new hooks I noticed only one problem that when the same image buffer is >> displayed in several windows then using `other-window' to switch between them, >> the selection-change hook is not always called. > > I can't imagine that to fail - it's too elementary. Can you give > an 'other-window' scenario without images? This is because of debounce: the selection-change hook is called twice, so only the last call is processed. But the problem is that the selection-change hook is called not in the logical order, as would be expected, i.e. first in unselected window, then in the selected window. But actually it's called in the order of windows in the window list, e.g. first the 'selected' event is called if the window was created earlier, then the 'deselected' event if the window was created later. IOW, the calling order depends on the window order. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 27 23:51:40 2018 Received: (at 32672) by debbugs.gnu.org; 28 Dec 2018 04:51:40 +0000 Received: from localhost ([127.0.0.1]:39663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gck7W-0001ZB-SE for submit@debbugs.gnu.org; Thu, 27 Dec 2018 23:51:40 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gck7U-0001Yw-N8 for 32672@debbugs.gnu.org; Thu, 27 Dec 2018 23:51:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gck7M-0007lS-FE for 32672@debbugs.gnu.org; Thu, 27 Dec 2018 23:51:31 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gck7M-0007l7-BY; Thu, 27 Dec 2018 23:51:28 -0500 Received: from [176.228.60.248] (port=3494 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gck7L-0003YR-VV; Thu, 27 Dec 2018 23:51:28 -0500 Date: Fri, 28 Dec 2018 06:51:29 +0200 Message-Id: <838t0a6ypa.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-reply-to: <87a7kq4rhf.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 27 Dec 2018 22:58:04 +0200) Subject: Re: bug#32672: 27.0.50; image resize on window resizing References: <87pnxmyjgt.fsf@mail.linkov.net> <87r2e3j1mp.fsf@mail.linkov.net> <83lg4b6kdv.fsf@gnu.org> <87a7kq4rhf.fsf@mail.linkov.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Juri Linkov > Cc: 32672@debbugs.gnu.org > Date: Thu, 27 Dec 2018 22:58:04 +0200 > > >> + (when (or (not (= image-width window-width)) > >> + (not (= image-height window-height))) > >> + (image-toggle-display-image))))))) > > > > What happens in Emacs that was not built with Imagemagick? Should we > > perhaps do nothing in this hook in that case? > > Let's hope that native image scaling will handle this properly. We don't have that yet, so we should do something about that in the meantime. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 28 03:35:07 2018 Received: (at 32672) by debbugs.gnu.org; 28 Dec 2018 08:35:07 +0000 Received: from localhost ([127.0.0.1]:39703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcnbn-00072e-DF for submit@debbugs.gnu.org; Fri, 28 Dec 2018 03:35:07 -0500 Received: from mout.gmx.net ([212.227.17.22]:59229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcnbl-00071s-Rm for 32672@debbugs.gnu.org; Fri, 28 Dec 2018 03:35:06 -0500 Received: from [192.168.1.101] ([46.125.249.76]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MQzoI-1gnA112yIo-00UMAY; Fri, 28 Dec 2018 09:34:57 +0100 Message-ID: <5C25E029.5000007@gmx.at> Date: Fri, 28 Dec 2018 09:34:49 +0100 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#32672: 27.0.50; image resize on window resizing References: <87pnxmyjgt.fsf@mail.linkov.net> <87r2e3j1mp.fsf@mail.linkov.net> <5C249D2F.6020803@gmx.at> <87y38azly0.fsf@mail.linkov.net> In-Reply-To: <87y38azly0.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:xw9UxF2KMMaYP2VrEV7BxhrYOO8OiFr7jMUFOnlbhxgnNtnPGgq WLkxOY+E5TVU1H9tSrmT85OIQUWXPxX68vE8Wky5iqoqaALv4DTeFny6EvZv3GurKLaEVwq Psn55/zlsySOnlxbDQLulvK8zBY/Cs4VuyU7uhQ08sZSQ2T+iZ+XaeUYTXKgAaaihM++8VN kYfFvQoRTL7B07NGlU+CQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Y/GN9rtEdn8=:wRR2QJG7Gbou7itp2Cio4l o1uQNqAWx+A+iR5vLejfUkaJaOeLId2Ly6kkw505H3Gv+szTookiU3JXDTVV6m1rrAO5RRI/B XN08CzvxX7HknPiAeDi9i35ePJl+kLRdJo8H+90szRDFOUuJkeMwqG4Cx+cPtVSBTrBC7QuPv qx4oLaGffqaahiwjPPW74eUuFlLsGeO/fPLKdAdgRgqvyIKoGXSXSKhnw3RNR2D6zjGgN4GIQ /bIbjt8TdqZ73WwRmjAW8eyZ8Zxx1U4hK961ms8eVtH4VKOLhJnF1iLHc/cPDI6mFlZaa3R6j I/fyiOb8v6kICtrezPxpWWp5/G3xxXbIRdT+DdDzgU9szUNdH3y40nYzDJuq/f7ut5aCORsOa szvG4N1o2+8tFibtiqrj5vnbJPtsnbiBzZ2UZp7zFGBWijUHt5vw5yuWrF9zErstaZguxO8da rhRXs7NXQD7Z8RR5/xgbZJxHs5UG32ExBTrwHQaW1r/YvNlxX6uOs6gnRjiOAXX0vpPamGBLa jlivgdM/MAeqpX/hXfW0TzZ5WK0HR9Ha9IbwOtJnekz288Qe4LA7Ye7wxgQlAYcJM+BwFgvd6 D3On/E1PQsCiwxExBbqegjTHAo5wDPua0jXB5QUvbMdnFeJnYqbQeIq8XpgXCcKMEBDKUDYKY W/VHZXPBM1Ybd+EG6Q1HD5qOxN6LwpfaDo2Y4HkqHd42oGbbJNcTFPZnvyrCzk/AqIfnCRlOM 7A8WRqYZUHZUkua+QKlWecvCzjz+XHvDGY9kWz4Wu8hQK/xCEdbBzTtuAih8V2Tc49DTHnTkH 3SuXilWzbpiPFhEICIJSFfd1nU9+FeYmLR9NTi4UmYwuvO2BR69MvC+np856WOecQXXAZYe7n en+v8FZacD3RuNkl6441eO7hdhNGehqnJCNDirGY4P4EcnKLrw0Wey0M0UVDSllVVneSyVZ68 utjEWnoyKYw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > This is because of debounce: the selection-change hook is called twice, > so only the last call is processed. But the problem is that the > selection-change hook is called not in the logical order, as would be > expected, i.e. first in unselected window, then in the selected window. > But actually it's called in the order of windows in the window list, > e.g. first the 'selected' event is called if the window was created > earlier, then the 'deselected' event if the window was created later. > IOW, the calling order depends on the window order. This is consistent with running the remaining hooks. In either case you can always use 'old-selected-window' to find out what changed. martin From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 26 09:28:17 2019 Received: (at 32672) by debbugs.gnu.org; 26 Sep 2019 13:28:17 +0000 Received: from localhost ([127.0.0.1]:42941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iDTod-0003Rm-Cm for submit@debbugs.gnu.org; Thu, 26 Sep 2019 09:28:17 -0400 Received: from quimby.gnus.org ([80.91.231.51]:59856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iDToX-0003RW-Cz for 32672@debbugs.gnu.org; Thu, 26 Sep 2019 09:28:13 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iDToO-00036P-N0; Thu, 26 Sep 2019 15:28:03 +0200 From: Lars Ingebrigtsen To: Juri Linkov Subject: Re: bug#32672: 27.0.50; image resize on window resizing References: <87pnxmyjgt.fsf@mail.linkov.net> <87r2e3j1mp.fsf@mail.linkov.net> Date: Thu, 26 Sep 2019 15:27:59 +0200 In-Reply-To: <87r2e3j1mp.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 27 Dec 2018 01:42:54 +0200") Message-ID: <878sqbfaqo.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Juri Linkov writes: > Using new hooks I noticed only one problem that when the same image buffer is > displayed in several windows then using `other-window' to switch between them, > the selection-change hook is not alwa [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: martin rudalics , 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: > Using new hooks I noticed only one problem that when the same image buffer is > displayed in several windows then using `other-window' to switch between them, > the selection-change hook is not always called. [...] > + (add-hook 'window-size-change-functions (debounce #'image-window-change 1) nil t) > + (add-hook 'window-state-change-functions (debounce #'image-window-change 1) nil t) > + (add-hook 'window-selection-change-functions (debounce #'image-window-change 1) nil t) > + I think this sounds like a nice addition for image-mode... but were the remaining edge cases ever resolved? I see that the patch hasn't been applied. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 27 16:56:35 2019 Received: (at 32672) by debbugs.gnu.org; 27 Nov 2019 21:56:35 +0000 Received: from localhost ([127.0.0.1]:56310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ia5IZ-00089F-A4 for submit@debbugs.gnu.org; Wed, 27 Nov 2019 16:56:35 -0500 Received: from brown.birch.relay.mailchannels.net ([23.83.209.23]:6129) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ia5IX-000893-PI; Wed, 27 Nov 2019 16:56:34 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 8351C21CE5; Wed, 27 Nov 2019 21:56:32 +0000 (UTC) Received: from pdx1-sub0-mail-a94.g.dreamhost.com (100-96-4-107.trex.outbound.svc.cluster.local [100.96.4.107]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 15FD7214BD; Wed, 27 Nov 2019 21:56:32 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a94.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Wed, 27 Nov 2019 21:56:32 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Wipe-Cooperative: 56bcac8e650012e9_1574891792340_4082469618 X-MC-Loop-Signature: 1574891792339:1169412243 X-MC-Ingress-Time: 1574891792339 Received: from pdx1-sub0-mail-a94.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a94.g.dreamhost.com (Postfix) with ESMTP id CB2869C456; Wed, 27 Nov 2019 13:56:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=EQiS3cDnDWlD5vyOromKBWGjGKQ=; b= sm2dMpyvznLKyfz8vx+DI3KGJuCgjk7ZzVqk0ZnYx+rNkkS5ufHXiB43OwynQ0UR xIkVbb3TJpAGm0Jf8ef0akOctn6I45d736i3uzlS0X6UQdFqaEl53qGPgpHyp290 yN3O1i0+8MQN3CvmEW/GKn1ia+4tlFwVDCVLxypGlX8= Received: from mail.jurta.org (m91-129-96-42.cust.tele2.ee [91.129.96.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a94.g.dreamhost.com (Postfix) with ESMTPSA id B11EF9C458; Wed, 27 Nov 2019 13:56:23 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a94 From: Juri Linkov To: Lars Ingebrigtsen Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET References: <87pnxmyjgt.fsf@mail.linkov.net> <87r2e3j1mp.fsf@mail.linkov.net> <878sqbfaqo.fsf@gnus.org> Date: Wed, 27 Nov 2019 23:53:46 +0200 In-Reply-To: <878sqbfaqo.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 26 Sep 2019 15:27:59 +0200") Message-ID: <87a78iyz8l.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: martin rudalics , 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain tags 32672 fixed close 32672 27.0.50 quit >> Using new hooks I noticed only one problem that when the same image buffer is >> displayed in several windows then using `other-window' to switch between them, >> the selection-change hook is not always called. > > [...] > >> + (add-hook 'window-size-change-functions (debounce #'image-window-change 1) nil t) >> + (add-hook 'window-state-change-functions (debounce #'image-window-change 1) nil t) >> + (add-hook 'window-selection-change-functions (debounce #'image-window-change 1) nil t) >> + > > I think this sounds like a nice addition for image-mode... but were the > remaining edge cases ever resolved? I see that the patch hasn't been > applied. This is installed now with the following patch and closed. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=image--window-change.patch diff --git a/lisp/image-mode.el b/lisp/image-mode.el index db6864649d..09d7828047 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -599,6 +599,10 @@ image-mode--setup-mode (add-hook 'change-major-mode-hook #'image-toggle-display-text nil t) (add-hook 'after-revert-hook #'image-after-revert-hook nil t) + (add-hook 'window-size-change-functions #'image--window-change nil t) + (add-hook 'window-state-change-functions #'image--window-change nil t) + (add-hook 'window-selection-change-functions #'image--window-change nil t) + (run-mode-hooks 'image-mode-hook) (let ((image (image-get-display-property)) (msg1 (substitute-command-keys @@ -856,6 +860,27 @@ image-after-revert-hook (get-buffer-window-list (current-buffer) 'nomini 'visible)) (image-toggle-display-image))) +(defvar image--window-change-function + (debounce 1.0 + (lambda (window) + (when (window-live-p window) + (with-current-buffer (window-buffer) + (when (derived-mode-p 'image-mode) + (let ((spec (image-get-display-property))) + (when (eq (car-safe spec) 'image) + (let* ((image-width (plist-get (cdr spec) :max-width)) + (image-height (plist-get (cdr spec) :max-height)) + (edges (window-inside-pixel-edges window)) + (window-width (- (nth 2 edges) (nth 0 edges))) + (window-height (- (nth 3 edges) (nth 1 edges)))) + (when (and image-width image-height + (or (not (= image-width window-width)) + (not (= image-height window-height)))) + (image-toggle-display-image))))))))))) + +(defun image--window-change (window) + (funcall image--window-change-function window)) + ;;; Animated images --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 28 04:20:46 2019 Received: (at 32672) by debbugs.gnu.org; 28 Nov 2019 09:20:46 +0000 Received: from localhost ([127.0.0.1]:56621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iaFyg-0003vF-Cl for submit@debbugs.gnu.org; Thu, 28 Nov 2019 04:20:46 -0500 Received: from mout.gmx.net ([212.227.15.15]:55527) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iaFyc-0003um-QF for 32672@debbugs.gnu.org; Thu, 28 Nov 2019 04:20:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1574932833; bh=y+3tzjAO3waHbg/4q96nykKDXJLgUL+hT2VamM5W6kI=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=YlcVXjfC0I6mBpr0nX2Q6ztx+d7Y2IAru6Ve0g+y1kHEhmjQ0rODeBZo2GGMuvAGf OcIMV4HFoipAWWWif/4I8s0UunBasBOUJJIPCGyUCZkL+3rMpsdULLTbakCwAGcedL Uf5PzePEz25eeASSU4KTzXlbi1PsiQrVhzVHB5Fo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([46.125.249.73]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Ml6qM-1i6T7t0IxQ-00lXki; Thu, 28 Nov 2019 10:20:33 +0100 Subject: Re: bug#32672: 27.0.50; image resize on window resizing To: Juri Linkov , Lars Ingebrigtsen References: <87pnxmyjgt.fsf@mail.linkov.net> <87r2e3j1mp.fsf@mail.linkov.net> <878sqbfaqo.fsf@gnus.org> <87a78iyz8l.fsf@mail.linkov.net> From: martin rudalics Message-ID: <86cdbf31-91fc-4a67-dd80-f648d0734d4e@gmx.at> Date: Thu, 28 Nov 2019 10:20:32 +0100 MIME-Version: 1.0 In-Reply-To: <87a78iyz8l.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-AT Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:4rlAS8xadlitjwhzjqk6o8F+1rvtaP6Gi54WF9NIguTsyQn1i93 VhaIBAaVuXZ0YeWG04j95HgId2dUOHYjJgxQKj3LSTT2skGl6xKbAX0uvzRbvt/Hy6MJByK cvFkIbEJf0ogNwJouyrubH70Ikg94klUBfDph+PrQRoZZ5yC2PaUGG0E6Ti5WLZ+0ObZsLp GkN2jN7b5OIDxgCvRyACg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:mLwWPb6v3JU=:Hqi3pqKtGfnvZH4n1X/ctZ Znx4lWQ5caGO6tli2MV1gUisc36klap/w1acVNPZKsyN3+VzGeLDkQZz0crdvMSDofNKDzDFe NMRkN5Wn4OG1RV9D8qneuJsNDo1KlAhaDlXOKKvwoHyiesJ+TLMJT0LY5Rtcva0wTrxz5CI0H t3h127CXzw/WOvG/GGOHFhMtrWVnDGA1BL46TvLSqcsIy+WZfZBffsNuWruAEVWuN+N4QnsmK r98rpxBiEOvnV0v1yJrx4778gPTR/NhDlhlAF/sTqSEo5RRsf46R8RY6cqD0MLNbFoqhaqOJE NCwtszeTtZwHlXY8v+wdPw5286f0lwYOO6VHOBDC080qKcThbAvDI5ZXXoe5iFSFkscpARma6 52vusELal2Pv+0sM/Szw8Ij97MaeJ4RLhqAGHeVW1dNRR8QU4mrimZ6L1ZcFzafLbfcZwvQtO VD2JxMxbkGSY288ISVAJvLE+te6whVcMqGThZpvCSMUcrZ3ghADLSqSXbXjNGGGO3+KYrIr/i M1WigvoNUxtInGC2pQIZ4zanIlgE2wGqdF927AvQqOC3fhlF84Ce/Jv6hbc+qEgRHAyAaYqMV +tC+TiyM7HliN/kIiQiaaYEnLqJgMutZGYIyrMAsxOmSMveCG4RPeH2IloY2kDODxZrdetKKc 6NODRXGe4Li/nQl0gN/JJvrUNqCF08h6MxPhsKsdUr8xMLjZL1PeLe5m2S7670jKqFF3YuoEk zHnBMZ3EVjE8gGz0R4JaoPXC+ts2bLq1c+jJuoYaIKpFR8skvkZH+EZIfn9kj8Rt0iaMCXCf4 9iecjfeZ2HntbX30n5cUz30X0f/Vapkus2+86vdEs3rr3lbv4geP1dWbM3bqmyek0Xmqcegd5 5noDTnvVmqsp4XIMbTz22y0GU3cS5w6fQ4T39m9IRWEN6O6UmvgUME9M/iMH1VUbmWgcvjRi+ BQrp8gbpmht+USgw7pZgvMxMSkWJ5sNhZKJFPcgeyvN3euJsn2kjafMguiw6JbNfpySgHoTsN kU+Zs22CaOItSj/aZ5FVfDqScf9RVKzLqe4yF0SHXlaX1dR2R2gMbAZ/kva1Vx3k5vDgUqq2k KeHTsE2iwOMsSul9qRgkn45Rz9ZeMm852FMjAJNuDpX6nGdt1vuzxuKvVUTGX3qzb2tFa8itj L76EzkatTGw3iE1ls9Ad7bCAIrsJCMExUDuNH2Zc/mYdBC1h7foHF0t1uhLtwB96bdnKMTgFm pEXA8nA9lIFlo5doBwvsfj4JyTI0DwkGjKwfz5mNLFmwKRtBtdJYV3mbb310icTJPskFlr68h dCkwrQbw X-Spam-Score: 3.6 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: >>> + (add-hook 'window-size-change-functions (debounce #'image-window-change 1) nil t) >>> + (add-hook 'window-state-change-functions (debounce #'image-window-change 1) nil t) >>> + (add-hook 'windo [...] Content analysis details: (3.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [46.125.249.73 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.15.15 listed in wl.mailspike.net] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (rudalics[at]gmx.at) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Debbugs-Envelope-To: 32672 Cc: 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.6 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: >>> + (add-hook 'window-size-change-functions (debounce #'image-window-change 1) nil t) >>> + (add-hook 'window-state-change-functions (debounce #'image-window-change 1) nil t) >>> + (add-hook 'windo [...] Content analysis details: (2.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [46.125.249.73 listed in zen.spamhaus.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.15.15 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (rudalics[at]gmx.at) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager >>> + (add-hook 'window-size-change-functions (debounce #'image-window-change 1) nil t) >>> + (add-hook 'window-state-change-functions (debounce #'image-window-change 1) nil t) >>> + (add-hook 'window-selection-change-functions (debounce #'image-window-change 1) nil t) Why do you add this to 'window-size-change-functions' and 'window-selection-change-functions' too? martin From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 28 18:43:56 2019 Received: (at 32672) by debbugs.gnu.org; 28 Nov 2019 23:43:56 +0000 Received: from localhost ([127.0.0.1]:59256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iaTRz-0005YN-Qm for submit@debbugs.gnu.org; Thu, 28 Nov 2019 18:43:56 -0500 Received: from fossa.birch.relay.mailchannels.net ([23.83.209.62]:16199) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iaTRr-0005Y1-0n for 32672@debbugs.gnu.org; Thu, 28 Nov 2019 18:43:47 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id AA3156A211F; Thu, 28 Nov 2019 23:43:45 +0000 (UTC) Received: from pdx1-sub0-mail-a33.g.dreamhost.com (100-96-45-206.trex.outbound.svc.cluster.local [100.96.45.206]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 3AE106A2000; Thu, 28 Nov 2019 23:43:45 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a33.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Thu, 28 Nov 2019 23:43:45 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Befitting-Attack: 18a2102e5c778426_1574984625516_2547977026 X-MC-Loop-Signature: 1574984625516:3784759663 X-MC-Ingress-Time: 1574984625516 Received: from pdx1-sub0-mail-a33.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a33.g.dreamhost.com (Postfix) with ESMTP id CDEF47FC61; Thu, 28 Nov 2019 15:43:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=Y8Kif+j/W7jtBhenC+M5H6EYUak=; b= GMJ6+ObVIgZyS9hfkdcmLWofAWBTeFJiAw2IDfQlKmTWIMgXObWP/d+wjjbEm+cY aB0jx2bgtAhrw0j/WOoIR5bePATw/if5M0b76TZ2Pwq1fdj2mCKwGddmXxLC5i/A O65n6ekU9TIQ+e31iQrTvPzEODsgmnQWYgU4dE9EfR8= Received: from mail.jurta.org (m91-129-96-42.cust.tele2.ee [91.129.96.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a33.g.dreamhost.com (Postfix) with ESMTPSA id 14CDD7FC60; Thu, 28 Nov 2019 15:43:35 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a33 From: Juri Linkov To: martin rudalics Subject: Re: bug#32672: 27.0.50; image resize on window resizing Organization: LINKOV.NET References: <87pnxmyjgt.fsf@mail.linkov.net> <87r2e3j1mp.fsf@mail.linkov.net> <878sqbfaqo.fsf@gnus.org> <87a78iyz8l.fsf@mail.linkov.net> <86cdbf31-91fc-4a67-dd80-f648d0734d4e@gmx.at> Date: Fri, 29 Nov 2019 00:50:14 +0200 In-Reply-To: <86cdbf31-91fc-4a67-dd80-f648d0734d4e@gmx.at> (martin rudalics's message of "Thu, 28 Nov 2019 10:20:32 +0100") Message-ID: <87o8wv62ft.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32672 Cc: Lars Ingebrigtsen , 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>> + (add-hook 'window-size-change-functions (debounce #'image-window-change 1) nil t) >>>> + (add-hook 'window-state-change-functions (debounce #'image-window-change 1) nil t) >>>> + (add-hook 'window-selection-change-functions (debounce #'image-window-change 1) nil t) > > Why do you add this to 'window-size-change-functions' and > 'window-selection-change-functions' too? Because it needs a call on window size changes and buffer switching. Or do you mean that window-state-change-functions covers these two? Then I'll try to remove them. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 29 04:24:27 2019 Received: (at 32672) by debbugs.gnu.org; 29 Nov 2019 09:24:27 +0000 Received: from localhost ([127.0.0.1]:59355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iacVn-0002sj-JW for submit@debbugs.gnu.org; Fri, 29 Nov 2019 04:24:27 -0500 Received: from mout.gmx.net ([212.227.17.22]:41487) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iacVl-0002sV-Vi for 32672@debbugs.gnu.org; Fri, 29 Nov 2019 04:24:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1575019454; bh=J8DX2Xond35ftupmSoNQUa/SUiBriqTWHzkCGJdVEnw=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=KwnFQvsndvkHUfZ3xG22JppM09dxNg2wEfcyorudsGJbbZzz7B+1otQlx9UiC4d3e A2HHg9KxW03EG2/u+DY6CTcZ/N/Xlr20mM9rLeItBoNTNsjlErWTz5MrqKa9UcW7D1 nwgYdFfoigdJiINffCfmd/wgotdhQYjWEtHXJXKA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.101] ([212.95.5.36]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M5QJJ-1ibzx50WAP-001Q3q; Fri, 29 Nov 2019 10:24:14 +0100 Subject: Re: bug#32672: 27.0.50; image resize on window resizing To: Juri Linkov References: <87pnxmyjgt.fsf@mail.linkov.net> <87r2e3j1mp.fsf@mail.linkov.net> <878sqbfaqo.fsf@gnus.org> <87a78iyz8l.fsf@mail.linkov.net> <86cdbf31-91fc-4a67-dd80-f648d0734d4e@gmx.at> <87o8wv62ft.fsf@mail.linkov.net> From: martin rudalics Message-ID: Date: Fri, 29 Nov 2019 10:24:15 +0100 MIME-Version: 1.0 In-Reply-To: <87o8wv62ft.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-AT Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:1vI4nZULspijjkbSkiLYXiKp+lY8mxz944vX6qFk1aNqmPc1XEx YxUDdZUvAqwgBJMkh1/ycUTvrmHp8vm3xjPyMN2u042gkcFAmqfR6dJndK2OCMbVKsNycLp RH6rHfxMVC1lqnkIkKE2pw/ky3PtTF1RK638TFSAu4Wga3oSldB4J83z6FJe6IDXPX5LI3t gonLvcEjH57PkJZ3xr9aw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Q5nvdE9ZxgA=:uPNgDhZhfYNFDlsE7MM1HE 7o/rfXXxp4D8iGHAqo2Rk40xLhkTG7s7BGD/9OUzOJQfjHkCxzZ3K04y2dlKQluk7nZOWCzOK WBiJWQQpWVvelFJhS9vOSnpB7HvA6m/v7RocbGbwCoUKTDLA9gzyMy4alcIzT+lcMQ1Kwlbn0 YBdRgQ4ICBI7KUHMSHjt8UKY01Z7e/MOTHc5TGuE2JjT8kK0YvRd2mWETvsGCPTvrvpJ2W8fS TEiScMP6w2uMxVNpnrkkCaZk1+0XJnoHpmSVK3N3IdIH1TiuQoxZRW5p0vNnoHIVGTgIdFFM9 d3LrG3kVRfcXOFV5JoOoJvRZ7XQ98OTf6TSATWGA3JUq3STdQN4aBQAkeeKSx+u6prxV+1OSJ Vy9319qyBNavuXmyjB5FFBIzO+LjT3ibHfMLVxhnH3hTA6Z88uBhla/4/II6kvNyd9VMjqjqZ qxRfEQPpXkT0NFlD/b09XG5++5zBnYU1TFGa+7ZMW7dhqROGNZW1VmPmWD+Ts7YTDZaDujrZX XejD6pltU+FSCpuTZaOh0lmQcF+YdRE4OUrxXhpzjk5A4Wk5PIkYP4spKi6UEl427hh0VBQEm ts0FOB6Qa1n419pkZb+dxPR3lv8GTpBe3B+8cVV9lvSeQwtMsB9t5//RFCBn3w+W6KHuQo/eB 1jdtKwzf0VShDWmUgbZKoiSj9EgaS1W05OTsHM+E8isatvlu3IX04ZBguw4ysy+oTWVi0N062 dCuEt+uGUElTeJTReLMk0/GoTlcpHLeA8ohINVP/F6UgWi2gn/AjLxGXA/qQRinZ/sGBfTt5f BgstrX3famexJxFJn2myi3IEyverIJuPqByr+pQLge33wDFtu/9hh36gAj72ab2oGKmz9lHTy zn8ErK3nzlv/jOForDWY6WuXQDU0eu9xGQw55OswGicP8fRaPGvBvqP5QCj0QhpcwVrD20h5A aLyP9YYnSnJb6GGGwVk+Bo+5cZOIbe9joudsB5BWs8zEH5lv3WERPCOXnkfmS4kN+iaRapfLM EuOZYl0aAk7zF3uDO2nz78rhU+fdTDxhDrtlD9ydKAfeLnvAwhZjMr4YJGi/PF9fgjlidVYt5 HZfALX+J+HE1JjsAYpnqxJBN+WGR/nm0ImSLTO1iEILQ8Nco8Jyl5z4IQHr069qj8KuoIEQ8Y 1MAEfq6d6DGa7czMuGTr+gigs5MM7DzRWaOx9Paur2M13uSorpfv3Q98yKHELB/iAtHAVNVEF f0mJ7NkWM2p3F8d+gdVGtg1t945Zfu8jRJ5z8iSXsVkR6gOOdjZAPt+ivxJM= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32672 Cc: Lars Ingebrigtsen , 32672@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> Why do you add this to 'window-size-change-functions' and >> 'window-selection-change-functions' too? > > Because it needs a call on window size changes and buffer switching. > Or do you mean that window-state-change-functions covers these two? Yes. > Then I'll try to remove them. Please do that. Thanks, martin From unknown Sat Jun 14 04:54:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 27 Dec 2019 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator