diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2021-07-21 13:04:06 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-07-21 13:04:06 +0200 |
commit | bc0aca059dbfe8cd485d9591f36efb70a2a6272e (patch) | |
tree | 8df215fc81c332f90746320ee276a48ce2d56a6b | |
parent | e4f323a82a6f92af391831b83e2ebd2b91250837 (diff) | |
download | emacs-bc0aca059dbfe8cd485d9591f36efb70a2a6272e.tar.gz emacs-bc0aca059dbfe8cd485d9591f36efb70a2a6272e.tar.bz2 emacs-bc0aca059dbfe8cd485d9591f36efb70a2a6272e.zip |
Fix dired-guess-default logic after previous change
* lisp/dired-x.el (dired-guess-default): Restore previous logic --
require matches for all files (bug#48071).
-rw-r--r-- | lisp/dired-x.el | 7 | ||||
-rw-r--r-- | test/lisp/dired-x-tests.el | 5 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 2d91b5a9e8d..073923e09c9 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -979,9 +979,10 @@ See `dired-guess-shell-alist-user'." #'append (mapcar #'cdr (seq-filter (lambda (elem) - (seq-some (lambda (file) - (string-match-p (car elem) file)) - files)) + (seq-every-p + (lambda (file) + (string-match-p (car elem) file)) + files)) (append dired-guess-shell-alist-user dired-guess-shell-alist-default))) nil)))) diff --git a/test/lisp/dired-x-tests.el b/test/lisp/dired-x-tests.el index 98754b19b4e..003923d60fa 100644 --- a/test/lisp/dired-x-tests.el +++ b/test/lisp/dired-x-tests.el @@ -58,8 +58,9 @@ ("\\.jpe?g\\'" "xloadimage")))) (should (equal (dired-guess-default '("/tmp/foo.png")) "display")) (should (equal (dired-guess-default '("/tmp/foo.gif")) - '("display" "xloadimage" "feh"))))) - + '("display" "xloadimage" "feh"))) + (should (equal (dired-guess-default '("/tmp/foo.png" "/tmp/foo.txt")) + nil)))) (provide 'dired-x-tests) ;; dired-x-tests.el ends here |