[Top][All Lists]

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

Re: minibuffer-completion-contents obsolete

From: Stefan Monnier
Subject: Re: minibuffer-completion-contents obsolete
Date: Sat, 20 Apr 2013 23:28:53 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> So my question was just: why did you made it obsolete ?

Here's what I think happened:
- before Emacs-22, completion was done on the whole minibuffer content,
  regardless of the position of point.  So `minibuffer-content' returned
  "what completion commands operate on".
- Emacs-22 changed the completion behavior to ignore (and leave
  untouched) any text after point.  So `minibuffer-completion-contents'
  was introduced to return "what completion commands operate on".
- Emacs-23 changed this again such that text after point can be taken
  into account or can be ignored, depending on completion-styles (and
  depending on choices made on a case-by-case basis by those styles).

So, ever since Emacs-23, `minibuffer-completion-contents' returns
something which is not really "what completion commands operate on",
despite what its docstring says.

> Anyway if you decide to make it obsolete, the warning that say to use
> `minibuffer-contents' instead is wrong, they do (as described in doc)
> two different things.

AFAIK the only uses of `minibuffer-completion-contents' that are not
somewhat broken are necessarily unrelated to minibuffer completion.
IOW, the only uses I can think of that are not somewhat broken would
have to basically use it as a way to get "the text before point".
As for why they'd use this function rather than the usual primitives
non-specific to the minibuffer...

This said, I could only find a single use of this function in Emacs
(both 23 and 24), so I doubt it's used very heavily in third
party packages.

Maybe I should remove the message to use `minibuffer-contents'
instead, indeed.

>> What do you use minibuffer-completion-contents for?
> I use it in helm and eldoc-eval.

That says where you use it, but not what you use it for.


reply via email to

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