From b4ac6e8c18a2298079fef99a73e3cca63725853b Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 7 Feb 2012 19:45:27 -0800 Subject: [PATCH] Comment out the unimplemented image-transform-mode * lisp/image-mode.el (image-transform-minor-mode-map, image-transform-mode): Comment out (does nothing). * etc/NEWS: Related edits. * lisp/image.el: Comment. --- etc/NEWS | 10 ++++++++-- lisp/ChangeLog | 3 +++ lisp/image-mode.el | 40 ++++++++++++++++++++++------------------ lisp/image.el | 2 ++ 4 files changed, 35 insertions(+), 20 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 68922657567..9cf5b87b290 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1386,14 +1386,20 @@ is being animated. The old name is an obsolete alias to the new one. +++ -*** Emacs can be compiled with ImageMagick support. -This feature is not available for the Nextstep or MS ports. +*** Image mode can view any image type that ImageMagick supports. +This requires Emacs to be built with ImageMagick support. Then the function `imagemagick-types' returns a list of image file extensions that your installation of ImageMagick supports. The function `imagemagick-register-types' enables ImageMagick support for these image types, minus those listed in `imagemagick-types-inhibit'. Visiting one of these file types will then use Image mode. +--- +*** New commands to resize and rotate images in Image mode. +These require Emacs to be built with ImageMagick support. +image-transform-fit-to-height, image-transform-fit-to-width, +image-transform-set-rotation, image-transform-set-scale. + ** XML and HTML parsing If Emacs is compiled with libxml2 support, there are two new functions: `libxml-parse-html-region' (which parses "real world" HTML) and diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 40baf0df4b9..e8ed552ba07 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-02-08 Glenn Morris + * image-mode.el (image-transform-minor-mode-map, image-transform-mode): + Comment out (does nothing). + * completion.el (dynamic-completion-mode): * dirtrack.el (dirtrack-debug-mode): * electric.el (electric-layout-mode): diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 63241f4fe7e..900cd725b92 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -607,24 +607,27 @@ Otherwise it plays once, then stops." (image-toggle-display)))) -(defvar image-transform-minor-mode-map - (let ((map (make-sparse-keymap))) - ;; (define-key map [(control ?+)] 'image-scale-in) - ;; (define-key map [(control ?-)] 'image-scale-out) - ;; (define-key map [(control ?=)] 'image-scale-none) - ;; (define-key map "c f h" 'image-scale-fit-height) - ;; (define-key map "c ]" 'image-rotate-right) - map) - "Minor mode keymap `image-transform-mode'.") - -(define-minor-mode image-transform-mode - "Minor mode for scaling and rotating images. -With a prefix argument ARG, enable the mode if ARG is positive, -and disable it otherwise. If called from Lisp, enable the mode -if ARG is omitted or nil. This minor mode requires Emacs to have -been compiled with ImageMagick support." - nil "image-transform" image-transform-minor-mode-map) - +;; Not yet implemented. +;;; (defvar image-transform-minor-mode-map +;;; (let ((map (make-sparse-keymap))) +;;; ;; (define-key map [(control ?+)] 'image-scale-in) +;;; ;; (define-key map [(control ?-)] 'image-scale-out) +;;; ;; (define-key map [(control ?=)] 'image-scale-none) +;;; ;; (define-key map "c f h" 'image-scale-fit-height) +;;; ;; (define-key map "c ]" 'image-rotate-right) +;;; map) +;;; "Minor mode keymap `image-transform-mode'.") +;;; +;;; (define-minor-mode image-transform-mode +;;; "Minor mode for scaling and rotating images. +;;; With a prefix argument ARG, enable the mode if ARG is positive, +;;; and disable it otherwise. If called from Lisp, enable the mode +;;; if ARG is omitted or nil. This minor mode requires Emacs to have +;;; been compiled with ImageMagick support." +;;; nil "image-transform" image-transform-minor-mode-map) + + +;; FIXME this doesn't seem mature yet. Document in manual when it is. (defvar image-transform-resize nil "The image resize operation. Its value should be one of the following: @@ -666,6 +669,7 @@ compiled with ImageMagick support." ,@(if (not (equal 0.0 image-transform-rotation)) (list :rotation image-transform-rotation)))))) +;; FIXME 2 works, but eg 1.9 or 0.5 don't? (defun image-transform-set-scale (scale) "Prompt for a number, and resize the current image by that amount. This command has no effect unless Emacs is compiled with diff --git a/lisp/image.el b/lisp/image.el index 8c52db149a0..ab3f437a971 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -207,6 +207,8 @@ compatibility with versions of Emacs that lack the variable (delete image-directory (copy-sequence (or path load-path)))))) +;; Used to be in image-type-header-regexps, but now not used anywhere +;; (since 2009-08-28). (defun image-jpeg-p (data) "Value is non-nil if DATA, a string, consists of JFIF image data. We accept the tag Exif because that is the same format." -- 2.39.2