bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#47521: 28.0.50; [PATCH] [image-mode] reduce calling for image-toggle


From: Lin Sun
Subject: bug#47521: 28.0.50; [PATCH] [image-mode] reduce calling for image-toggle-display-text
Date: Wed, 31 Mar 2021 22:47:33 +0800

(Resend in text mail format.)
Hi,

When opening a png file and toggle display from image to text by C-c
C-c, the `image-toggle-display-text` will be called twice in function
`image-toggle-display-text`.
The first call is from the major mode change hook, in the following
line will cause `change-major-mode-hook` be run and it’s
`image-toggle-display-text` for image-mode.
image-mode.el:730         (major-mode-restore '(image-mode image-mode-as-text))

The second call is from the direct call at
image-mode.el:736         (image-toggle-display-text)

Try debug-on-entry on `image-toggle-display-text`, then switch image
to text in image-mode by press C-c C-c to observe the issue.

And the patch tries to reduce calling for `image-toggle-display-text`.

Best Regards
Lin Sun

Attachment: 0001-image-mode-reduce-calling-for-image-toggle-display-t.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]