aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-04-29 05:06:46 +0000
committerRichard M. Stallman1998-04-29 05:06:46 +0000
commit7820b28f318a34ba4bf9e6adb316a6ba31f14e77 (patch)
treebd31249ec186a86be3c758735bd52fa5c5b88d45
parent37e2fdd2686ff1ab6eb655e13ab8723da626e72c (diff)
downloademacs-7820b28f318a34ba4bf9e6adb316a6ba31f14e77.tar.gz
emacs-7820b28f318a34ba4bf9e6adb316a6ba31f14e77.zip
(dired-sort-toggle): Handle spaces in dired-actual-switches.
-rw-r--r--lisp/dired.el26
1 files changed, 16 insertions, 10 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index c8f6c6de60e..d6168e5f290 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2389,16 +2389,22 @@ With a prefix argument you can edit the current listing switches instead."
2389 ;; Toggle between sort by date/name. Reverts the buffer. 2389 ;; Toggle between sort by date/name. Reverts the buffer.
2390 (setq dired-actual-switches 2390 (setq dired-actual-switches
2391 (let (case-fold-search) 2391 (let (case-fold-search)
2392 (concat 2392 (if (string-match " " dired-actual-switches)
2393 "-l" 2393 ;; New toggle scheme: add/remove a trailing " -t"
2394 (dired-replace-in-string (concat "[-lt" 2394 (if (string-match " -t\\'" dired-actual-switches)
2395 dired-ls-sorting-switches "]") 2395 (dired-replace-in-string " -t\\'" "" dired-actual-switches)
2396 "" 2396 (concat dired-actual-switches " -t"))
2397 dired-actual-switches) 2397 ;; old toggle scheme: look for some 't' switch and add/remove it
2398 (if (string-match (concat "[t" dired-ls-sorting-switches "]") 2398 (concat
2399 dired-actual-switches) 2399 "-l"
2400 "" 2400 (dired-replace-in-string (concat "[-lt"
2401 "t")))) 2401 dired-ls-sorting-switches "]")
2402 ""
2403 dired-actual-switches)
2404 (if (string-match (concat "[t" dired-ls-sorting-switches "]")
2405 dired-actual-switches)
2406 ""
2407 "t")))))
2402 (dired-sort-set-modeline) 2408 (dired-sort-set-modeline)
2403 (revert-buffer)) 2409 (revert-buffer))
2404 2410