emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110575: * dired.el (dired-sort-toggl


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110575: * dired.el (dired-sort-toggle): Some ls implementations only allow
Date: Wed, 17 Oct 2012 20:50:15 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110575
fixes bug: http://debbugs.gnu.org/12666
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Wed 2012-10-17 20:50:15 -0700
message:
  * dired.el (dired-sort-toggle): Some ls implementations only allow
  a single option string.
modified:
  lisp/ChangeLog
  lisp/dired.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-10-18 03:30:04 +0000
+++ b/lisp/ChangeLog    2012-10-18 03:50:15 +0000
@@ -1,5 +1,8 @@
 2012-10-18  Glenn Morris  <address@hidden>
 
+       * dired.el (dired-sort-toggle): Some ls implementations only allow
+       a single option string.  (Bug#12666)
+
        * minibuffer.el (completion-cycle-threshold): Doc fix.
 
 2012-10-17  Kenichi Handa  <address@hidden>

=== modified file 'lisp/dired.el'
--- a/lisp/dired.el     2012-10-04 18:30:08 +0000
+++ b/lisp/dired.el     2012-10-18 03:50:15 +0000
@@ -3546,8 +3546,15 @@
        (setq dired-actual-switches
              (replace-match "" t t dired-actual-switches 3))))
     ;; Now, if we weren't sorting by date before, add the -t switch.
+    ;; Some simple-minded ls implementations (eg ftp servers) only
+    ;; allow a single option string, so try not to add " -t" if possible.
     (unless sorting-by-date
-      (setq dired-actual-switches (concat dired-actual-switches " -t"))))
+      (setq dired-actual-switches
+            (concat dired-actual-switches
+                    (if (string-match-p "\\`-[[:alnum:]]+\\'"
+                                        dired-actual-switches)
+                        "t"
+                      " -t")))))
   (dired-sort-set-mode-line)
   (revert-buffer))
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]