unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Allow non-matching input, but require confirmation
@ 2007-06-29  5:34 Stefan Monnier
  2007-06-29  8:44 ` Herbert Euler
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Stefan Monnier @ 2007-06-29  5:34 UTC (permalink / raw)
  To: emacs-devel


Currently, the `require-match' argument allows three different behaviors:
1) nil = allow any non-matching input.
2) t   = only allow matching input.  Automatically complete
         without confirmation.
3) neither nil nor t =  only allow matching input, but require confirmation
         after automatic completion.

I'd like to add a fourth one:

4) confirm-only = allow any non-matching input but require confirmation
                  if the input is not a valid completion.

Also I propose to use it for reading the file name in `find-file'.


        Stefan

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

* RE: Allow non-matching input, but require confirmation
  2007-06-29  5:34 Allow non-matching input, but require confirmation Stefan Monnier
@ 2007-06-29  8:44 ` Herbert Euler
  2007-06-29 13:46   ` Stefan Monnier
  2007-06-29 22:59 ` Davis Herring
  2007-06-30 15:09 ` Richard Stallman
  2 siblings, 1 reply; 8+ messages in thread
From: Herbert Euler @ 2007-06-29  8:44 UTC (permalink / raw)
  To: monnier, emacs-devel

>4) confirm-only = allow any non-matching input but require confirmation
>                   if the input is not a valid completion.

This strategy seems to encourage valid completions.  Namely, when
valid completions are avaliable and inputed, no confirmation is made.
Otherwise, confirmation is made.  If the input can complete to an
element of collection to make a valid completion, but is not a member
of collection, should we "encourage" the valid completion by
completing the input, or confirm the non-matching input as an invalid
completion?

Regards,
Guanpeng Xu

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/

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

* Re: Allow non-matching input, but require confirmation
  2007-06-29  8:44 ` Herbert Euler
@ 2007-06-29 13:46   ` Stefan Monnier
  2007-06-29 14:58     ` Herbert Euler
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2007-06-29 13:46 UTC (permalink / raw)
  To: Herbert Euler; +Cc: emacs-devel

> This strategy seems to encourage valid completions.  Namely, when
> valid completions are avaliable and inputed, no confirmation is made.
> Otherwise, confirmation is made.  If the input can complete to an
> element of collection to make a valid completion, but is not a member
> of collection, should we "encourage" the valid completion by
> completing the input, or confirm the non-matching input as an invalid
> completion?

No, we don't want to complete at all, we just want to let the user know when
he hits RET whether her input is in the list of completions or not.

For find-file, this amounts to warning the user that she's about to open
a non-existing file, which may be exactly what she wants to do, but may also
be just the result of a typo (in my case, in 90% of the cases, it's a TAB
expansion that completed to "foo." instead of one of foo.c or foo.h, in 9%
of the cases it's a typo and in the 1% percent it's really what I want to
do).


        Stefan

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

* Re: Allow non-matching input, but require confirmation
  2007-06-29 13:46   ` Stefan Monnier
@ 2007-06-29 14:58     ` Herbert Euler
  0 siblings, 0 replies; 8+ messages in thread
From: Herbert Euler @ 2007-06-29 14:58 UTC (permalink / raw)
  To: monnier; +Cc: emacs-devel

>For find-file, this amounts to warning the user that she's about to open
>a non-existing file, which may be exactly what she wants to do, but may 
>also
>be just the result of a typo (in my case, in 90% of the cases, it's a TAB
>expansion that completed to "foo." instead of one of foo.c or foo.h, in 9%
>of the cases it's a typo and in the 1% percent it's really what I want to
>do).

I see.  This is indeed an improvement on usability.  If the input can
be completed more, perhaps we should not only confirm the user about
it is non-matching, but tell the user it can be completed (although
may not be unique) as well.

Regards,
Guanpeng Xu

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/

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

* Re: Allow non-matching input, but require confirmation
  2007-06-29  5:34 Allow non-matching input, but require confirmation Stefan Monnier
  2007-06-29  8:44 ` Herbert Euler
@ 2007-06-29 22:59 ` Davis Herring
  2007-06-30  2:41   ` Stefan Monnier
  2007-06-30 15:09 ` Richard Stallman
  2 siblings, 1 reply; 8+ messages in thread
From: Davis Herring @ 2007-06-29 22:59 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

> Also I propose to use it for reading the file name in `find-file'.

Given the relative harmlessness of "creating" new files, and the relative
ease of C-x C-v, I suppose this should be customizable with
`confirm-new-files' or so, although I'm fine with that defaulting to t.

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.

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

* Re: Allow non-matching input, but require confirmation
  2007-06-29 22:59 ` Davis Herring
@ 2007-06-30  2:41   ` Stefan Monnier
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2007-06-30  2:41 UTC (permalink / raw)
  To: herring; +Cc: emacs-devel

>> Also I propose to use it for reading the file name in `find-file'.
> Given the relative harmlessness of "creating" new files, and the relative
> ease of C-x C-v, I suppose this should be customizable with
> `confirm-new-files' or so, although I'm fine with that defaulting to t.

My experience is that hitting RET RET is really not much of a problem
either, so I'm not convinced there's a need for such a config var.
But if the people want it, I'll grant it to them.


        Stefan

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

* Re: Allow non-matching input, but require confirmation
  2007-06-29  5:34 Allow non-matching input, but require confirmation Stefan Monnier
  2007-06-29  8:44 ` Herbert Euler
  2007-06-29 22:59 ` Davis Herring
@ 2007-06-30 15:09 ` Richard Stallman
  2007-07-01  1:58   ` Stefan Monnier
  2 siblings, 1 reply; 8+ messages in thread
From: Richard Stallman @ 2007-06-30 15:09 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

    I'd like to add a fourth one:

    4) confirm-only = allow any non-matching input but require confirmation
		      if the input is not a valid completion.

That seems good.

    Also I propose to use it for reading the file name in `find-file'.

Let's make this a user option.  Then we can try it out
as an experiment.

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

* Re: Allow non-matching input, but require confirmation
  2007-06-30 15:09 ` Richard Stallman
@ 2007-07-01  1:58   ` Stefan Monnier
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2007-07-01  1:58 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

>     I'd like to add a fourth one:
>     4) confirm-only = allow any non-matching input but require confirmation
> 		      if the input is not a valid completion.

> That seems good.

>     Also I propose to use it for reading the file name in `find-file'.

> Let's make this a user option.  Then we can try it out
> as an experiment.

Installed.


        Stefan

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

end of thread, other threads:[~2007-07-01  1:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-29  5:34 Allow non-matching input, but require confirmation Stefan Monnier
2007-06-29  8:44 ` Herbert Euler
2007-06-29 13:46   ` Stefan Monnier
2007-06-29 14:58     ` Herbert Euler
2007-06-29 22:59 ` Davis Herring
2007-06-30  2:41   ` Stefan Monnier
2007-06-30 15:09 ` Richard Stallman
2007-07-01  1:58   ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).