emacs-diffs
[Top][All Lists]
Advanced

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

master 7c73772: Fix problem of point movement in image-mode


From: Lars Ingebrigtsen
Subject: master 7c73772: Fix problem of point movement in image-mode
Date: Tue, 16 Feb 2021 11:39:13 -0500 (EST)

branch: master
commit 7c7377288a125ef47f2b422cf131f044a3b418e1
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix problem of point movement in image-mode
    
    * lisp/image-mode.el (image-mode): Switch disable-point-adjustment
    on, otherwise `C-c C-c' will move point around oddly.
    (image-toggle-display): Ensure that point is on the image (bug#46552).
---
 lisp/image-mode.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index ec0a559..28b75c8 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -611,6 +611,7 @@ Key bindings:
   (major-mode-suspend)
   (setq major-mode 'image-mode)
   (setq image-transform-resize image-auto-resize)
+  (setq-local disable-point-adjustment t)
 
   ;; Bail out early if we have no image data.
   (if (zerop (buffer-size))
@@ -931,6 +932,7 @@ If the current buffer is displaying an image file as an 
image,
 call `image-mode-as-text' to switch to text or hex display.
 Otherwise, display the image by calling `image-mode'."
   (interactive)
+  (goto-char (point-min))
   (if (image-get-display-property)
       (image-mode-as-text)
     (if (eq major-mode 'hexl-mode)



reply via email to

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