aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ls-lisp.el23
1 files changed, 6 insertions, 17 deletions
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index e02bd5db459..6158eff5df9 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -134,29 +134,18 @@ are: A a c i r S s t u"
134 (sum 0) 134 (sum 0)
135 elt 135 elt
136 short 136 short
137 (file-list (directory-files dir nil wildcard)) 137 (file-alist (directory-files-and-attributes dir nil wildcard))
138 file-alist
139 (now (current-time)) 138 (now (current-time))
140 ;; do all bindings here for speed 139 ;; do all bindings here for speed
141 file-size 140 file-size
142 fil attr) 141 fil attr)
143 (cond ((memq ?A switches) 142 (cond ((memq ?A switches)
144 (setq file-list 143 (setq file-alist
145 (ls-lisp-delete-matching "^\\.\\.?$" file-list))) 144 (ls-lisp-delete-matching "^\\.\\.?$" file-alist)))
146 ((not (memq ?a switches)) 145 ((not (memq ?a switches))
147 ;; if neither -A nor -a, flush . files 146 ;; if neither -A nor -a, flush . files
148 (setq file-list 147 (setq file-alist
149 (ls-lisp-delete-matching "^\\." file-list)))) 148 (ls-lisp-delete-matching "^\\." file-alist))))
150 (setq file-alist
151 (mapcar
152 (function
153 (lambda (x)
154 ;; file-attributes("~bogus") bombs
155 (cons x (file-attributes (expand-file-name x)))))
156 ;; inserting the call to directory-files right here
157 ;; seems to stimulate an Emacs bug
158 ;; ILLEGAL DATATYPE (#o37777777727) or #o67
159 file-list))
160 ;; ``Total'' line (filled in afterwards). 149 ;; ``Total'' line (filled in afterwards).
161 (insert (if (car-safe file-alist) 150 (insert (if (car-safe file-alist)
162 "total \007\n" 151 "total \007\n"
@@ -201,7 +190,7 @@ are: A a c i r S s t u"
201 ;; Should perhaps use setcdr for efficiency. 190 ;; Should perhaps use setcdr for efficiency.
202 (let (result) 191 (let (result)
203 (while list 192 (while list
204 (or (string-match regexp (car list)) 193 (or (string-match regexp (car (car list)))
205 (setq result (cons (car list) result))) 194 (setq result (cons (car list) result)))
206 (setq list (cdr list))) 195 (setq list (cdr list)))
207 result)) 196 result))