aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorStefan Kangas2022-08-16 17:14:33 +0200
committerStefan Kangas2022-08-17 16:21:09 +0200
commita6412b96e72c32ee981f469a564c8d2155d575aa (patch)
treea2342cddcb5a3a9e1849363f3f03c78e900a7a29 /test
parentd214dd67cd5910c4c9ecefdf879886c4d01b0c27 (diff)
downloademacs-a6412b96e72c32ee981f469a564c8d2155d575aa.tar.gz
emacs-a6412b96e72c32ee981f469a564c8d2155d575aa.zip
Move dired-guess commands from dired-x to dired
* lisp/dired-x.el (dired-shell-command-history) (dired-guess-shell-alist-default, dired-guess-default) (dired-guess-shell-command): Move from here... * lisp/dired-aux.el (dired-shell-command-history) (dired-guess-shell-alist-default, dired-guess-default) (dired-guess-shell-command): ...to here. (Bug#21981) * lisp/dired-x.el (dired-guess-shell-gnutar) (dired-guess-shell-gzip-quiet, dired-guess-shell-znew-switches) (dired-guess-shell-case-fold-search, dired-guess-shell-alist-user): Move from here... * lisp/dired.el (dired-guess-shell-gnutar) (dired-guess-shell-gzip-quiet, dired-guess-shell-znew-switches) (dired-guess-shell-case-fold-search, dired-guess-shell-alist-user): ...to here. Change :group to dired-guess. (dired-guess): New defgroup. * test/lisp/dired-x-tests.el (dired-guess-default): Move from here... * test/lisp/dired-aux-tests.el (dired-guess-default): ...to here. * doc/misc/dired-x.texi (Features, Technical Details, Installation): Delete any mention of shell command guessing. (Shell Command Guessing): Move from here... * doc/emacs/dired.texi (Shell Command Guessing): ...to here. Adapt to better fit the Emacs Manual conventions. * lisp/dired-aux.el (dired-do-shell-command): Doc fix to adjust for above changes. * etc/NEWS: Announce the above change.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/dired-aux-tests.el13
-rw-r--r--test/lisp/dired-x-tests.el13
2 files changed, 13 insertions, 13 deletions
diff --git a/test/lisp/dired-aux-tests.el b/test/lisp/dired-aux-tests.el
index 694deaae4c2..e70898ab74e 100644
--- a/test/lisp/dired-aux-tests.el
+++ b/test/lisp/dired-aux-tests.el
@@ -154,5 +154,18 @@
154 (should (string-match (regexp-quote command) (nth 0 lines))) 154 (should (string-match (regexp-quote command) (nth 0 lines)))
155 (dired-test--check-highlighting (nth 0 lines) '(8)))) 155 (dired-test--check-highlighting (nth 0 lines) '(8))))
156 156
157(ert-deftest dired-guess-default ()
158 (let ((dired-guess-shell-alist-user nil)
159 (dired-guess-shell-alist-default
160 '(("\\.png\\'" "display")
161 ("\\.gif\\'" "display" "xloadimage")
162 ("\\.gif\\'" "feh")
163 ("\\.jpe?g\\'" "xloadimage"))))
164 (should (equal (dired-guess-default '("/tmp/foo.png")) "display"))
165 (should (equal (dired-guess-default '("/tmp/foo.gif"))
166 '("display" "xloadimage" "feh")))
167 (should (equal (dired-guess-default '("/tmp/foo.png" "/tmp/foo.txt"))
168 nil))))
169
157(provide 'dired-aux-tests) 170(provide 'dired-aux-tests)
158;;; dired-aux-tests.el ends here 171;;; dired-aux-tests.el ends here
diff --git a/test/lisp/dired-x-tests.el b/test/lisp/dired-x-tests.el
index cec266b0ef9..7acaa3c1319 100644
--- a/test/lisp/dired-x-tests.el
+++ b/test/lisp/dired-x-tests.el
@@ -47,19 +47,6 @@
47 (should (equal all-but-c 47 (should (equal all-but-c
48 (sort (dired-get-marked-files 'local) #'string<)))))) 48 (sort (dired-get-marked-files 'local) #'string<))))))
49 49
50(ert-deftest dired-guess-default ()
51 (let ((dired-guess-shell-alist-user nil)
52 (dired-guess-shell-alist-default
53 '(("\\.png\\'" "display")
54 ("\\.gif\\'" "display" "xloadimage")
55 ("\\.gif\\'" "feh")
56 ("\\.jpe?g\\'" "xloadimage"))))
57 (should (equal (dired-guess-default '("/tmp/foo.png")) "display"))
58 (should (equal (dired-guess-default '("/tmp/foo.gif"))
59 '("display" "xloadimage" "feh")))
60 (should (equal (dired-guess-default '("/tmp/foo.png" "/tmp/foo.txt"))
61 nil))))
62
63(ert-deftest dired-x--string-to-number () 50(ert-deftest dired-x--string-to-number ()
64 (should (= (dired-x--string-to-number "2.4K") 2457.6)) 51 (should (= (dired-x--string-to-number "2.4K") 2457.6))
65 (should (= (dired-x--string-to-number "2400") 2400)) 52 (should (= (dired-x--string-to-number "2400") 2400))