From 37fe0cd3580f7998bd407d9a089c8c899011f8ae Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 14 Sep 2022 15:34:38 +0200 Subject: [PATCH] Rename image transform commands to be less confusing * lisp/image-mode.el (image-transform-original): Rename from this... (image-transform-reset-to-original): ...to this. Make old name into an obsolete function alias and update all callers. (image-transform-reset): Rename from this... (image-transform-reset-to-initial): ...to this. Make old name into an obsolete function alias and update all callers. (Bug#51451) * doc/emacs/files.texi (Image Mode): Update for above change. --- doc/emacs/files.texi | 10 +++++----- etc/NEWS | 8 ++++++++ lisp/image-mode.el | 15 +++++++++------ lisp/image/image-dired.el | 4 ++-- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 7f87e21a98c..744b848335e 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -2272,16 +2272,16 @@ behavior by using the options @code{image-auto-resize} and @findex image-transform-fit-to-window @findex image-transform-set-percent @findex image-transform-set-scale -@findex image-transform-reset +@findex image-transform-reset-to-initial To resize the image manually you can use the command @code{image-transform-fit-to-window} bound to @kbd{s w} that fits the image to both the window height and width. To scale the image to a percentage of its original size, use the command -@code{image-transform-set-percent} bound to @kbd{s p}. To scale -the image specifying a scale factor, use the command +@code{image-transform-set-percent} bound to @kbd{s p}. To scale the +image specifying a scale factor, use the command @code{image-transform-set-scale} bound to @kbd{s s}. To reset all -transformations to the initial state, use @code{image-transform-reset} -bound to @kbd{s 0}. +transformations to the initial state, use +@code{image-transform-reset-to-initial} bound to @kbd{s 0}. @findex image-next-file @findex image-previous-file diff --git a/etc/NEWS b/etc/NEWS index a5292799948..4c417151456 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1988,6 +1988,14 @@ These commands horizontally and vertically flip the image under point. It allows setting the image size to a percentage of its original size, and is bound to "s p" in Image mode. ++++ +*** 'image-transform-original' renamed to 'image-transform-reset-to-original'. +The old name was confusing, and is now an obsolete function alias. + ++++ +*** 'image-transform-reset' renamed to 'image-transform-reset-to-initial'. +The old name was confusing, and is now an obsolete function alias. + ** Images +++ diff --git a/lisp/image-mode.el b/lisp/image-mode.el index f2ffbd89447..dded6d4f389 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -499,8 +499,8 @@ image as text, when opening such images in `image-mode'." "s s" #'image-transform-set-scale "s r" #'image-transform-set-rotation "s m" #'image-transform-set-smoothing - "s o" #'image-transform-original - "s 0" #'image-transform-reset + "s o" #'image-transform-reset-to-original + "s 0" #'image-transform-reset-to-initial ;; Multi-frame keys "RET" #'image-toggle-animation @@ -571,9 +571,9 @@ image as text, when opening such images in `image-mode'." :help "Set rotation angle of the image"] ["Set Smoothing..." image-transform-set-smoothing :help "Toggle smoothing"] - ["Original Size" image-transform-original + ["Original Size" image-transform-reset-to-original :help "Reset image to actual size"] - ["Reset to Default Size" image-transform-reset + ["Reset to Default Size" image-transform-reset-to-initial :help "Reset all image transformations to initial size"] "--" ["Show Thumbnails" @@ -1608,14 +1608,14 @@ ROTATION should be in degrees." (setq image--transform-smoothing smoothing) (image-toggle-display-image)) -(defun image-transform-original () +(defun image-transform-reset-to-original () "Display the current image with the original (actual) size and rotation." (interactive nil image-mode) (setq image-transform-resize nil image-transform-scale 1) (image-toggle-display-image)) -(defun image-transform-reset () +(defun image-transform-reset-to-initial () "Display the current image with the default (initial) size and rotation." (interactive nil image-mode) (setq image-transform-resize image-auto-resize @@ -1624,6 +1624,9 @@ ROTATION should be in degrees." image--transform-smoothing nil) (image-toggle-display-image)) +(define-obsolete-function-alias 'image-transform-original #'image-transform-reset-to-original "29.1") +(define-obsolete-function-alias 'image-transform-reset #'image-transform-reset-to-initial "29.1") + (provide 'image-mode) ;;; image-mode.el ends here diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index ff10be2ab4b..75dcdd8cbc2 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -1508,14 +1508,14 @@ Dired." (defun image-dired-display-current-image-full () "Display current image in full size." - (declare (obsolete image-transform-original "29.1")) + (declare (obsolete image-transform-reset-to-original "29.1")) (interactive nil image-dired-thumbnail-mode) (let ((file (image-dired-original-file-name))) (if file (progn (image-dired-display-image file) (with-current-buffer image-dired-display-image-buffer - (image-transform-original))) + (image-transform-reset-to-original))) (error "No original file name at point")))) (defun image-dired-display-current-image-sized () -- 2.39.2