emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-27 c43e5ed: * lisp/image-mode.el (image-transform-original): New c


From: Juri Linkov
Subject: emacs-27 c43e5ed: * lisp/image-mode.el (image-transform-original): New command (bug#41222).
Date: Sun, 7 Jun 2020 20:30:35 -0400 (EDT)

branch: emacs-27
commit c43e5ed60d93bbe3f5f3936ccce6e77409cd6140
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/image-mode.el (image-transform-original): New command (bug#41222).
    
    (image-mode-map): Bind it to "so" and add to menu.
---
 lisp/image-mode.el | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 480b2e6..b82c066 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]