]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't call `image-toggle-display-text' when toggling
authorLin Sun <lin.sun@zoom.us>
Mon, 5 Apr 2021 16:12:14 +0000 (18:12 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 5 Apr 2021 16:12:14 +0000 (18:12 +0200)
*lisp/image-mode.el (image-mode-to-text): Do not call the
image-toggle-display-text twice when toggle image display (bug#47521).

lisp/image-mode.el

index 2de16cb6afdd98aab4c61777e22ede5e76bed93b..f4ff35f9c41a98242cc156d760919db3cba0c1e1 100644 (file)
@@ -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.