unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Thierry Volpiatto <thierry.volpiatto@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: minibuffer-completion-contents obsolete
Date: Sat, 20 Apr 2013 23:28:53 -0400	[thread overview]
Message-ID: <jwvr4i4o9no.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87sj2l2pnz.fsf@gmail.com> (Thierry Volpiatto's message of "Sat,  20 Apr 2013 17:21:52 +0200")

> 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.


        Stefan



  reply	other threads:[~2013-04-21  3:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-20  7:49 minibuffer-completion-contents obsolete Thierry Volpiatto
2013-04-20 14:38 ` Stefan Monnier
2013-04-20 15:21   ` Thierry Volpiatto
2013-04-21  3:28     ` Stefan Monnier [this message]
2013-04-21  4:03       ` Stefan Monnier
2013-04-21  5:31         ` Thierry Volpiatto
2013-04-21  6:07         ` Thierry Volpiatto
2013-04-21  5:14       ` Thierry Volpiatto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvr4i4o9no.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=thierry.volpiatto@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).