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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Emacs - Bugs mailing list

Hi,

 

When open 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 major mode change hook, in follow 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)

 

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

 

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

 

Best Regards

Lin Sun

Reply | Threaded
Open this post in threaded view
|

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

Lars Ingebrigtsen
Lin Sun <[hidden email]> writes:

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

Thanks; applied to Emacs 28.

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no