summaryrefslogtreecommitdiff
path: root/lisp/image-mode.el
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen <larsi@gnus.org>2014-08-12 16:16:45 +0200
committerLars Magne Ingebrigtsen <larsi@gnus.org>2014-08-12 16:16:45 +0200
commit9e6adaec872fb8274619ae117213431c4ff300f2 (patch)
tree8c20502571479e465837a0784f8a7541f2e1fb42 /lisp/image-mode.el
parentbd4de70f13a92230da479e6fcd87d4355d626edf (diff)
downloademacs-9e6adaec872fb8274619ae117213431c4ff300f2.tar.gz
emacs-9e6adaec872fb8274619ae117213431c4ff300f2.tar.bz2
emacs-9e6adaec872fb8274619ae117213431c4ff300f2.zip
Allow resetting image transform options
* image-mode.el (image-transform-reset): New command and menu item. (image-mode-map): Rearrange the menu items to put presumably more obscure items at the end.
Diffstat (limited to 'lisp/image-mode.el')
-rw-r--r--lisp/image-mode.el18
1 files changed, 16 insertions, 2 deletions
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 76a64220413..492ac10d706 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -379,8 +379,6 @@ call."
["Show as Text" image-toggle-display :active t
:help "Show image as text"]
"--"
- ["Fit Frame to Image" image-mode-fit-frame :active t
- :help "Resize frame to match image"]
["Fit to Window Height" image-transform-fit-to-height
:visible (eq image-type 'imagemagick)
:help "Resize image to match the window height"]
@@ -390,6 +388,9 @@ call."
["Rotate Image..." image-transform-set-rotation
:visible (eq image-type 'imagemagick)
:help "Rotate the image"]
+ ["Reset Transformations" image-transform-reset
+ :visible (eq image-type 'imagemagick)
+ :help "Reset all image transformations"]
"--"
["Show Thumbnails"
(lambda ()
@@ -402,6 +403,9 @@ call."
["Previous Image" image-previous-file :active buffer-file-name
:help "Move to previous image in this directory"]
"--"
+ ["Fit Frame to Image" image-mode-fit-frame :active t
+ :help "Resize frame to match image"]
+ "--"
["Animate Image" image-toggle-animation :style toggle
:selected (let ((image (image-get-display-property)))
(and image (image-animate-timer image)))
@@ -1097,6 +1101,16 @@ Emacs is compiled with ImageMagick support."
(setq image-transform-rotation (float (mod rotation 360)))
(image-toggle-display-image))
+(defun image-transform-reset ()
+ "Display the current image with the default size and rotation.
+This command has no effect unless Emacs is compiled with
+ImageMagick support."
+ (interactive)
+ (setq image-transform-resize nil
+ image-transform-rotation 0.0
+ image-transform-scale 1)
+ (image-toggle-display-image))
+
(provide 'image-mode)
;;; image-mode.el ends here