From 3eac7dc780433e2eab046e83315f1d90caf3cab9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20M=C3=BCnster?= Date: Tue, 12 Oct 2021 14:31:58 +0200 Subject: [PATCH] Fix point movement in image-dired * lisp/image-dired.el (image-dired-thumb-file-marked-p): Don't move point in associated dired buffer. (image-dired-delete-marked): Revert "Fix deletion of associated image" because it was wrong and introduced another problem (bug#51152). --- lisp/image-dired.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 3ca47300a99..4e6a410c114 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -2314,18 +2314,19 @@ non-nil." (dired-buf (image-dired-associated-dired-buffer))) (when (and dired-buf file-name) (with-current-buffer dired-buf - (when (dired-goto-file file-name) - (image-dired-dired-file-marked-p)))))) + (save-excursion + (when (dired-goto-file file-name) + (image-dired-dired-file-marked-p))))))) (defun image-dired-delete-marked () "Delete current or marked thumbnails and associated images." (interactive) - (with-current-buffer (image-dired-associated-dired-buffer) - (dired-do-delete)) (image-dired--with-marked (image-dired-delete-char) (backward-char)) - (image-dired--line-up-with-method)) + (image-dired--line-up-with-method) + (with-current-buffer (image-dired-associated-dired-buffer) + (dired-do-delete))) (defun image-dired-thumb-update-marks () "Update the marks in the thumbnail buffer." -- 2.39.2