GNU bug report logs -
#18683
Patch for wish-list item: 560
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Hello,
Attached is a simple patch that adds {+-}90 degree rotation to image
mode as requested in [1].
Any comments welcome.
[1]: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=560
2014-10-10 Matthew Leach <matthew <at> mattleach.net>
* image-mode.el (image-mode-map): map 'r' and 'l' to rotation
functions.
(image-rotate-90-right): New method.
(image-rotate-90-left):
[img-90-rotation.patch (text/x-diff, inline)]
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index b94162d..de75f4a 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -375,6 +375,8 @@ call."
(define-key map "f" 'image-next-frame)
(define-key map "b" 'image-previous-frame)
(define-key map "n" 'image-next-file)
+ (define-key map "r" 'image-rotate-90-right)
+ (define-key map "l" 'image-rotate-90-left)
(define-key map "p" 'image-previous-file)
(define-key map "a+" 'image-increase-speed)
(define-key map "a-" 'image-decrease-speed)
@@ -1106,6 +1108,16 @@ Emacs is compiled with ImageMagick support."
(setq image-transform-rotation (float (mod rotation 360)))
(image-toggle-display-image))
+(defun image-rotate-90-right ()
+ "Increase the rotation of the current image by 90 degrees."
+ (interactive)
+ (image-transform-set-rotation (+ image-transform-rotation 90)))
+
+(defun image-rotate-90-left ()
+ "Decrease the rotation of the current image by 90 degrees."
+ (interactive)
+ (image-transform-set-rotation (- image-transform-rotation 90)))
+
(defun image-transform-reset ()
"Display the current image with the default size and rotation.
This command has no effect unless Emacs is compiled with
[Message part 3 (text/plain, inline)]
--
Matt
This bug report was last modified 7 years and 35 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.