From: Juri Linkov Date: Mon, 8 Jun 2020 00:30:27 +0000 (+0300) Subject: * lisp/image-mode.el (image-transform-original): New command (bug#41222). X-Git-Tag: emacs-27.1-rc1~74 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c43e5ed60d93bbe3f5f3936ccce6e77409cd6140;p=emacs.git * lisp/image-mode.el (image-transform-original): New command (bug#41222). (image-mode-map): Bind it to "so" and add to menu. --- diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 480b2e6b26e..b82c0669187 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -456,6 +456,7 @@ call." (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 @@ call." :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 @@ ROTATION should be in degrees." (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