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: Thu, 13 Sep 2018 02:18:38 +0300 Organization: LINKOV.NET Message-ID: <871s9ycnjl.fsf@mail.linkov.net> References: <87pnxmyjgt.fsf@mail.linkov.net> <87ftyfoakb.fsf@mail.linkov.net> <5B98B33D.7000605@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1536794467 29240 195.159.176.226 (12 Sep 2018 23:21:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 12 Sep 2018 23:21:07 +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 Thu Sep 13 01:21:02 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 1g0ERR-0007Tk-F4 for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Sep 2018 01:21:01 +0200 Original-Received: from localhost ([::1]:38908 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0ETX-0000ig-TQ for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Sep 2018 19:23:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0ETS-0000ib-52 for bug-gnu-emacs@gnu.org; Wed, 12 Sep 2018 19:23:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g0ETP-0002Xd-1G for bug-gnu-emacs@gnu.org; Wed, 12 Sep 2018 19:23:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34293) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g0ETO-0002XK-IN for bug-gnu-emacs@gnu.org; Wed, 12 Sep 2018 19:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g0ETO-0004fc-8C for bug-gnu-emacs@gnu.org; Wed, 12 Sep 2018 19:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Sep 2018 23:23:02 +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.153679456117908 (code B ref 32672); Wed, 12 Sep 2018 23:23:02 +0000 Original-Received: (at 32672) by debbugs.gnu.org; 12 Sep 2018 23:22:41 +0000 Original-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 Original-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 Original-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= Original-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) In-Reply-To: <5B98B33D.7000605@gmx.at> (martin rudalics's message of "Wed, 12 Sep 2018 08:33:33 +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:150269 Archived-At: >> 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.