[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sloppy Directory Completion
From: |
Nordlöw |
Subject: |
Re: Sloppy Directory Completion |
Date: |
Tue, 04 May 2010 15:42:41 -0000 |
User-agent: |
G2/1.0 |
On 17 mar, 15:18, Stefan Monnier <monn...@iro.umontreal.ca> wrote:
> > Why doesn't Emacs complete on directories only in for example dired
> > (C-x d)?
> > Is this a bug or a todo?
>
> I think it's a bug.
>
> Stefan
Firstly dired should uses dired-read-dir-and-switches which in turn
uses read-directory-name and not read-file-name which we could expect.
I believe this is todo.
Secondly from the definition of read-directory-name we can deduce that
it will not work as long as PREDICATE argument in read-file-name() is
not respected. I wrote about this in another thread today here on
gnu.emacs.help.
/Nordlöw
Definition follows
(defun read-directory-name (prompt &optional dir default-dirname
mustmatch initial)
"..."
(unless dir
(setq dir default-directory))
(read-file-name prompt dir (or default-dirname
(if initial (expand-file-name initial dir)
dir))
mustmatch initial
'file-directory-p))