From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#32672: 27.0.50; image resize on window resizing Date: Sun, 23 Sep 2018 23:39:56 +0300 Organization: LINKOV.NET Message-ID: <87va6wt79n.fsf@mail.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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1537736565 24196 195.159.176.226 (23 Sep 2018 21:02:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 23 Sep 2018 21:02:45 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 32672@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 23 23:02:41 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4BWZ-0006BP-GH for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Sep 2018 23:02:39 +0200 Original-Received: from localhost ([::1]:42540 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4BYg-0001nV-37 for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Sep 2018 17:04:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4BY1-0001V6-So for bug-gnu-emacs@gnu.org; Sun, 23 Sep 2018 17:04:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4BXx-0004Wv-F4 for bug-gnu-emacs@gnu.org; Sun, 23 Sep 2018 17:04:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46899) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g4BXt-0004WD-T3 for bug-gnu-emacs@gnu.org; Sun, 23 Sep 2018 17:04:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g4BXt-00088O-KG for bug-gnu-emacs@gnu.org; Sun, 23 Sep 2018 17:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Sep 2018 21:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32672 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32672-submit@debbugs.gnu.org id=B32672.153773658431179 (code B ref 32672); Sun, 23 Sep 2018 21:04:01 +0000 Original-Received: (at 32672) by debbugs.gnu.org; 23 Sep 2018 21:03:04 +0000 Original-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 Original-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 Original-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= Original-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 In-Reply-To: <5BA74E3D.5030903@gmx.at> (martin rudalics's message of "Sun, 23 Sep 2018 10:26:37 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:150578 Archived-At: > 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.