emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] allow wildcards in file names of cons arg to `dired'


From: Drew Adams
Subject: [PATCH] allow wildcards in file names of cons arg to `dired'
Date: Sun, 26 Sep 2010 11:03:45 -0700

You can pass a cons arg to `dired', to have it create a Dired buffer that shows
only the files in the cdr of that cons (and with buffer name the car of the
cons).  Very useful (and hardly documented).

But currently those file names must be literal names - no wildcards.  For
example, try this: (dired '("TTTT" "111.el" "b*.el")), assuming there is a file
111.el and some file(s) matching b*.el (but no file with name "b*.el", i.e. with
a literal `*' in the name).

An error is raised, because `dired' treats `b*.el' as a literal file name
instead of globbing it.  It would be nice to show a Dired buffer named "TTTT"
listing file 111.el and all of the files whose names match b*.el.

See also bug #7027.  It reports only that the error msg shown when a wildcard is
used this way is a bad msg: It should say "b*.el: doesn't exist or is
inaccessible" (just as it does for other non-existent files), but instead it
barfs: "(wrong-type-arg stringp nil)".

But why shouldn't we allow wildcards in the file names of the cons, and not just
in a directory name?  That can be very handy.

Attached are tiny patches for `dired.el' and `ls-lisp.el' that implement this
feature for MS Windows (`ls-lisp.el' defines `insert-directory' on Windows).  

To implement this fully on non-Windows platforms, some changes would no doubt
also be needed to the version of `insert-directory' in `files.el'.  I cannot do
that part, but I hope that someone else can and will.

Attachment: dired-2010-09-26.patch
Description: Binary data

Attachment: ls-lisp-2010-09-26.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]