summaryrefslogtreecommitdiff
path: root/lisp/ls-lisp.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>1999-12-16 09:43:32 +0000
committerEli Zaretskii <eliz@gnu.org>1999-12-16 09:43:32 +0000
commit6d3edd1c1a7c416e6085e4a35c5f110a20a57a04 (patch)
tree86d0ff79376ce5b3434083e264f20ea77746c560 /lisp/ls-lisp.el
parent4dca233fe8c2d4eca3b0ec395990a7f608bfc57d (diff)
downloademacs-6d3edd1c1a7c416e6085e4a35c5f110a20a57a04.tar.gz
* ls-lisp.el (ls-lisp-insert-directory): Print an explicit message
if one of the files specified cannot be accessed by file-attributes. Do not strip any leading directories from the file names, to behave more like `ls' does. * dired.el (dired-get-filename): Handle absolute file names. (dired-readin-insert): If argument is a cons, don't print "wildcard" on the ``total'' line.
Diffstat (limited to 'lisp/ls-lisp.el')
-rw-r--r--lisp/ls-lisp.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index 6158eff5df9..fa7b462b3ff 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -106,7 +106,8 @@ file names.
Not all `ls' switches are supported. The switches that work
are: A a c i r S s t u"
- (let ((handler (find-file-name-handler file 'insert-directory)))
+ (let ((handler (find-file-name-handler file 'insert-directory))
+ fattr)
(if handler
(funcall handler 'insert-directory file switches
wildcard full-directory-p)
@@ -180,10 +181,15 @@ are: A a c i r S s t u"
;; if not full-directory-p, FILE *must not* end in /, as
;; file-attributes will not recognize a symlink to a directory
;; must make it a relative filename as ls does:
- (setq file (file-name-nondirectory file))
- (insert (ls-lisp-format file (file-attributes file)
- (nth 7 (file-attributes file)) switches
- (current-time)))))))
+ (if (eq (aref file (1- (length file))) ?/)
+ (setq file (substring file 0 (1- (length file)))))
+ (setq fattr (file-attributes file))
+ (if fattr
+ (insert (ls-lisp-format file fattr (nth 7 fattr)
+ switches (current-time)))
+ (message "%s: doesn't exist or is inaccessible" file)
+ (ding)
+ (sit-for 2))))))
(defun ls-lisp-delete-matching (regexp list)
;; Delete all elements matching REGEXP from LIST, return new list.