]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't disable transient mark mode when changing image faces
authorPeter Münster <pm@a16n.net>
Fri, 13 Aug 2021 10:25:27 +0000 (12:25 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 13 Aug 2021 10:25:27 +0000 (12:25 +0200)
* lisp/image-dired.el (image-dired-thumb-update-marks): Keep the
mark state when changing faces. (bug#49999).

lisp/image-dired.el

index 76c7ae91f00ce8a09ede4b196eb55850a4bddde1..3c59ef95b5e09e8d3c6d1723600b615f47d7616d 100644 (file)
@@ -2360,20 +2360,18 @@ non-nil."
 
 (defun image-dired-thumb-update-marks ()
   "Update the marks in the thumbnail buffer."
-  ;; TODO: only called by image-dired-mouse-toggle-mark but there are
-  ;; certainly other places, where it should be called too.
   (when image-dired-thumb-visible-marks
     (with-current-buffer image-dired-thumbnail-buffer
-      (save-excursion
+      (save-mark-and-excursion
         (goto-char (point-min))
         (let ((inhibit-read-only t))
           (while (not (eobp))
-            (if (image-dired-thumb-file-marked-p)
-                (add-face-text-property
-                 (point) (1+ (point))
-                 'image-dired-thumb-mark)
-              (remove-text-properties (point) (1+ (point))
-                                      '(face image-dired-thumb-mark)))
+            (with-silent-modifications
+              (if (image-dired-thumb-file-marked-p)
+                  (add-face-text-property (point) (1+ (point))
+                                          'image-dired-thumb-mark)
+                (remove-text-properties (point) (1+ (point))
+                                        '(face image-dired-thumb-mark))))
             (forward-char)))))))
 
 (defun image-dired-mouse-toggle-mark-1 ()