diff options
| author | Geoff Voelker | 1998-04-17 05:24:48 +0000 |
|---|---|---|
| committer | Geoff Voelker | 1998-04-17 05:24:48 +0000 |
| commit | 97b927b3fa3faa8422e78ddd41d22a84af1a0613 (patch) | |
| tree | 0ce10b286489157d4fde11d6473e5dc7a20049cf | |
| parent | 0627db9cd2196b7afadcccd80c07d94450184322 (diff) | |
| download | emacs-97b927b3fa3faa8422e78ddd41d22a84af1a0613.tar.gz emacs-97b927b3fa3faa8422e78ddd41d22a84af1a0613.zip | |
(ls-lisp-dired-ignore-case): New variable.
(ls-lisp-handle-switches): Obey ls-lisp-dired-ignore-case.
| -rw-r--r-- | lisp/ls-lisp.el | 16 |
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). | |||
| 63 | This variable is checked by \\[insert-directory] only when `ls-lisp.el' | 63 | This variable is checked by \\[insert-directory] only when `ls-lisp.el' |
| 64 | package is used.") | 64 | package is used.") |
| 65 | 65 | ||
| 66 | (defvar ls-lisp-dired-ignore-case nil | ||
| 67 | "Non-nil causes dired buffers to sort alphabetically regardless of case.") | ||
| 68 | |||
| 66 | (defun insert-directory (file &optional switches wildcard full-directory-p) | 69 | (defun insert-directory (file &optional switches wildcard full-directory-p) |
| 67 | "Insert directory listing for FILE, formatted according to SWITCHES. | 70 | "Insert directory listing for FILE, formatted according to SWITCHES. |
| 68 | Leaves point after the inserted text. | 71 | Leaves point after the inserted text. |
| @@ -188,10 +191,15 @@ are: A a c i r S s t u" | |||
| 188 | (ls-lisp-time-lessp (nth index (cdr y)) | 191 | (ls-lisp-time-lessp (nth index (cdr y)) |
| 189 | (nth index (cdr x)))))) | 192 | (nth index (cdr x)))))) |
| 190 | (t ; sorted alphabetically | 193 | (t ; sorted alphabetically |
| 191 | (function | 194 | (if ls-lisp-dired-ignore-case |
| 192 | (lambda (x y) | 195 | (function |
| 193 | (string-lessp (car x) | 196 | (lambda (x y) |
| 194 | (car y))))))))) | 197 | (string-lessp (upcase (car x)) |
| 198 | (upcase (car y))))) | ||
| 199 | (function | ||
| 200 | (lambda (x y) | ||
| 201 | (string-lessp (car x) | ||
| 202 | (car y)))))))))) | ||
| 195 | (if (memq ?r switches) ; reverse sort order | 203 | (if (memq ?r switches) ; reverse sort order |
| 196 | (setq file-alist (nreverse file-alist))) | 204 | (setq file-alist (nreverse file-alist))) |
| 197 | file-alist) | 205 | file-alist) |