branch: elpa/dirvish
commit 7a7a25fee83773f3f78e8566cff229b129badcf9
Author: Edgar Pireyn <[email protected]>
Commit: GitHub <[email protected]>

    fix: wrong-argument when yanking on Emacs >31.0.50 (#375)
    
    When setting `dirvish-yank-sources` to 'all, it is interpreted as a
    custom function since `all()` is a builtin function in Emacs
    31.0.50. The workaround used here is to check whether
    `dirvish-yank-sources` is neither "all", "session", "buffer" before
    calling the function associated to the symbol.
---
 extensions/dirvish-yank.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/extensions/dirvish-yank.el b/extensions/dirvish-yank.el
index 31d050395d..4b264f5687 100644
--- a/extensions/dirvish-yank.el
+++ b/extensions/dirvish-yank.el
@@ -341,9 +341,10 @@ It sets the value for every variable matching 
INCLUDE-REGEXP."
 (defun dirvish-yank--apply (method dest)
   "Apply yank METHOD to DEST."
   (setq dest (expand-file-name (or dest (dired-current-directory))))
-  (let ((srcs (or (and (functionp dirvish-yank-sources)
+  (let ((srcs (or (and (not (member dirvish-yank-sources '(all session 
buffer)))
+                      (functionp dirvish-yank-sources)
                        (funcall dirvish-yank-sources))
-                  (dirvish-yank--get-srcs dirvish-yank-sources)
+                 (dirvish-yank--get-srcs dirvish-yank-sources)
                   (user-error "DIRVISH[yank]: no marked files"))))
     (dirvish-yank-default-handler method srcs dest)))
 

Reply via email to