comparison lisp/ls-lisp.el @ 107118:68c91c0692df

* ls-lisp.el (ls-lisp-insert-directory): Wen WILDCARD-REGEXP and FULL-DIRECTORY-P are nil, and FILE is absolute, expand it. This prevents file names like "~/" been listed literally.
author Michael Albinus <michael.albinus@gmx.de>
date Wed, 10 Feb 2010 09:46:54 +0100
parents 1d1d5d9bd884
children 988b3f9a342a cda2045a5ee8
comparison
equal deleted inserted replaced
107117:8839cd62c3d2 107118:68c91c0692df
398 (ls-lisp-insert-directory 398 (ls-lisp-insert-directory
399 elt switches time-index wildcard-regexp full-directory-p))))) 399 elt switches time-index wildcard-regexp full-directory-p)))))
400 ;; If not full-directory-p, FILE *must not* end in /, as 400 ;; If not full-directory-p, FILE *must not* end in /, as
401 ;; file-attributes will not recognize a symlink to a directory, 401 ;; file-attributes will not recognize a symlink to a directory,
402 ;; so must make it a relative filename as ls does: 402 ;; so must make it a relative filename as ls does:
403 (if (file-name-absolute-p file) (setq file (expand-file-name file)))
403 (if (eq (aref file (1- (length file))) ?/) 404 (if (eq (aref file (1- (length file))) ?/)
404 (setq file (substring file 0 -1))) 405 (setq file (substring file 0 -1)))
405 (let ((fattr (file-attributes file 'string))) 406 (let ((fattr (file-attributes file 'string)))
406 (if fattr 407 (if fattr
407 (insert (ls-lisp-format file fattr (nth 7 fattr) 408 (insert (ls-lisp-format file fattr (nth 7 fattr)