[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8795: 24.0.50; `completion-try-completion' addition of METADATA arg

From: Drew Adams
Subject: bug#8795: 24.0.50; `completion-try-completion' addition of METADATA arg
Date: Mon, 6 Jun 2011 08:29:51 -0700

> > 1. The addition of arg METADATA, without making it optional, breaks
> > existing code that calls the function with only the first four args.
> Indeed, it was meant as an internal function, tho clearly it was never
> fully internal since icomplete uses it.
> I'll see how I can fix it, but in the mean time, could you tell me how
> you use it (I can guess the "where" is "icicles")?

I use it here:

1. icomplete+.el
in the Emacs 23+ definition of `icomplete-completions':

(let* ((mdata  (and (fboundp 'completion--field-metadata)
        (if (fboundp 'completion--field-metadata) ; Emacs 24
             name comps nil (length name) mdata)
           name comps nil (length name))))

2. icicles-fn.el
in the definitions of `icicle-completion-(all|try)-completion(s)':

(let* ((mdata  (and (fboundp 'completion--field-metadata)
                    (or metadata  (completion--field-metadata
       (res    (if (fboundp 'completion--field-metadata) ; Emacs 24
                    string table pred point mdata)
                  string table pred point))))

[similarly for `...try...']

Functions `icicle-completion-(all|try)-completion(s)' are used by functions
`icicle-prefix-any(-file-name)-candidates-p' (in the same file).

Here is a typical use:

(if (icicle-not-basic-prefix-completion-p)
     input minibuffer-completion-table
     (length input)
     (and (fboundp 'completion--field-metadata)
          (completion--field-metadata ; Emacs 24
  (try-completion input minibuffer-completion-table

`icicle-not-basic-prefix-completion-p' returns non-nil if the user chooses to
take advantage of Emacs 23+ `completion-styles' etc.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]