branch: externals/denote-sequence
commit 26d26dfc860fd0270de6e7f3aa1a7fd5d4a78ac5
Author: Protesilaos Stavrou <i...@protesilaos.com>
Commit: Protesilaos Stavrou <i...@protesilaos.com>

    Make denote-sequence-dired name its buffer correctly and rely on generic 
revert-buffer
    
    This is the kind of change we implemented in denote.el as well.
    Basically, by setting up 'dired' the right way, we do not need a
    custom revert-buffer-function (and what we were doing with kill-buffer
    was problematic, anyway).
---
 denote-sequence.el | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/denote-sequence.el b/denote-sequence.el
index 8e4b1508b7..4571ea9b3a 100644
--- a/denote-sequence.el
+++ b/denote-sequence.el
@@ -1030,18 +1030,11 @@ For a more specialised case, see 
`denote-sequence-find-relatives-dired'."
             (files-with-depth (if depth
                                   
(denote-sequence-get-all-files-with-max-depth depth all)
                                 all))
-            (files-sorted (denote-sequence-sort-files files-with-depth))
+            (files-sorted (denote-sequence-sort-files files-with-depth)))
+      (let ((dired-buffer (dired (cons default-directory (mapcar 
#'file-relative-name files-sorted))))
             (buffer-name (denote-sequence--get-dired-buffer-name prefix 
depth)))
-      (let ((dired-buffer (dired (cons buffer-name (mapcar 
#'file-relative-name files-sorted)))))
         (with-current-buffer dired-buffer
-          (setq-local revert-buffer-function
-                      (lambda (&rest _)
-                        ;; FIXME 2025-01-04: Killing the buffer has
-                        ;; the unintended side effect of affecting the
-                        ;; window configuration when we call
-                        ;; `denote-update-dired-buffers'.
-                        (kill-buffer dired-buffer)
-                        (denote-sequence-dired prefix depth)))))
+          (rename-buffer buffer-name :unique)))
     (user-error "No Denote sequences matching those terms")))
 
 ;;;###autoload

Reply via email to