comparison lisp/ls-lisp.el @ 78039:ed97a96f45fc

(insert-directory): Don't treat FILE as a wildcard if FILE exists as a directory.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 23 Jun 2007 09:51:18 +0000
parents 3e2de8648d07
children 0ef88721691e e870f4d7bcdb
comparison
equal deleted inserted replaced
78038:7332bae5b7e7 78039:ed97a96f45fc
227 (setq switches (delete ?- (append switches nil))) 227 (setq switches (delete ?- (append switches nil)))
228 ;; Sometimes we get ".../foo*/" as FILE. While the shell and 228 ;; Sometimes we get ".../foo*/" as FILE. While the shell and
229 ;; `ls' don't mind, we certainly do, because it makes us think 229 ;; `ls' don't mind, we certainly do, because it makes us think
230 ;; there is no wildcard, only a directory name. 230 ;; there is no wildcard, only a directory name.
231 (if (and ls-lisp-support-shell-wildcards 231 (if (and ls-lisp-support-shell-wildcards
232 (string-match "[[?*]" file)) 232 (string-match "[[?*]" file)
233 ;; Prefer an existing directory to wildcards, like
234 ;; dired-noselect does.
235 (not (file-directory-p file)))
233 (progn 236 (progn
234 (or (not (eq (aref file (1- (length file))) ?/)) 237 (or (not (eq (aref file (1- (length file))) ?/))
235 (setq file (substring file 0 (1- (length file))))) 238 (setq file (substring file 0 (1- (length file)))))
236 (setq wildcard t))) 239 (setq wildcard t)))
237 (if wildcard 240 (if wildcard