unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Two problems of completion
@ 2008-04-30  2:57 Herbert Euler
  2008-04-30  3:47 ` Stefan Monnier
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Herbert Euler @ 2008-04-30  2:57 UTC (permalink / raw)
  To: emacs-devel


Currently SPC is bound to minibuffer-complete-word in minibuffer.
With partial completion facilities implemented for minibuffer, I don't
know whether it is still right to bind SPC to this command, but if so
I find two problems.

1. Special case: the string before completion is the empty string "".

In this case, completion--try-word-completion will see a completion
available, i.e. ("" . 0), and then try firstly completing with " " (""
+ " ") and then "-" ("" + "-").  Partial completion often (e.g. in a
command execution context, i.e. typing M-x then typing SPC) returns a
result of ("-" . 0), make a completion available.

I think when the user press SPC directly in such a case, it means that
the user wants to see a list of available completions, instead of
wanting a partially completed word.  So this case might need special
handling.

2. Minibuffer content rewriting.

The current minibuffer content rewriting facility in
completion--do-completion seems not for partial completion.  Partial
completion normally returns 0 as completion point, e.g. ("org--" . 0),
so a rewriting may look like this (`|' means the position of cursor):

  M-x org-|
  (typing SPC)
  M-x |org--
  (typing SPC again, a surprising result from an attempt of completing
   an empty string):
  M-x -org-|-

Something is apparently wrong.

Regards,
Guanpeng Xu
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us




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

* Re: Two problems of completion
  2008-04-30  2:57 Two problems of completion Herbert Euler
@ 2008-04-30  3:47 ` Stefan Monnier
  2008-04-30 22:01 ` Richard M Stallman
  2008-05-23 15:20 ` Stefan Monnier
  2 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2008-04-30  3:47 UTC (permalink / raw)
  To: Herbert Euler; +Cc: emacs-devel

> Currently SPC is bound to minibuffer-complete-word in minibuffer.
> With partial completion facilities implemented for minibuffer, I don't
> know whether it is still right to bind SPC to this command, but if so
> I find two problems.

> 1. Special case: the string before completion is the empty string "".

> In this case, completion--try-word-completion will see a completion
> available, i.e. ("" . 0), and then try firstly completing with " " (""
> + " ") and then "-" ("" + "-").  Partial completion often (e.g. in a
> command execution context, i.e. typing M-x then typing SPC) returns a
> result of ("-" . 0), make a completion available.

> I think when the user press SPC directly in such a case, it means that
> the user wants to see a list of available completions, instead of
> wanting a partially completed word.  So this case might need special
> handling.

Yes, it looks like a poor situation indeed.  Then again pressing SPC at
an empty minibuffer might be because you do want to insert a leading SPC
(to enter the name of a hidden buffer, for example).

I see that `partial-completion-mode' suffers from the same problem.

Hmm... not sure what to do.


> 2. Minibuffer content rewriting.

> The current minibuffer content rewriting facility in
> completion--do-completion seems not for partial completion.

I've just fixed a bug w.r.t computation of the new position of point
after completion.   I believe that's what you were experiencing,


        Stefan




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

* Re: Two problems of completion
  2008-04-30  2:57 Two problems of completion Herbert Euler
  2008-04-30  3:47 ` Stefan Monnier
@ 2008-04-30 22:01 ` Richard M Stallman
  2008-05-23 15:20 ` Stefan Monnier
  2 siblings, 0 replies; 5+ messages in thread
From: Richard M Stallman @ 2008-04-30 22:01 UTC (permalink / raw)
  To: Herbert Euler; +Cc: emacs-devel

    Currently SPC is bound to minibuffer-complete-word in minibuffer.
    With partial completion facilities implemented for minibuffer, I don't
    know whether it is still right to bind SPC to this command,

Partial completion facilities are an optional mode, so they have no
effect on the question of the default binding of SPC.

Thanks for reporting the bugs.




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

* Re: Two problems of completion
  2008-04-30  2:57 Two problems of completion Herbert Euler
  2008-04-30  3:47 ` Stefan Monnier
  2008-04-30 22:01 ` Richard M Stallman
@ 2008-05-23 15:20 ` Stefan Monnier
  2008-05-23 16:12   ` Herbert Euler
  2 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2008-05-23 15:20 UTC (permalink / raw)
  To: Herbert Euler; +Cc: emacs-devel

> 1. Special case: the string before completion is the empty string "".

> In this case, completion--try-word-completion will see a completion
> available, i.e. ("" . 0), and then try firstly completing with " " (""
> + " ") and then "-" ("" + "-").  Partial completion often (e.g. in a
> command execution context, i.e. typing M-x then typing SPC) returns a
> result of ("-" . 0), make a completion available.

> I think when the user press SPC directly in such a case, it means that
> the user wants to see a list of available completions, instead of
> wanting a partially completed word.  So this case might need special
> handling.

I've installed a workaround for this situation: if the minibuffer is
empty, and SPC tries to add a " " or a "-", it turns off
partial-completion while doing it.


        Stefan





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

* RE: Two problems of completion
  2008-05-23 15:20 ` Stefan Monnier
@ 2008-05-23 16:12   ` Herbert Euler
  0 siblings, 0 replies; 5+ messages in thread
From: Herbert Euler @ 2008-05-23 16:12 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel


>> 1. Special case: the string before completion is the empty string "".
>  
>> In this case, completion--try-word-completion will see a completion
>> available, i.e. ("" . 0), and then try firstly completing with " " (""
>> + " ") and then "-" ("" + "-"). Partial completion often (e.g. in a
>> command execution context, i.e. typing M-x then typing SPC) returns a
>> result of ("-" . 0), make a completion available.
>  
>> I think when the user press SPC directly in such a case, it means that
>> the user wants to see a list of available completions, instead of
>> wanting a partially completed word. So this case might need special
>> handling.
>  
> I've installed a workaround for this situation: if the minibuffer is
> empty, and SPC tries to add a " " or a "-", it turns off
> partial-completion while doing it.

Thank you.  I should have replied this thread, but I wanted to read
minibuffer.el in order to say something constructive.  Sadly I still
don't finish reading it, so I did not reply it.  Sorry for the delay.

I've tried it, which works perfectly.

Regards,
Guanpeng Xu
_________________________________________________________________
Explore the seven wonders of the world
http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE




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

end of thread, other threads:[~2008-05-23 16:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-30  2:57 Two problems of completion Herbert Euler
2008-04-30  3:47 ` Stefan Monnier
2008-04-30 22:01 ` Richard M Stallman
2008-05-23 15:20 ` Stefan Monnier
2008-05-23 16:12   ` Herbert Euler

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