[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 1457c231b5 1/3: image-dired-delete-char: Don't disturb formatting
From: |
Stefan Kangas |
Subject: |
master 1457c231b5 1/3: image-dired-delete-char: Don't disturb formatting |
Date: |
Thu, 29 Sep 2022 10:33:47 -0400 (EDT) |
branch: master
commit 1457c231b52ea2c1694b7564f824b3a61d0e0fe1
Author: Peter Münster <pm@a16n.net>
Commit: Stefan Kangas <stefankangas@gmail.com>
image-dired-delete-char: Don't disturb formatting
* lisp/image/image-dired.el (image-dired-delete-char): Don't disturb
the expected formatting of the thumbnail buffer (always one
space/newline after a thumbnail).
---
lisp/image/image-dired.el | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el
index f4ae6e9bfd..661fa9dec1 100644
--- a/lisp/image/image-dired.el
+++ b/lisp/image/image-dired.el
@@ -460,7 +460,8 @@ and IMAGE-NUMBER."
(defmacro image-dired--with-marked (&rest body)
"Eval BODY with point on each marked thumbnail.
If no marked file could be found, execute BODY on the current
-thumbnail."
+thumbnail. It's expected that a thumbnail is always followed
+by exactly one space or one newline character."
`(with-current-buffer image-dired-thumbnail-buffer
(let (found)
(save-mark-and-excursion
@@ -1113,9 +1114,10 @@ With a negative prefix argument, prompt user for the
delay."
"Remove current thumbnail from thumbnail buffer and line up."
(interactive nil image-dired-thumbnail-mode)
(let ((inhibit-read-only t))
- (delete-char 1)
- (when (= (following-char) ?\s)
- (delete-char 1))))
+ (delete-char 1))
+ (let ((pos (point)))
+ (image-dired--line-up-with-method)
+ (goto-char pos)))
(defun image-dired-line-up ()
"Line up thumbnails according to `image-dired-thumbs-per-row'.
@@ -1364,7 +1366,9 @@ for deletion instead."
'(face image-dired-thumb-mark))))))
(defun image-dired--thumb-update-marks ()
- "Update the marks in the thumbnail buffer."
+ "Update the marks in the thumbnail buffer.
+It's expected, that a thumbnail is always followed
+by exactly one space or one newline character."
(when image-dired-thumb-visible-marks
(with-current-buffer image-dired-thumbnail-buffer
(save-mark-and-excursion