GNU bug report logs - #17559
`initials' does not complete underscore delimited input

Previous Next

Package: emacs;

Reported by: Andreas Politz <politza <at> hochschule-trier.de>

Date: Fri, 23 May 2014 14:49:02 UTC

Severity: wishlist

Found in version 24.3.50

To reply to this bug, email your comments to 17559 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#17559; Package emacs. (Fri, 23 May 2014 14:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas Politz <politza <at> hochschule-trier.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 23 May 2014 14:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Politz <politza <at> hochschule-trier.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50;
 Partial completion does not complete underscore delimited input 
Date: Fri, 23 May 2014 16:47:51 +0200
The documentation for the customizable variable
`completion-pcm-word-delimiters' states:
``"A string of characters treated as word delimiters for completion.''

The default value contains _ , yet it does not seem to work, i.e.

(let ((completion-styles '(partial)))
  (completion-initials-all-completions "fdh" '("friss_die_haelfte") nil 0))
=> nil
(let ((completion-styles '(partial)))
  (completion-initials-all-completions "fdh" '("friss-die-haelfte") nil 0))
=> ("friss-die-haelfte" . 0)

It would be nice for c-mode, if this could be made working.

Grüße,

A. Politz




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17559; Package emacs. (Fri, 23 May 2014 15:48:02 GMT) Full text and rfc822 format available.

Message #8 received at 17559 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Andreas Politz <politza <at> hochschule-trier.de>
Cc: 17559 <at> debbugs.gnu.org
Subject: Re: bug#17559: 24.3.50;
 Partial completion does not complete underscore delimited input
Date: Fri, 23 May 2014 11:47:20 -0400
retitle 17559 `initials' does not complete underscore delimited input
severity 17559 wishlist
thanks

> The documentation for the customizable variable
> `completion-pcm-word-delimiters' states:
> ``"A string of characters treated as word delimiters for completion.''
> The default value contains _ , yet it does not seem to work, i.e.

This variable just means that "a_b_c" can be completed by
`partial-completion' style to "alonzo_bob_church" and indeed, that
works, AFAICT.

> (let ((completion-styles '(partial)))
>   (completion-initials-all-completions "fdh" '("friss_die_haelfte") nil 0))

[ completion-styles is used to decide which completion-*-all-completions
  to call, but completion-initials-all-completions should be unaffected by
  completion-styles (and indeed, it isn't, and `partial' is not a valid
  completion style, AFAIK). ]

> => nil

Indeed, completion-initials-all-completions hard-codes "-" as the
separator (you can see it in completion-initials-expand).


        Stefan




Changed bug title to '`initials' does not complete underscore delimited input' from '24.3.50; Partial completion does not complete underscore delimited input ' Request was from Stefan Monnier <monnier <at> iro.umontreal.ca> to control <at> debbugs.gnu.org. (Fri, 23 May 2014 15:48:03 GMT) Full text and rfc822 format available.

Severity set to 'wishlist' from 'normal' Request was from Stefan Monnier <monnier <at> iro.umontreal.ca> to control <at> debbugs.gnu.org. (Fri, 23 May 2014 15:48:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17559; Package emacs. (Fri, 23 May 2014 17:59:01 GMT) Full text and rfc822 format available.

Message #15 received at 17559 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Politz <politza <at> hochschule-trier.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 17559 <at> debbugs.gnu.org
Subject: Re: bug#17559: 24.3.50;
 Partial completion does not complete underscore delimited input
Date: Fri, 23 May 2014 19:57:56 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> retitle 17559 `initials' does not complete underscore delimited input
> severity 17559 wishlist
> thanks
>

> [...] "a_b_c" can be completed by
> `partial-completion' style to "alonzo_bob_church" [...]
>

Yes, you're right.

Andreas





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17559; Package emacs. (Fri, 23 May 2014 18:20:02 GMT) Full text and rfc822 format available.

Message #18 received at 17559 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Politz <politza <at> hochschule-trier.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 17559 <at> debbugs.gnu.org
Subject: Re: bug#17559: 24.3.50;
 Partial completion does not complete underscore delimited input
Date: Fri, 23 May 2014 20:19:14 +0200
[Message part 1 (text/plain, inline)]
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> severity 17559 wishlist

Would something like the following be sufficient ?

[vc.diff (text/x-diff, inline)]
=== modified file 'lisp/minibuffer.el'
*** lisp/minibuffer.el	2013-10-04 02:12:16 +0000
--- lisp/minibuffer.el	2014-05-23 18:14:44 +0000
***************
*** 3187,3193 ****
                  (string-match completion-pcm--delim-wild-regex str
                                (car bounds)))
        (if (zerop (car bounds))
!           (mapconcat 'string str "-")
          ;; If there's a boundary, it's trickier.  The main use-case
          ;; we consider here is file-name completion.  We'd like
          ;; to expand ~/eee to ~/e/e/e and /eee to /e/e/e.
--- 3187,3200 ----
                  (string-match completion-pcm--delim-wild-regex str
                                (car bounds)))
        (if (zerop (car bounds))
!           (let ((separator
!                  (or (completion-metadata-get
!                       (completion-metadata str table pred)
!                       'completion-initials-separator)
!                      (plist-get completion-extra-properties
!                                 :completion-initials-separator)
!                      "-")))
!             (mapconcat 'string str separator))
          ;; If there's a boundary, it's trickier.  The main use-case
          ;; we consider here is file-name completion.  We'd like
          ;; to expand ~/eee to ~/e/e/e and /eee to /e/e/e.

[Message part 3 (text/plain, inline)]
This appears to work, but I have little clue about the underlying
partial completion matching algorithm.

Andreas

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17559; Package emacs. (Thu, 19 Jun 2014 21:42:02 GMT) Full text and rfc822 format available.

Message #21 received at 17559 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Andreas Politz <politza <at> hochschule-trier.de>
Cc: 17559 <at> debbugs.gnu.org
Subject: Re: bug#17559: 24.3.50;
 Partial completion does not complete underscore delimited input
Date: Thu, 19 Jun 2014 17:41:32 -0400
> Would something like the following be sufficient ?
[...]
> !           (let ((separator
> !                  (or (completion-metadata-get
> !                       (completion-metadata str table pred)
> !                       'completion-initials-separator)
> !                      (plist-get completion-extra-properties
> !                                 :completion-initials-separator)
> !                      "-")))

It could work, tho it requires changing all the corresponding completion
tables to provide the other "filling" when needed.
I think this should be fixable/fixed without needing to touch the
completion tables.

And if we add such `completion-initials-separator' properties, we'll be
stuck with them "for ever", so I'd rather not go there if there's
a chance we might not need them.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17559; Package emacs. (Wed, 31 Aug 2016 19:28:01 GMT) Full text and rfc822 format available.

Message #24 received at 17559 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Politz <politza <at> hochschule-trier.de>
To: 17559 <at> debbugs.gnu.org
Subject: Re: bug#17559: 24.3.50;
 Partial completion does not complete underscore delimited input
Date: Wed, 31 Aug 2016 21:27:22 +0200
Coming back to this...

What do you think, where should the information regarding the string to use as
a separator for the initials style come from, if it's not hard-coded ?

Andreas




This bug report was last modified 8 years and 286 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.