* bug#17559: 24.3.50; Partial completion does not complete underscore delimited input
@ 2014-05-23 14:47 Andreas Politz
2014-05-23 15:47 ` Stefan Monnier
2016-08-31 19:27 ` Andreas Politz
0 siblings, 2 replies; 6+ messages in thread
From: Andreas Politz @ 2014-05-23 14:47 UTC (permalink / raw
To: 17559
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#17559: 24.3.50; Partial completion does not complete underscore delimited input
2014-05-23 14:47 bug#17559: 24.3.50; Partial completion does not complete underscore delimited input Andreas Politz
@ 2014-05-23 15:47 ` Stefan Monnier
2014-05-23 17:57 ` Andreas Politz
2014-05-23 18:19 ` Andreas Politz
2016-08-31 19:27 ` Andreas Politz
1 sibling, 2 replies; 6+ messages in thread
From: Stefan Monnier @ 2014-05-23 15:47 UTC (permalink / raw
To: Andreas Politz; +Cc: 17559
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#17559: 24.3.50; Partial completion does not complete underscore delimited input
2014-05-23 15:47 ` Stefan Monnier
@ 2014-05-23 17:57 ` Andreas Politz
2014-05-23 18:19 ` Andreas Politz
1 sibling, 0 replies; 6+ messages in thread
From: Andreas Politz @ 2014-05-23 17:57 UTC (permalink / raw
To: Stefan Monnier; +Cc: 17559
Stefan Monnier <monnier@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
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#17559: 24.3.50; Partial completion does not complete underscore delimited input
2014-05-23 15:47 ` Stefan Monnier
2014-05-23 17:57 ` Andreas Politz
@ 2014-05-23 18:19 ` Andreas Politz
2014-06-19 21:41 ` Stefan Monnier
1 sibling, 1 reply; 6+ messages in thread
From: Andreas Politz @ 2014-05-23 18:19 UTC (permalink / raw
To: Stefan Monnier; +Cc: 17559
[-- Attachment #1: Type: text/plain, Size: 130 bytes --]
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> severity 17559 wishlist
Would something like the following be sufficient ?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: vc.diff --]
[-- Type: text/x-diff, Size: 1323 bytes --]
=== 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.
[-- Attachment #3: Type: text/plain, Size: 115 bytes --]
This appears to work, but I have little clue about the underlying
partial completion matching algorithm.
Andreas
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#17559: 24.3.50; Partial completion does not complete underscore delimited input
2014-05-23 18:19 ` Andreas Politz
@ 2014-06-19 21:41 ` Stefan Monnier
0 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2014-06-19 21:41 UTC (permalink / raw
To: Andreas Politz; +Cc: 17559
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#17559: 24.3.50; Partial completion does not complete underscore delimited input
2014-05-23 14:47 bug#17559: 24.3.50; Partial completion does not complete underscore delimited input Andreas Politz
2014-05-23 15:47 ` Stefan Monnier
@ 2016-08-31 19:27 ` Andreas Politz
1 sibling, 0 replies; 6+ messages in thread
From: Andreas Politz @ 2016-08-31 19:27 UTC (permalink / raw
To: 17559
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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-08-31 19:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-23 14:47 bug#17559: 24.3.50; Partial completion does not complete underscore delimited input Andreas Politz
2014-05-23 15:47 ` Stefan Monnier
2014-05-23 17:57 ` Andreas Politz
2014-05-23 18:19 ` Andreas Politz
2014-06-19 21:41 ` Stefan Monnier
2016-08-31 19:27 ` Andreas Politz
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.