(message "No image, or image with correct properties, at point")
(with-current-buffer dired-buf
(when (dired-goto-file file-name)
- ,@body
- (image-dired-thumb-update-marks))))))
+ ,@body)))))
-(defmacro image-dired--do-mark-command (maybe-next &rest body)
+(defmacro image-dired--do-mark-command (maybe-next update &rest body)
"Helper macro for the mark, unmark and flag commands.
Run BODY in Dired buffer.
-If optional argument MAYBE-NEXT is non-nil, show next image
-according to `image-dired-marking-shows-next'."
+If MAYBE-NEXT is non-nil, show next image according to
+`image-dired-marking-shows-next'.
+If UPDATE is non-nil, call `image-dired-thumb-update-marks' too."
(declare (indent defun) (debug t))
`(image-dired--with-thumbnail-buffer
(image-dired--on-file-in-dired-buffer
,@body)
+ ,(when update
+ '(image-dired-thumb-update-marks))
,(when maybe-next
'(if image-dired-marking-shows-next
(image-dired-display-next-thumbnail-original)
(defun image-dired-mark-thumb-original-file ()
"Mark original image file in associated Dired buffer."
(interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
- (image-dired--do-mark-command t
+ (image-dired--do-mark-command t t
(dired-mark 1)))
(defun image-dired-unmark-thumb-original-file ()
"Unmark original image file in associated Dired buffer."
(interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
- (image-dired--do-mark-command t
+ (image-dired--do-mark-command t t
(dired-unmark 1)))
(defun image-dired-flag-thumb-original-file ()
"Flag original image file for deletion in associated Dired buffer."
(interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
- (image-dired--do-mark-command t
+ (image-dired--do-mark-command t t
(dired-flag-file-deletion 1)))
(defun image-dired-unmark-all-marks ()
"Remove all marks from all files in associated Dired buffer.
Also update the marks in the thumbnail buffer."
(interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
- (image-dired--do-mark-command nil
+ (image-dired--do-mark-command nil t
(dired-unmark-all-marks))
(image-dired--with-thumbnail-buffer
(image-dired-thumb-update-marks)))
`image-dired-track-movement' is non-nil."
(when image-dired-track-movement
(image-dired-track-original-file))
- (image-dired--do-mark-command nil
+ (image-dired--do-mark-command nil nil
(if (image-dired-dired-file-marked-p)
(dired-unmark 1)
(dired-mark 1))))
"Toggle mark on original image file in associated Dired buffer."
(declare (obsolete nil "29.1"))
(interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
- (image-dired--do-mark-command nil
+ (image-dired--do-mark-command nil t
(if (image-dired-dired-file-marked-p)
(dired-unmark 1)
(dired-mark 1))))