summaryrefslogtreecommitdiff
path: root/lisp/ls-lisp.el
diff options
context:
space:
mode:
authorGeoff Voelker <voelker@cs.washington.edu>1998-04-17 05:24:48 +0000
committerGeoff Voelker <voelker@cs.washington.edu>1998-04-17 05:24:48 +0000
commit4216d5797118c0e088b0ed201aceee4999a980c7 (patch)
tree888806c380447fe067b4e3f5bd9b323945875d3e /lisp/ls-lisp.el
parent1ba00d0b0f207386e5103955ce5b21b550c3765a (diff)
downloademacs-4216d5797118c0e088b0ed201aceee4999a980c7.tar.gz
(ls-lisp-dired-ignore-case): New variable.
(ls-lisp-handle-switches): Obey ls-lisp-dired-ignore-case.
Diffstat (limited to 'lisp/ls-lisp.el')
-rw-r--r--lisp/ls-lisp.el16
1 files changed, 12 insertions, 4 deletions
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index dbebfb800ce..a3c4c9a0f6c 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -63,6 +63,9 @@ nil means they are treated as Emacs regexps (for backward compatibility).
This variable is checked by \\[insert-directory] only when `ls-lisp.el'
package is used.")
+(defvar ls-lisp-dired-ignore-case nil
+ "Non-nil causes dired buffers to sort alphabetically regardless of case.")
+
(defun insert-directory (file &optional switches wildcard full-directory-p)
"Insert directory listing for FILE, formatted according to SWITCHES.
Leaves point after the inserted text.
@@ -188,10 +191,15 @@ are: A a c i r S s t u"
(ls-lisp-time-lessp (nth index (cdr y))
(nth index (cdr x))))))
(t ; sorted alphabetically
- (function
- (lambda (x y)
- (string-lessp (car x)
- (car y)))))))))
+ (if ls-lisp-dired-ignore-case
+ (function
+ (lambda (x y)
+ (string-lessp (upcase (car x))
+ (upcase (car y)))))
+ (function
+ (lambda (x y)
+ (string-lessp (car x)
+ (car y))))))))))
(if (memq ?r switches) ; reverse sort order
(setq file-alist (nreverse file-alist)))
file-alist)