Skip to content

Commit

Permalink
Don't call `image-toggle-display-text' when toggling
Browse files Browse the repository at this point in the history
*lisp/image-mode.el (image-mode-to-text): Do not call the
image-toggle-display-text twice when toggle image display (bug#47521).
  • Loading branch information
Lin Sun authored and larsmagne committed Apr 5, 2021
1 parent d2edc29 commit 20669c1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lisp/image-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 20669c1

Please sign in to comment.