From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matthew Leach Newsgroups: gmane.emacs.bugs Subject: bug#18683: Patch for wish-list item: 560 Date: Fri, 10 Oct 2014 23:58:44 +0100 Message-ID: <87wq87ttuj.fsf@matt-desktop.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1412982085 23148 80.91.229.3 (10 Oct 2014 23:01:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Oct 2014 23:01:25 +0000 (UTC) To: 18683@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 11 01:01:19 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XcjBV-00052Q-SM for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Oct 2014 01:01:18 +0200 Original-Received: from localhost ([::1]:51486 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcjBV-0000Me-J6 for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Oct 2014 19:01:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcjBM-0000MW-9L for bug-gnu-emacs@gnu.org; Fri, 10 Oct 2014 19:01:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XcjBG-0000Lz-By for bug-gnu-emacs@gnu.org; Fri, 10 Oct 2014 19:01:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48950) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcjBG-0000Lv-8t for bug-gnu-emacs@gnu.org; Fri, 10 Oct 2014 19:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XcjBF-0003aG-TB for bug-gnu-emacs@gnu.org; Fri, 10 Oct 2014 19:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matthew Leach Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Oct 2014 23:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18683 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.141298205313753 (code B ref -1); Fri, 10 Oct 2014 23:01:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Oct 2014 23:00:53 +0000 Original-Received: from localhost ([127.0.0.1]:40514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XcjB7-0003Zl-1T for submit@debbugs.gnu.org; Fri, 10 Oct 2014 19:00:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55730) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XcjB5-0003Zd-FF for submit@debbugs.gnu.org; Fri, 10 Oct 2014 19:00:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XcjAz-0000Kt-A8 for submit@debbugs.gnu.org; Fri, 10 Oct 2014 19:00:51 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:56586) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcjAz-0000Kp-6t for submit@debbugs.gnu.org; Fri, 10 Oct 2014 19:00:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcjAt-0000MC-QL for bug-gnu-emacs@gnu.org; Fri, 10 Oct 2014 19:00:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XcjAo-0000J3-7s for bug-gnu-emacs@gnu.org; Fri, 10 Oct 2014 19:00:39 -0400 Original-Received: from mx0.mattleach.net ([176.58.118.143]:47298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcjAo-0000Ih-1O for bug-gnu-emacs@gnu.org; Fri, 10 Oct 2014 19:00:34 -0400 Original-Received: by mx0.mattleach.net (Postfix, from userid 99) id 27A9761C96; Sat, 11 Oct 2014 00:00:32 +0100 (BST) Original-Received: from matt-desktop.home.mattleach.net (host86-151-46-58.range86-151.btcentralplus.com [86.151.46.58]) by mx0.mattleach.net (Postfix) with ESMTPSA id 9938461C7E for ; Sat, 11 Oct 2014 00:00:27 +0100 (BST) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:94396 --=-=-= Content-Type: text/plain 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 * image-mode.el (image-mode-map): map 'r' and 'l' to rotation functions. (image-rotate-90-right): New method. (image-rotate-90-left): --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=img-90-rotation.patch 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 --=-=-= Content-Type: text/plain -- Matt --=-=-=--