GNU bug report logs -
#12852
24.2; `exit-function' not supported in completion table's metadata alist
Previous Next
Reported by: Leo <sdl.web <at> gmail.com>
Date: Sat, 10 Nov 2012 07:30:01 UTC
Severity: minor
Tags: wontfix
Found in version 24.2
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On 2012-11-11 06:33 +0800, Stefan Monnier wrote:
> AFAIK, the exit-function is a global property that applies to the whole
> completion, whereas the annotation function is related to the
> all-completions output, which can vary depending on where point is
> (e.g. in file-name completion the *Completions* buffer may list files or
> envvars, so you may need two different annotation-functions).
>
> Hence the exit-function doesn't make much sense in the completion
> table's metadata.
It still seems inconsistent to me.
I am finding myself writing this in order to group related code.
(cond
((eq action 'metadata)
(make-local-variable 'completion-extra-properties)
(setq completion-extra-properties
(plist-put 'completion-extra-properties :exit-function
(lambda (comp status)
(when (cadr (assoc (car (last (split-string comp "[.]" t)))
python-module--completion-table))
(minibuffer-message "package")))))
'(metadata
(annotation-function
. (lambda (comp)
(when (cadr (assoc comp python-module--completion-table))
" <P>")))))
.......)
Otherwise I'd have to go to completing-read, xxxxx-completion-at-point
and the like to install the exit-function on each one of them. This is
repetitive and ugly.
I was hoping I could just write
(cond
((eq action 'metadata)
'(metadata
(annotation-function
. (lambda (comp)
(when (cadr (assoc comp python-module--completion-table))
" <P>")))
(exit-function
. (lambda (comp status)
(when (cadr (assoc (car (last (split-string comp "[.]" t)))
python-module--completion-table))
(minibuffer-message "package"))))))
.......)
Looks like with some change to completion--done we can have this. What
do you think?
Leo
This bug report was last modified 3 years and 187 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.