aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLin Sun2021-04-05 18:12:14 +0200
committerLars Ingebrigtsen2021-04-05 18:12:14 +0200
commit20669c1b929699670869afa40ee6d407ccb42848 (patch)
treef960f0d247d3caf90fae76f8803b9dba9f1be098
parentd2edc29db6278deb20bc04c878757eeee2029086 (diff)
downloademacs-20669c1b929699670869afa40ee6d407ccb42848.tar.gz
emacs-20669c1b929699670869afa40ee6d407ccb42848.zip
Don't call `image-toggle-display-text' when toggling
*lisp/image-mode.el (image-mode-to-text): Do not call the image-toggle-display-text twice when toggle image display (bug#47521).
-rw-r--r--lisp/image-mode.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 2de16cb6afd..f4ff35f9c41 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -732,8 +732,9 @@ displays an image file as text."
732 (setq image-type previous-image-type) 732 (setq image-type previous-image-type)
733 ;; Enable image minor mode with `C-c C-c'. 733 ;; Enable image minor mode with `C-c C-c'.
734 (image-minor-mode 1) 734 (image-minor-mode 1)
735 ;; Show the image file as text. 735 (unless (image-get-display-property)
736 (image-toggle-display-text))) 736 ;; Show the image file as text.
737 (image-toggle-display-text))))
737 738
738(defun image-mode-as-hex () 739(defun image-mode-as-hex ()
739 "Set a non-image mode as major mode in combination with image minor mode. 740 "Set a non-image mode as major mode in combination with image minor mode.