From e95105a6cc734268e18304378fdfdbf3bfd433f3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 14 Dec 2025 16:45:20 +0100 Subject: [PATCH] My hack to make embark-export work --- dirvish.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dirvish.el b/dirvish.el index 062279d..3104e69 100644 --- a/dirvish.el +++ b/dirvish.el @@ -1480,7 +1480,17 @@ With optional NOSELECT just find files but do not select them." (flags (or flags (dv-ls-switches dv))) (mc dirvish-large-directory-threshold) (buffer (alist-get key (dv-roots dv) nil nil #'equal)) - (new? (null buffer)) (dps (dv-preview-dispatchers dv)) + ;; embark-export-dired uses a hack to force dired to create a new + ;; buffer documented here: + ;; https://github.com/oantolin/embark/issues/675 + ;; make dirvish aware of it so it also creates new buffer. Without this + ;; code when opening a directory in dirvish and then using e.g + ;; consult-fd combined with embark-export in that folder it fails + ;; because it tries to reuse the existing buffer + (new? (or + (null buffer) + (eq (symbol-function 'dired-find-buffer-nocreate) #'ignore))) + (dps (dv-preview-dispatchers dv)) (hist (cons key nil)) tramp fd) (setf (dv-timestamp dv) (dirvish--timestamp)) (cond ((and new? remote)