From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#38187: 27.0.50; No mouse-wheel scaling on images Date: Fri, 22 Nov 2019 10:33:00 +0000 Message-ID: <20191122103300.GA4888@breton.holly.idiocy.org> References: <87a78u7ags.fsf@gnus.org> <878soemc79.fsf@marxist.se> <87mucut8ch.fsf@mail.linkov.net> <87ftilsg6q.fsf@gnus.org> <87r224sw6s.fsf@mail.linkov.net> <83ftik35kw.fsf@gnu.org> <87pnhmm9ui.fsf@mail.linkov.net> <87blt4x6nt.fsf@gnus.org> <20191122095008.GA96578@breton.holly.idiocy.org> <83a78ow7jy.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="222715"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.12.0 (2019-05-25) Cc: larsi@gnus.org, stefan@marxist.se, 38187@debbugs.gnu.org, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 22 11:34:17 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iY6GW-000vk2-2h for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Nov 2019 11:34:16 +0100 Original-Received: from localhost ([::1]:49208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iY6GU-0001vj-7P for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Nov 2019 05:34:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60816) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iY6GM-0001s2-76 for bug-gnu-emacs@gnu.org; Fri, 22 Nov 2019 05:34:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iY6GL-0005BM-0Q for bug-gnu-emacs@gnu.org; Fri, 22 Nov 2019 05:34:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44992) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iY6GK-0005BA-SG for bug-gnu-emacs@gnu.org; Fri, 22 Nov 2019 05:34:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iY6GH-0003yk-O8 for bug-gnu-emacs@gnu.org; Fri, 22 Nov 2019 05:34:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Nov 2019 10:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38187 X-GNU-PR-Package: emacs Original-Received: via spool by 38187-submit@debbugs.gnu.org id=B38187.157441879615238 (code B ref 38187); Fri, 22 Nov 2019 10:34:01 +0000 Original-Received: (at 38187) by debbugs.gnu.org; 22 Nov 2019 10:33:16 +0000 Original-Received: from localhost ([127.0.0.1]:53813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iY6FU-0003xe-NQ for submit@debbugs.gnu.org; Fri, 22 Nov 2019 05:33:16 -0500 Original-Received: from mail-wm1-f44.google.com ([209.85.128.44]:36980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iY6FS-0003xR-T2 for 38187@debbugs.gnu.org; Fri, 22 Nov 2019 05:33:11 -0500 Original-Received: by mail-wm1-f44.google.com with SMTP id f129so5642062wmf.2 for <38187@debbugs.gnu.org>; Fri, 22 Nov 2019 02:33:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=U7H5YYkzu/QH3GcPOBbIVJpmI7XQVwtOKu/iIJSbq8s=; b=AT8ZgBXLBc4Yx9LhjVEesq6Sn+nfxNMt6D7sm0zpGBbsptPxoXg9DoJqKc4DNej2jx T6HqLAPP8eIvY6oyAnxxoKFFeP7BOHqg5+iFcKt/mQNuotnqj+AtvaOyKB2Z0IpxxBTl w4QxQ7YGWlElziB2UssQgA+UgKUzLpF5mBwesXSZuXvuhD8Xrjjy9k7tnQa95Z3xy0Bl 60nOviw99yha48Si72MNCizsFVrHidfJeM0TsBqeWs9S2LlmMv40qSJfgdpcZJ6JSO48 NJQRYhit6ptGCQe4grIMjwxCqFjGzOjq9BV7x1eCbLzWrOCbEyM053QkyfuESHGHUEz1 wjvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=U7H5YYkzu/QH3GcPOBbIVJpmI7XQVwtOKu/iIJSbq8s=; b=N0yTPf8IWa+lCkJofSID3hH2nviUNOqPRNddCMf02Jn75q3aZtKZHny2a9U2qyba3B W2D02L9OmoYjaDJ4x/Acg5XFqEbgRY2kL0rBIesTBWRx6r9t3n7eGbD1CUMcRESy39yD mQ18/AbltU7oQRV4EVMkRoMl5Uug8+ERtGKyDDfOBQTCLLczjLD6tbjccVD1Nsvbs4x8 8W98w86n/9EdRVkhyTNclHOYpmDOWf0U76g+KVB8ZCh8Qp1V/MMUIWvBh1G1IvYjLE/K FqRThLV81N83/EVOzYUZ3H6HofqkK1PtT6r9Znjo54Qxt8kkfxiE+3LRHOd2Ao1rCWFj OmEQ== X-Gm-Message-State: APjAAAWhYFWx9hLe1hui8KDavPNsC2M0epYEWp4j4VxhrnP+avfqZIL4 t07n+viCxANC7PZKI23Upcg= X-Google-Smtp-Source: APXvYqy/zz1eb+pH4A6NqkVqHCN2Gb5dEUI0RHGUH1ypIR7LUS9GY6FBl1424atDriarhU+/fYQ7Jg== X-Received: by 2002:a1c:3b08:: with SMTP id i8mr15285771wma.56.1574418784653; Fri, 22 Nov 2019 02:33:04 -0800 (PST) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-1980-cc6a-4f4e-9c42.holly.idiocy.org. [2001:8b0:3f8:8129:1980:cc6a:4f4e:9c42]) by smtp.gmail.com with ESMTPSA id d16sm5402906wrg.27.2019.11.22.02.33.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Nov 2019 02:33:03 -0800 (PST) Content-Disposition: inline In-Reply-To: <83a78ow7jy.fsf@gnu.org> 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: 209.51.188.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:172217 Archived-At: On Fri, Nov 22, 2019 at 12:04:49PM +0200, Eli Zaretskii wrote: > > Date: Fri, 22 Nov 2019 09:50:08 +0000 > > From: Alan Third > > Cc: 38187@debbugs.gnu.org, stefan@marxist.se, Juri Linkov > > > > It would be nice if Emacs was able to reuse the actual image data > > where the only difference is scaling or rotation. > > I think we found that too complicated at the time. Yes, and I’m not sure the pay‐off would be worth it as it really only makes a big difference in situations like these where an image is being scaled repeatedly. But we can consider it a wishlist item. ;) > > A simple ‘solution’ to the mousewheel scaling issue would be to > > explicitly flush the old image from the cache on each change. I think > > that’s what image mode does when you zoom. > > image-mode can do that when it knows the scaled image will replace the > previous one, yes. (We will need to add an API for that, I think.) > But that's not cache eviction, that's application being smarter about > the "garbage" it produces. Actually, now I look at the code, when an image is resized using the mousewheel the previous image should already be flushed. In image.el we have this function: (defun image--get-imagemagick-and-warn () (unless (or (fboundp 'imagemagick-types) (image-transforms-p)) (error "Cannot rescale images on this terminal")) (let ((image (image--get-image))) (image-flush image) ;;; <<--------------- (when (and (fboundp 'imagemagick-types) (not (image-transforms-p))) (plist-put (cdr image) :type 'imagemagick)) image)) which is called every time an image is resized. So perhaps I misunderstand what image-flush does, or we do have a memory leak? -- Alan Third