From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: minibuffer-completion-contents obsolete Date: Sat, 20 Apr 2013 23:28:53 -0400 Message-ID: References: <87vc7hbq12.fsf@gmail.com> <87sj2l2pnz.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1366514938 10724 80.91.229.3 (21 Apr 2013 03:28:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Apr 2013 03:28:58 +0000 (UTC) Cc: emacs-devel@gnu.org To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 21 05:29:03 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UTkxa-0006hK-Jq for ged-emacs-devel@m.gmane.org; Sun, 21 Apr 2013 05:29:02 +0200 Original-Received: from localhost ([::1]:51541 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UTkxa-0007Wb-0R for ged-emacs-devel@m.gmane.org; Sat, 20 Apr 2013 23:29:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UTkxW-0007WW-0L for emacs-devel@gnu.org; Sat, 20 Apr 2013 23:28:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UTkxV-0001rs-2z for emacs-devel@gnu.org; Sat, 20 Apr 2013 23:28:57 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:42557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UTkxU-0001rg-Ur for emacs-devel@gnu.org; Sat, 20 Apr 2013 23:28:57 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFHO+LAd/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLLQcSFBgNJIgeBsEtjVWDNQOkeoFegxM X-IPAS-Result: Av4EABK/CFHO+LAd/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLLQcSFBgNJIgeBsEtjVWDNQOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="7894578" Original-Received: from 206-248-176-29.dsl.teksavvy.com (HELO ceviche.home) ([206.248.176.29]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 20 Apr 2013 23:28:51 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 020A7660E8; Sat, 20 Apr 2013 23:28:53 -0400 (EDT) In-Reply-To: <87sj2l2pnz.fsf@gmail.com> (Thierry Volpiatto's message of "Sat, 20 Apr 2013 17:21:52 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:159069 Archived-At: > 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