From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#32672: 27.0.50; image resize on window resizing Date: Mon, 24 Sep 2018 10:22:45 +0200 Message-ID: <5BA89ED5.4050207@gmx.at> References: <87pnxmyjgt.fsf@mail.linkov.net> <87ftyfoakb.fsf@mail.linkov.net> <5B98B33D.7000605@gmx.at> <871s9ycnjl.fsf@mail.linkov.net> <5B9A15DA.5000403@gmx.at> <87efdxnfww.fsf@mail.linkov.net> <5B9B7253.5060808@gmx.at> <87pnxexr2m.fsf@mail.linkov.net> <5B9E1E0E.7070805@gmx.at> <87h8ip2eby.fsf@mail.linkov.net> <5B9F4DBD.5020009@gmx.at> <877ejjzr9s.fsf@mail.linkov.net> <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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1537777335 15529 195.159.176.226 (24 Sep 2018 08:22:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 24 Sep 2018 08:22:15 +0000 (UTC) Cc: 32672@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 24 10:22:10 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 1g4M89-0003uT-Te for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Sep 2018 10:22:10 +0200 Original-Received: from localhost ([::1]:44024 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4MAG-0003nH-D2 for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Sep 2018 04:24:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4MA2-0003md-3a for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2018 04:24:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4M9y-0007CF-3y for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2018 04:24:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47026) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g4M9x-0007Bp-UU for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2018 04:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g4M9x-0001bq-N1 for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2018 04:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Sep 2018 08:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32672 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32672-submit@debbugs.gnu.org id=B32672.15377773816069 (code B ref 32672); Mon, 24 Sep 2018 08:24:01 +0000 Original-Received: (at 32672) by debbugs.gnu.org; 24 Sep 2018 08:23:01 +0000 Original-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 Original-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 Original-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 In-Reply-To: <87va6wt79n.fsf@mail.linkov.net> 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+XTyoxiJeaLwUcHk1dkElabniyF3VaVSigeQCu7iznma1mKpvtt2EGsQVM 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:150585 Archived-At: > 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