]> git.eshelyaron.com Git - emacs.git/commitdiff
Restore evaluation logic in dired-guess-default
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 21 Jul 2021 11:12:05 +0000 (13:12 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 21 Jul 2021 11:12:05 +0000 (13:12 +0200)
* lisp/dired-x.el (dired-guess-default): Restore the `eval' bits
also removed in a previous commit (bug#48071).

lisp/dired-x.el

index 073923e09c9ada0884ff4d0fb8db2ef5849f34a5..a7bfae759edbab2ef882f18c38a2361f4a9de5e5 100644 (file)
@@ -975,17 +975,20 @@ See `dired-guess-shell-alist-user'."
   (let* ((case-fold-search dired-guess-shell-case-fold-search)
          (programs
           (delete-dups
-           (seq-reduce
-            #'append
-            (mapcar #'cdr
-                    (seq-filter (lambda (elem)
-                                  (seq-every-p
-                                   (lambda (file)
-                                     (string-match-p (car elem) file))
-                                   files))
-                                (append dired-guess-shell-alist-user
-                                        dired-guess-shell-alist-default)))
-            nil))))
+           (mapcar
+            (lambda (command)
+              (eval command `((file . ,(car files)))))
+            (seq-reduce
+             #'append
+             (mapcar #'cdr
+                     (seq-filter (lambda (elem)
+                                   (seq-every-p
+                                    (lambda (file)
+                                      (string-match-p (car elem) file))
+                                    files))
+                                 (append dired-guess-shell-alist-user
+                                         dired-guess-shell-alist-default)))
+             nil)))))
     (if (length= programs 1)
         (car programs)
       programs)))