unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* PC-do-completion weird behavior acronym expansion.
@ 2007-08-22 22:34 Michaël Cadilhac
  2007-08-22 22:43 ` Sean O'Rourke
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Michaël Cadilhac @ 2007-08-22 22:34 UTC (permalink / raw)
  To: emacs-devel, sorourke


[-- Attachment #1.1: Type: text/plain, Size: 898 bytes --]

The following change :

2007-08-07  Sean O'Rourke  <sorourke@cs.ucsd.edu>

     * complete.el (PC-lisp-complete-symbol): Complete symbol around point.
     (PC-do-completion): Add "acronym completion" for symbols and
     filenames, so e.g. "mvbl" expands to "make-variable-buffer-local".

seems to introduce a little (but annoying) bug :

Before that change :
M-x fin-fi RET
Find file: ~/src/emacs/lisp/
Now :
M-x fin-fi RET 
M-x find-file

PC-do-completion is a magic function to me, so I just can't debug this
thing.  Sean, maybe you have an idea ?

-- 
 |   Michaël `Micha' Cadilhac       |   ChangeLog entry for typo fixes:      |
 |   http://michael.cadilhac.name   |       « Anal retentive pickiness       |
 |   JID/MSN:                       |        	   on my part. »               |
 `----  michael.cadilhac@gmail.com  |          -- Stefan Monnier        -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: PC-do-completion weird behavior acronym expansion.
  2007-08-22 22:34 PC-do-completion weird behavior acronym expansion Michaël Cadilhac
@ 2007-08-22 22:43 ` Sean O'Rourke
  2007-08-25 21:24 ` Sean O'Rourke
  2007-09-03 11:52 ` Romain Francoise
  2 siblings, 0 replies; 8+ messages in thread
From: Sean O'Rourke @ 2007-08-22 22:43 UTC (permalink / raw)
  To: Michaël Cadilhac; +Cc: emacs-devel

michael@cadilhac.name (Michaël Cadilhac) writes:
> seems to introduce a little (but annoying) bug :
>
> Before that change :
> M-x fin-fi RET
> Find file: ~/src/emacs/lisp/
> Now :
> M-x fin-fi RET 
> M-x find-file
>
> PC-do-completion is a magic function to me, so I just can't debug this
> thing.  Sean, maybe you have an idea ?

PC-do-completion scares me too, but thanks for the report.  I'll
look into it this week.

/s

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

* Re: PC-do-completion weird behavior acronym expansion.
  2007-08-22 22:34 PC-do-completion weird behavior acronym expansion Michaël Cadilhac
  2007-08-22 22:43 ` Sean O'Rourke
@ 2007-08-25 21:24 ` Sean O'Rourke
  2007-08-26 10:32   ` Michaël Cadilhac
  2007-09-03 11:52 ` Romain Francoise
  2 siblings, 1 reply; 8+ messages in thread
From: Sean O'Rourke @ 2007-08-25 21:24 UTC (permalink / raw)
  To: Michaël Cadilhac; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 354 bytes --]

michael@cadilhac.name (Michaël Cadilhac) writes:
> Before that change :
> M-x fin-fi RET
> Find file: ~/src/emacs/lisp/
> Now :
> M-x fin-fi RET 
> M-x find-file

Please try this patch.

/s

2007-08-25  Sean O'Rourke  <seano@cs.ucsd.edu>

	* complete.el (PC-do-completion): make RET accept a
	  non-unique but complete expansion again.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1153 bytes --]

Index: complete.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/complete.el,v
retrieving revision 1.77
diff -p -u -w -r1.77 complete.el
--- complete.el	7 Aug 2007 03:02:04 -0000	1.77
+++ complete.el	25 Aug 2007 21:20:27 -0000
@@ -831,12 +831,12 @@ GOTO-END is non-nil, however, it instead
                           (setq completion-base-size (if dirname
                                                          dirlength
                                                        (- beg prompt-end))))))
