[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dired-preview 6c87ce4c4d: Tweak how buffers are killed
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dired-preview 6c87ce4c4d: Tweak how buffers are killed to avoid accidents |
Date: |
Wed, 25 Dec 2024 03:57:57 -0500 (EST) |
branch: externals/dired-preview
commit 6c87ce4c4dcfdbdbebd03dcd5fced2fdf1eeb2d4
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Tweak how buffers are killed to avoid accidents
I think this will fix the recent regression, discussed in issue 22 with
artelse: <https://github.com/protesilaos/dired-preview/issues/22>.
---
dired-preview.el | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/dired-preview.el b/dired-preview.el
index 277a2123e0..a4cc4094b1 100644
--- a/dired-preview.el
+++ b/dired-preview.el
@@ -198,8 +198,9 @@ implementation details."
(catch 'enough
(dolist (buffer buffers)
(if (>= (dired-preview--get-buffer-cumulative-size buffers)
max-combined-size)
- (when (not (eq buffer (current-buffer)))
- (ignore-errors (kill-buffer-if-not-modified buffer))
+ (progn
+ (when (not (eq buffer (current-buffer)))
+ (ignore-errors (kill-buffer-if-not-modified buffer)))
(setq buffers (delq buffer buffers)))
(throw 'enough t))))
(setq dired-preview--buffers (delq nil (nreverse buffers))))
@@ -210,8 +211,9 @@ implementation details."
(catch 'enough
(dolist (buffer buffers)
(if (>= length max-length)
- (when (not (eq buffer (current-buffer)))
- (ignore-errors (kill-buffer-if-not-modified buffer))
+ (progn
+ (when (not (eq buffer (current-buffer)))
+ (ignore-errors (kill-buffer-if-not-modified buffer)))
(setq length (1- length))
(setq buffers (delq buffer buffers)))
(throw 'enough t)))))
@@ -221,9 +223,9 @@ implementation details."
"Kill all BUFFERS except the current one."
(dolist (buffer buffers)
(when (not (eq buffer (current-buffer)))
- (ignore-errors (kill-buffer-if-not-modified buffer))
- (setq buffers (delq buffer buffers)))
- (setq dired-preview--buffers (delq nil (nreverse buffers)))))
+ (ignore-errors (kill-buffer-if-not-modified buffer)))
+ (setq buffers (delq buffer buffers)))
+ (setq dired-preview--buffers (delq nil (nreverse buffers))))
(defun dired-preview--kill-buffers (&optional kill-all)
"Implement `dired-preview-kill-buffers-method'.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/dired-preview 6c87ce4c4d: Tweak how buffers are killed to avoid accidents,
ELPA Syncer <=