From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#41222: 27.1; Auto-resizing of images in image-mode Date: Thu, 21 May 2020 01:23:47 +0300 Organization: LINKOV.NET Message-ID: <87sgfus0ss.fsf@mail.linkov.net> References: <87tv0kkbkl.fsf@mail.linkov.net> <20200514204615.GC50681@breton.holly.idiocy.org> <87pnb688y4.fsf@mail.linkov.net> <20200515062834.GB52382@breton.holly.idiocy.org> <87wo575yx7.fsf@mail.linkov.net> <20200520201845.GA59177@breton.holly.idiocy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="96381"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 41222@debbugs.gnu.org To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 21 00:41:13 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jbXOj-000OzP-3t for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 May 2020 00:41:13 +0200 Original-Received: from localhost ([::1]:57198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbXOi-0004q8-6W for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 May 2020 18:41:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbXOY-0004oN-FU for bug-gnu-emacs@gnu.org; Wed, 20 May 2020 18:41:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43077) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jbXOY-0004Sk-5k for bug-gnu-emacs@gnu.org; Wed, 20 May 2020 18:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jbXOY-0007SO-3h for bug-gnu-emacs@gnu.org; Wed, 20 May 2020 18:41: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, 20 May 2020 22:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41222 X-GNU-PR-Package: emacs Original-Received: via spool by 41222-submit@debbugs.gnu.org id=B41222.159001441128569 (code B ref 41222); Wed, 20 May 2020 22:41:02 +0000 Original-Received: (at 41222) by debbugs.gnu.org; 20 May 2020 22:40:11 +0000 Original-Received: from localhost ([127.0.0.1]:54618 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jbXNT-0007Pv-VU for submit@debbugs.gnu.org; Wed, 20 May 2020 18:40:10 -0400 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:46507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jbXNR-0007Pd-09 for 41222@debbugs.gnu.org; Wed, 20 May 2020 18:39:54 -0400 X-Originating-IP: 91.129.97.200 Original-Received: from mail.gandi.net (m91-129-97-200.cust.tele2.ee [91.129.97.200]) (Authenticated sender: juri@linkov.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 9763460002; Wed, 20 May 2020 22:39:45 +0000 (UTC) In-Reply-To: <20200520201845.GA59177@breton.holly.idiocy.org> (Alan Third's message of "Wed, 20 May 2020 22:18:47 +0200 (CEST)") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:180692 Archived-At: >> One possible change is: >> >> "Original Size" >> "Reset to Default Size" >> >> But when using "Actual Size" instead of "Original Size", >> what would be a good title for the second menu item? > > I think "Default Size" size works in either case. I feel that Default > strongly implies it will return to whatever size it would be when I > first load the image, and that also clarifies what the other option > will do. I added both variants “Original/Actual” and “Default/Initial” to menu title/help, and docstrings. More tweaking is possible, but it seems this is quite good now. Eli, is it ok to install this finishing patch to emacs-27? diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 480b2e6b26..b82c066918 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -456,6 +456,7 @@ image-mode-map (define-key map "sb" 'image-transform-fit-both) (define-key map "ss" 'image-transform-set-scale) (define-key map "sr" 'image-transform-set-rotation) + (define-key map "so" 'image-transform-original) (define-key map "s0" 'image-transform-reset) ;; Multi-frame keys @@ -521,8 +522,10 @@ image-mode-map :help "Rotate the image"] ["Set Rotation..." image-transform-set-rotation :help "Set rotation angle of the image"] - ["Reset Transformations" image-transform-reset - :help "Reset all image transformations"] + ["Original Size" image-transform-original + :help "Reset image to actual size"] + ["Reset to Default Size" image-transform-reset + :help "Reset all image transformations to initial size"] "--" ["Show Thumbnails" (lambda () @@ -1382,8 +1385,15 @@ image-transform-set-rotation (setq image-transform-rotation (float (mod rotation 360))) (image-toggle-display-image)) +(defun image-transform-original () + "Display the current image with the original (actual) size and rotation." + (interactive) + (setq image-transform-resize nil + image-transform-scale 1) + (image-toggle-display-image)) + (defun image-transform-reset () - "Display the current image with the default size and rotation." + "Display the current image with the default (initial) size and rotation." (interactive) (setq image-transform-resize image-auto-resize image-transform-rotation 0.0