-                             (PC-temp-minibuffer-message " [Next char not unique]"))))))
-           ;; Expansion of filenames is not reversible, so just keep
-           ;; the prefix.
+                             (PC-temp-minibuffer-message " [Next char not unique]"))
+                         ;; Expansion of filenames is not reversible,
+                         ;; so just keep the prefix.
            (when (and abbreviated filename)
              (delete-region (point) end))
-           nil)
+                         nil)))))
 
        ;; Only one possible completion
        (t

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: PC-do-completion weird behavior acronym expansion.
  2007-08-25 21:24 ` Sean O'Rourke
@ 2007-08-26 10:32   ` Michaël Cadilhac
  2007-08-26 19:22     ` Michaël Cadilhac
  0 siblings, 1 reply; 8+ messages in thread
From: Michaël Cadilhac @ 2007-08-26 10:32 UTC (permalink / raw)
  To: Sean O'Rourke; +Cc: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 789 bytes --]

"Sean O'Rourke" <sorourke@cs.ucsd.edu> writes:

> michael@cadilhac.name (Michaël Cadilhac) writes:
>> Before that change :
>> M-x fin-fi RET
>> Find file: ~/src/emacs/lisp/
>> Now :
>> M-x fin-fi RET 
>> M-x find-file
>
> Please try this patch.
>
> /s
>
> 2007-08-25  Sean O'Rourke  <seano@cs.ucsd.edu>
>
> 	* complete.el (PC-do-completion): make RET accept a
> 	  non-unique but complete expansion again.

It works like a charm :-) Thanks !

-- 
 |   Michaël `Micha' Cadilhac       |  21 seems like a good value: half of   |
 |   http://michael.cadilhac.name   |  of 42 and just old enough to drink!   |
 |   JID/MSN:                       |   Why would you want to change it?     |
 `----  michael.cadilhac@gmail.com  |          -- Stefan Monnier        -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: PC-do-completion weird behavior acronym expansion.
  2007-08-26 10:32   ` Michaël Cadilhac
@ 2007-08-26 19:22     ` Michaël Cadilhac
  0 siblings, 0 replies; 8+ messages in thread
From: Michaël Cadilhac @ 2007-08-26 19:22 UTC (permalink / raw)
  To: Sean O'Rourke; +Cc: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 883 bytes --]

michael@cadilhac.name (Michaël Cadilhac) writes:

> "Sean O'Rourke" <sorourke@cs.ucsd.edu> writes:
>
>> michael@cadilhac.name (Michaël Cadilhac) writes:
>>> Before that change :
>>> M-x fin-fi RET
>>> Find file: ~/src/emacs/lisp/
>>> Now :
>>> M-x fin-fi RET 
>>> M-x find-file
>>
>> Please try this patch.
>>
>> /s
>>
>> 2007-08-25  Sean O'Rourke  <seano@cs.ucsd.edu>
>>
>> 	* complete.el (PC-do-completion): make RET accept a
>> 	  non-unique but complete expansion again.
>
> It works like a charm :-) Thanks !

Patch installed.

-- 
 |   Michaël `Micha' Cadilhac       |  «Tu aimeras ton prochain.»            |
 |   http://michael.cadilhac.name   |    D'abord, Dieu ou pas,               |
 |   JID/MSN:                       |       j'ai horreur qu'on me tutoie.    |
 `----  michael.cadilhac@gmail.com  |           -- P. Desproges         -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: PC-do-completion weird behavior acronym expansion.
  2007-08-22 22:34 PC-do-completion weird behavior acronym expansion Michaël Cadilhac
  2007-08-22 22:43 ` Sean O'Rourke
  2007-08-25 21:24 ` Sean O'Rourke
@ 2007-09-03 11:52 ` Romain Francoise
  2007-09-06  4:51   ` Sean O'Rourke
  2 siblings, 1 reply; 8+ messages in thread
From: Romain Francoise @ 2007-09-03 11:52 UTC (permalink / raw)
  To: emacs-devel; +Cc: sorourke, Michaël Cadilhac

michael@cadilhac.name (Michaël Cadilhac) writes:

> The following change :

> 2007-08-07  Sean O'Rourke  <sorourke@cs.ucsd.edu>

>      * complete.el (PC-lisp-complete-symbol): Complete symbol around point.
>      (PC-do-completion): Add "acronym completion" for symbols and
>      filenames, so e.g. "mvbl" expands to "make-variable-buffer-local".

> seems to introduce a little (but annoying) bug [...]

It introduces another annoying bug: hitting TAB when the list of
possible completions is empty signals an error.  For example, if you
do (completing-read "Foo: " nil) and hit TAB, you get:

Debugger entered--Lisp error: (args-out-of-range "" 0 1)
  PC-do-completion(nil)
  PC-complete()
  call-interactively(PC-complete)
  completing-read("Foo: " nil)
  eval((completing-read "Foo: " nil))
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp)

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

* Re: PC-do-completion weird behavior acronym expansion.
  2007-09-03 11:52 ` Romain Francoise
@ 2007-09-06  4:51   ` Sean O'Rourke
  2007-09-06 17:12     ` Romain Francoise
  0 siblings, 1 reply; 8+ messages in thread
From: Sean O'Rourke @ 2007-09-06  4:51 UTC (permalink / raw)
  To: emacs-devel; +Cc: Michaël Cadilhac

[-- Attachment #1: Type: text/plain, Size: 830 bytes --]

Romain Francoise <romain@orebokech.com> writes:

> michael@cadilhac.name (Michaël Cadilhac) writes:
>
>> The following change :
>
>> 2007-08-07  Sean O'Rourke  <sorourke@cs.ucsd.edu>
>
>>      * complete.el (PC-lisp-complete-symbol): Complete symbol around point.
>>      (PC-do-completion): Add "acronym completion" for symbols and
>>      filenames, so e.g. "mvbl" expands to "make-variable-buffer-local".
>
>> seems to introduce a little (but annoying) bug [...]
>
> It introduces another annoying bug: hitting TAB when the list of
> possible completions is empty signals an error.

Yeah, that does suck -- my apologies.  Please try the attached
patch.

/s

2007-09-05  Sean O'Rourke  <sorourke@cs.ucsd.edu>

	* complete.el (PC-do-completion): don't try to treat
	  empty string as an abbreviation.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 823 bytes --]

Index: complete.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/complete.el,v
retrieving revision 1.78
diff -p -u -w -r1.78 complete.el
--- complete.el	26 Aug 2007 19:20:10 -0000	1.78
+++ complete.el	6 Sep 2007 04:49:05 -0000
@@ -596,9 +596,10 @@ GOTO-END is non-nil, however, it instead
           (setq poss (all-completions (if env-on basestr str)
 				      table
 				      pred))
-          (unless poss
+          (unless (or poss (string-equal str ""))
             ;; Try completion as an abbreviation, e.g. "mvb" ->
-            ;; "m-v-b" -> "multiple-value-bind"
+            ;; "m-v-b" -> "multiple-value-bind", but only for
+            ;; non-empty strings.
             (setq origstr str
                   abbreviated t)
             (if filename

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: PC-do-completion weird behavior acronym expansion.
  2007-09-06  4:51   ` Sean O'Rourke
@ 2007-09-06 17:12     ` Romain Francoise
  0 siblings, 0 replies; 8+ messages in thread
From: Romain Francoise @ 2007-09-06 17:12 UTC (permalink / raw)
  To: Sean O'Rourke; +Cc: emacs-devel

"Sean O'Rourke" <sorourke@cs.ucsd.edu> writes:

> 2007-09-05  Sean O'Rourke  <sorourke@cs.ucsd.edu>
>
> 	* complete.el (PC-do-completion): don't try to treat
> 	  empty string as an abbreviation.

Thanks, that fixes it.  Installed.

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

end of thread, other threads:[~2007-09-06 17:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-22 22:34 PC-do-completion weird behavior acronym expansion Michaël Cadilhac
2007-08-22 22:43 ` Sean O'Rourke
2007-08-25 21:24 ` Sean O'Rourke
2007-08-26 10:32   ` Michaël Cadilhac
2007-08-26 19:22     ` Michaël Cadilhac
2007-09-03 11:52 ` Romain Francoise
2007-09-06  4:51   ` Sean O'Rourke
2007-09-06 17:12     ` Romain Francoise

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