* Sloppy Directory Completion
@ 2010-03-17 11:41 Nordlöw
2010-03-17 14:18 ` Stefan Monnier
0 siblings, 1 reply; 6+ messages in thread
From: Nordlöw @ 2010-03-17 11:41 UTC (permalink / raw)
To: help-gnu-emacs
Why doesn't Emacs complete on directories only in for example dired (C-
x d)?
Is this a bug or a todo?
Most shells complete directory commands like "cd" with directories
only so why should Emacs do the same?
/Nordlöw
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Sloppy Directory Completion
2010-03-17 11:41 Sloppy Directory Completion Nordlöw
@ 2010-03-17 14:18 ` Stefan Monnier
2010-03-17 15:58 ` Nordlöw
2010-05-05 11:46 ` Ehud Karni
0 siblings, 2 replies; 6+ messages in thread
From: Stefan Monnier @ 2010-03-17 14:18 UTC (permalink / raw)
To: help-gnu-emacs
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Sloppy Directory Completion
2010-03-17 14:18 ` Stefan Monnier
@ 2010-03-17 15:58 ` Nordlöw
2010-05-05 11:46 ` Ehud Karni
1 sibling, 0 replies; 6+ messages in thread
From: Nordlöw @ 2010-03-17 15:58 UTC (permalink / raw)
To: help-gnu-emacs
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))
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Sloppy Directory Completion
2010-03-17 14:18 ` Stefan Monnier
2010-03-17 15:58 ` Nordlöw
@ 2010-05-05 11:46 ` Ehud Karni
2010-05-05 14:53 ` Stefan Monnier
1 sibling, 1 reply; 6+ messages in thread
From: Ehud Karni @ 2010-05-05 11:46 UTC (permalink / raw)
To: monnier; +Cc: help-gnu-emacs
On Wed, 17 Mar 2010 10:18:24 -0400, Stefan Monnier 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.
I don't agree with Stefan.
Many times I do completion on something like "*use*" just to find the
group of files I want see and than use something like "bsw2-use*subgroup"
as the actual argument to `dired'.
Dired is NOT just for Full directories. It works nicely on files
template (I'm sure you know and use it this way too).
May be completion of directory names ONLY should be an option, but
I disagree strongly that it be the default completion.
Ehud.
--
Ehud Karni Tel: +972-3-7966-561 /"\
Mivtach - Simon Fax: +972-3-7976-561 \ / ASCII Ribbon Campaign
Insurance agencies (USA) voice mail and X Against HTML Mail
http://www.mvs.co.il FAX: 1-815-5509341 / \
GnuPG: 98EA398D <http://www.keyserver.net/> Better Safe Than Sorry
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Sloppy Directory Completion
2010-05-05 11:46 ` Ehud Karni
@ 2010-05-05 14:53 ` Stefan Monnier
2010-05-05 14:59 ` Ehud Karni
0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2010-05-05 14:53 UTC (permalink / raw)
To: ehud; +Cc: help-gnu-emacs
>> > 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.
> Many times I do completion on something like "*use*" just to find the
> group of files I want see and than use something like "bsw2-use*subgroup"
> as the actual argument to `dired'.
[...]
> May be completion of directory names ONLY should be an option, but
> I disagree strongly that it be the default completion.
The way I see it, completion for dired should work as follows:
if we can complete to a set of directories, then only complete to
those directories, but if there is no directory to which to complete,
then complete against files.
So in your above example, it would work as you want at the condition
that there is no directory which matches "*use*".
Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Sloppy Directory Completion
2010-05-05 14:53 ` Stefan Monnier
@ 2010-05-05 14:59 ` Ehud Karni
0 siblings, 0 replies; 6+ messages in thread
From: Ehud Karni @ 2010-05-05 14:59 UTC (permalink / raw)
To: monnier; +Cc: help-gnu-emacs
On Wed, 05 May 2010 10:53:21 -0400, Stefan Monnier 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.
> > Many times I do completion on something like "*use*" just to find the
> > group of files I want see and than use something like "bsw2-use*subgroup"
> > as the actual argument to `dired'.
> [...]
> > May be completion of directory names ONLY should be an option, but
> > I disagree strongly that it be the default completion.
>
> The way I see it, completion for dired should work as follows:
> if we can complete to a set of directories, then only complete to
> those directories, but if there is no directory to which to complete,
> then complete against files.
> So in your above example, it would work as you want at the condition
> that there is no directory which matches "*use*".
Sounds good. So move it from "bug" to "todo".
Ehud.
--
Ehud Karni Tel: +972-3-7966-561 /"\
Mivtach - Simon Fax: +972-3-7976-561 \ / ASCII Ribbon Campaign
Insurance agencies (USA) voice mail and X Against HTML Mail
http://www.mvs.co.il FAX: 1-815-5509341 / \
GnuPG: 98EA398D <http://www.keyserver.net/> Better Safe Than Sorry
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-05-05 14:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-17 11:41 Sloppy Directory Completion Nordlöw
2010-03-17 14:18 ` Stefan Monnier
2010-03-17 15:58 ` Nordlöw
2010-05-05 11:46 ` Ehud Karni
2010-05-05 14:53 ` Stefan Monnier
2010-05-05 14:59 ` Ehud Karni
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.