From 5a8f70149fd09859ac269b941aadde00c6a61536 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Sun, 11 Sep 2022 19:15:21 +0300 Subject: [PATCH] FIXED: (sweep-load-buffer): error after prompting for a buffer --- sweep.el | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/sweep.el b/sweep.el index 4766151..a4b7b59 100644 --- a/sweep.el +++ b/sweep.el @@ -874,17 +874,18 @@ Interactively, if the major mode of the current buffer is `sweep-mode' and the command is called without a prefix argument, load the current buffer. Otherwise, prompt for a `sweep-mode' buffer to load." - (interactive (if (and (not current-prefix-arg) - (eq major-mode 'sweep-mode)) - (list (current-buffer)) - (read-buffer "Load buffer: " - (when (eq major-mode 'sweep-mode) - (buffer-name)) - t - (lambda (b) - (let ((n (or (and (consp b) (car b)) b))) - (with-current-buffer n - (eq major-mode 'sweep-mode))))))) + (interactive (list + (if (and (not current-prefix-arg) + (eq major-mode 'sweep-mode)) + (current-buffer) + (read-buffer "Load buffer: " + (when (eq major-mode 'sweep-mode) + (buffer-name)) + t + (lambda (b) + (let ((n (or (and (consp b) (car b)) b))) + (with-current-buffer n + (eq major-mode 'sweep-mode)))))))) (with-current-buffer buffer (let* ((beg (point-min)) (end (point-max)) -- 2.39.2