unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Suggestion on completion
@ 2007-01-13 12:07 Herbert Euler
  2007-01-14  1:57 ` Richard Stallman
  0 siblings, 1 reply; 6+ messages in thread
From: Herbert Euler @ 2007-01-13 12:07 UTC (permalink / raw)


Hello,

The variable `completion-ignored-extensions' controls which file
(directory) names are not to be completed if there are other possible
completions.  However, I found the current strategy of completion on
directory names is not very reasonable.

First, please think about the strategy applied on (non-directory) file
names.  If the name of some file matches an entry in
`completion-ignored-extensions' from its end, it means that the file
is not intended to be edited, at least in most situations.  For
example the extensions ``.o'', ``~'', ``.dvi'', ``.elc''.  If these
names are not completed, it is OK, since for example ``dired.o'' is
not likely to be opened.

I think it is not good to apply the same stragegy to directory names.
There are two entries in `completion-ignored-extensions' that are
directory names by default, i.e. ``.svn/'' and ``CVS/''.  One can, of
course, give a directory the name ``emacs.svn''; or, give a directory
the name ``emacs-cvs'' on systems that ignores case in file
(directory) names.  But this should not prevent the names of the
directories being provided as completion at first.  These directories
are likely to be opened after all.  What are not likely to be opened
are the directories ``.svn/'' and ``CVS/''.

So, is it better to treat two directory names matching iff they are
precisely equal?  If so, I'd like to work on it.

Thanks in advance.

Regards,
Guanpeng Xu

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

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

* Re: Suggestion on completion
  2007-01-13 12:07 Suggestion on completion Herbert Euler
@ 2007-01-14  1:57 ` Richard Stallman
  2007-01-14  2:27   ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Stallman @ 2007-01-14  1:57 UTC (permalink / raw)
  Cc: emacs-devel

    So, is it better to treat two directory names matching iff they are
    precisely equal?  If so, I'd like to work on it.

If we change the meaning of directory names in
`completion-ignored-extensions' so that they are not extensions, the
name would no longer make sense.  So I think it is better to add
a new variable `completion-ignored-names'.  Those names would be
checked for an exact match.

We should not install this until after the release, but you could
write it now.

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

* Re: Suggestion on completion
  2007-01-14  1:57 ` Richard Stallman
@ 2007-01-14  2:27   ` Stefan Monnier
  2007-01-14 13:58     ` Herbert Euler
  2007-01-14 23:23     ` Richard Stallman
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Monnier @ 2007-01-14  2:27 UTC (permalink / raw)
  Cc: Herbert Euler, emacs-devel

> name would no longer make sense.  So I think it is better to add
> a new variable `completion-ignored-names'.  Those names would be
> checked for an exact match.

It could be a regexp rather than a list of precise names.


        Stefan

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

* Re: Suggestion on completion
  2007-01-14  2:27   ` Stefan Monnier
@ 2007-01-14 13:58     ` Herbert Euler
  2007-01-17  1:56       ` Herbert Euler
  2007-01-14 23:23     ` Richard Stallman
  1 sibling, 1 reply; 6+ messages in thread
From: Herbert Euler @ 2007-01-14 13:58 UTC (permalink / raw)
  Cc: emacs-devel

> > name would no longer make sense.  So I think it is better to add
> > a new variable `completion-ignored-names'.  Those names would be
> > checked for an exact match.
>
>It could be a regexp rather than a list of precise names.

Suppose we add a variable `completion-ignored-names-regexp' that a
name would not be provided as a first completion if it matches one of
the names in this variable and there are other names that does not
matches any names in this variable.

Then we can say that, the cases that `completion-ignored-extensions'
and `completion-ignored-names' can handle are only special cases, or
``subsets'' that `completion-ignored-names-regexp' can handle.

How about adding the variable `completion-ignored-names-regexp', and
making `completion-ignored-extensions' a deprecated variable and the
same as `completion-ignored-names-regexp'?

Regards,
Guanpeng Xu

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

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

* Re: Suggestion on completion
  2007-01-14  2:27   ` Stefan Monnier
  2007-01-14 13:58     ` Herbert Euler
@ 2007-01-14 23:23     ` Richard Stallman
  1 sibling, 0 replies; 6+ messages in thread
From: Richard Stallman @ 2007-01-14 23:23 UTC (permalink / raw)
  Cc: herberteuler, emacs-devel

    > name would no longer make sense.  So I think it is better to add
    > a new variable `completion-ignored-names'.  Those names would be
    > checked for an exact match.

    It could be a regexp rather than a list of precise names.

Yes, that could also be a good way to do it.
After the release.

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

* Re: Suggestion on completion
  2007-01-14 13:58     ` Herbert Euler
@ 2007-01-17  1:56       ` Herbert Euler
  0 siblings, 0 replies; 6+ messages in thread
From: Herbert Euler @ 2007-01-17  1:56 UTC (permalink / raw)
  Cc: emacs-devel

>> > name would no longer make sense.  So I think it is better to add
>> > a new variable `completion-ignored-names'.  Those names would be
>> > checked for an exact match.
>>
>>It could be a regexp rather than a list of precise names.
>
>Suppose we add a variable `completion-ignored-names-regexp' that a
>name would not be provided as a first completion if it matches one of
>the names in this variable and there are other names that do not
>match any names in this variable.
>
>Then we can say that, the cases that `completion-ignored-extensions'
>and `completion-ignored-names' can handle are only special cases, or
>``subsets'' that `completion-ignored-names-regexp' can handle.
>
>How about adding the variable `completion-ignored-names-regexp', and
>making `completion-ignored-extensions' a deprecated variable and the
>same as `completion-ignored-names-regexp'?

Please give me suggestions on this design, especially on making the
deprecated variable.  I'm not sure whether it is Ok along with Emacs'
policy, and I think Stefan's way is really elegant.  I need an
approach from discussing, or I cannot start writing.

Thanks.

Regards,
Guanpeng Xu

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

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

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

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-13 12:07 Suggestion on completion Herbert Euler
2007-01-14  1:57 ` Richard Stallman
2007-01-14  2:27   ` Stefan Monnier
2007-01-14 13:58     ` Herbert Euler
2007-01-17  1:56       ` Herbert Euler
2007-01-14 23:23     ` Richard Stallman

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).