summaryrefslogtreecommitdiff
path: root/lisp/image-mode.el
diff options
context:
space:
mode:
authorLin Sun <lin.sun@zoom.us>2021-04-05 18:12:14 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-04-05 18:12:14 +0200
commit20669c1b929699670869afa40ee6d407ccb42848 (patch)
treef960f0d247d3caf90fae76f8803b9dba9f1be098 /lisp/image-mode.el
parentd2edc29db6278deb20bc04c878757eeee2029086 (diff)
downloademacs-20669c1b929699670869afa40ee6d407ccb42848.tar.gz
emacs-20669c1b929699670869afa40ee6d407ccb42848.tar.bz2
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).
Diffstat (limited to 'lisp/image-mode.el')
-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."
(setq image-type previous-image-type)
;; Enable image minor mode with `C-c C-c'.
(image-minor-mode 1)
- ;; Show the image file as text.
- (image-toggle-display-text)))
+ (unless (image-get-display-property)
+ ;; Show the image file as text.
+ (image-toggle-display-text))))
(defun image-mode-as-hex ()
"Set a non-image mode as major mode in combination with image minor mode.