all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* filename input wildcard `?'
@ 2005-10-26  1:37 Drew Adams
  2005-10-27  1:29 ` Richard M. Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Drew Adams @ 2005-10-26  1:37 UTC (permalink / raw)


The Emacs manual says this in node Visiting:

  If the file name you specify contains shell-style wildcard
  characters, Emacs visits all the files that match it.  Wildcards
  include `?', `*', and `[...]' sequences.

No examples of using wildcard `?' are given, but presumably you would type
`foo?.el' if you wanted to match all files `foo3.el', `fooz.el', and so on.

However, `?' is bound in the minibuffer completion keymaps to
`minibuffer-completion-help' - so how can you type `foo?.el'?

The only ways I've found to input `foo?.el' are:

 1) to copy it as text and then paste it into the minibuffer
 2) to use ^Q to insert the `?'

Is that right, or am I missing something?

If these are the only ways to input a `?' as a file-name wildcard, shouldn't
this be mentioned in the Emacs manual? As it stands, it gives (me) the
impression that you can just type `foo?.el', which you cannot (AFAICT).

It would also be good to have an example of `[...]' wildcard use. The aim is
not to give a course on shell wildcards, but a short example of each would
help.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: filename input wildcard `?'
  2005-10-26  1:37 filename input wildcard `?' Drew Adams
@ 2005-10-27  1:29 ` Richard M. Stallman
  2005-10-27 15:39   ` Drew Adams
  0 siblings, 1 reply; 4+ messages in thread
From: Richard M. Stallman @ 2005-10-27  1:29 UTC (permalink / raw)
  Cc: emacs-devel

    If these are the only ways to input a `?' as a file-name wildcard, shouldn't
    this be mentioned in the Emacs manual? As it stands, it gives (me) the
    impression that you can just type `foo?.el', which you cannot (AFAICT).

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: filename input wildcard `?'
  2005-10-27  1:29 ` Richard M. Stallman
@ 2005-10-27 15:39   ` Drew Adams
  2005-10-28 16:18     ` Richard M. Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Drew Adams @ 2005-10-27 15:39 UTC (permalink / raw)


        If these are the only ways to input a `?' as a file-name
        wildcard, shouldn't this be mentioned in the Emacs manual?
        As it stands, it gives (me) the impression that you can
        just type `foo?.el', which you cannot (AFAICT).

    Thanks.

Thank you.


I don't really want to open a can of worms, so ignore this if you think it's
a bad idea or controversial: I wonder if we might consider allowing `?' to
be bound, in the minibuffer, to `self-insert-command' instead of
`minibuffer-completion-help', and use `C-h' for
`minibuffer-completion-help'?

That is:

(define-key minibuffer-local-completion-map
            "?" 'self-insert-command)
(define-key minibuffer-local-completion-map
            [remap help-command] 'minibuffer-completion-help)

Advantages:

1) `?' would be available, without `C-q' quoting, not only as a file-name
wildcard, but also as a normal, self-insertable character, for inclusion in
command names, buffer names, menu items, data-entry values, ... , _any_
input for `completing-read'.

Function `completing-read' is general, and it can be used by programmers for
many different applications - why should it treat `?' specially when typed
as input? If a programmer using `completing-read' wants to let users type
`?' as input (without quoting), he must currently jump through a few hoops
to make that happen.

2) `C-h' is a control character, not a printable character. It rarely needs
to be included in an input string. Anyone wanting to include it will likely
know about using `C-q' (which is not true for people typing `?').

3) `C-h' (or <f1>) is more likely to be people's first guess at finding
completion help. Except for those already in the habit, people are unlikely
to expect `?' to do what it does now.

4) Less potential confusion. Currently, if people do `C-h' during minibuffer
completion (perhaps by accident):

 a. They are prompted for another help-command character. ("Huh, whatzis?")

 b. The help command is processed. ("Whereami now?")

 c. They end up back in minibuffer completion. They need to look for, and
notice, the minibuffer prompt, to recognize this (probably unexpected)
state. It's easy to mistakenly think you're back at top level. ("Ah, finally
back home, safe. ?!*??@!! whatzis?")

This current behavior can be disorienting to the uninitiated - and some of
the `help-for-help' options can disorient more than others, taking users far
afield of minibuffer input and completion (imagine reading the News, then
coming back to minibuffer completion!).

Better to have `C-h' do only one, simple thing, and that one help action to
be specific to input completion. People can always exit the minibuffer first
(`C-g'), if they really want `help-for-help' or one of the other global help
commands.

Disadvantages: ?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: filename input wildcard `?'
  2005-10-27 15:39   ` Drew Adams
@ 2005-10-28 16:18     ` Richard M. Stallman
  0 siblings, 0 replies; 4+ messages in thread
From: Richard M. Stallman @ 2005-10-28 16:18 UTC (permalink / raw)
  Cc: emacs-devel

    I don't really want to open a can of worms, so ignore this if you think it's
    a bad idea or controversial: I wonder if we might consider allowing `?' to
    be bound, in the minibuffer, to `self-insert-command' instead of
    `minibuffer-completion-help', and use `C-h' for
    `minibuffer-completion-help'?

I don't like the idea of an incompatible change here.
I don't have time to do the kind of study that would
be needed to judge it.  So we won't make this change.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-10-28 16:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-26  1:37 filename input wildcard `?' Drew Adams
2005-10-27  1:29 ` Richard M. Stallman
2005-10-27 15:39   ` Drew Adams
2005-10-28 16:18     ` Richard M. Stallman

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.