From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#8795: 24.0.50; `completion-try-completion' addition of METADATA arg Date: Mon, 6 Jun 2011 08:29:51 -0700 Message-ID: References: <30D5A7793376489C883B10B9D1DFA392@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1307379279 23010 80.91.229.12 (6 Jun 2011 16:54:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 6 Jun 2011 16:54:39 +0000 (UTC) Cc: 8795@debbugs.gnu.org To: "'Stefan Monnier'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 06 18:54:35 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QTd4P-0002Ic-N6 for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Jun 2011 18:54:29 +0200 Original-Received: from localhost ([::1]:35248 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTd4P-0002NY-1J for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Jun 2011 12:54:29 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:47152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTbli-00055R-6G for bug-gnu-emacs@gnu.org; Mon, 06 Jun 2011 11:31:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QTblf-0002B9-Nj for bug-gnu-emacs@gnu.org; Mon, 06 Jun 2011 11:31:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTblf-0002Ay-AQ for bug-gnu-emacs@gnu.org; Mon, 06 Jun 2011 11:31:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QTble-0001nn-GE; Mon, 06 Jun 2011 11:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Jun 2011 15:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8795 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8795-submit@debbugs.gnu.org id=B8795.13073742136870 (code B ref 8795); Mon, 06 Jun 2011 15:31:02 +0000 Original-Received: (at 8795) by debbugs.gnu.org; 6 Jun 2011 15:30:13 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QTbkr-0001ml-8z for submit@debbugs.gnu.org; Mon, 06 Jun 2011 11:30:13 -0400 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QTbko-0001mK-Na for 8795@debbugs.gnu.org; Mon, 06 Jun 2011 11:30:11 -0400 Original-Received: from rtcsinet22.oracle.com (rtcsinet22.oracle.com [66.248.204.30]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p56FU0Jf003387 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 6 Jun 2011 15:30:02 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by rtcsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p56FTwRk014314 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 6 Jun 2011 15:29:59 GMT Original-Received: from abhmt021.oracle.com (abhmt021.oracle.com [141.146.116.30]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p56FTrUH024144; Mon, 6 Jun 2011 10:29:53 -0500 Original-Received: from dradamslap1 (/130.35.179.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 06 Jun 2011 08:29:51 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcwkWgXO9oHkGitlTYC147WtjcSqaAAAJgTQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6090 In-Reply-To: X-Source-IP: rtcsinet22.oracle.com [66.248.204.30] X-CT-RefId: str=0001.0A090207.4DECF27B.0136:SCFSTAT5015188,ss=1,fgs=0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 06 Jun 2011 11:31:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:47002 Archived-At: > > 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 http://www.emacswiki.org/emacs/icomplete%2b.el in the Emacs 23+ definition of `icomplete-completions': (let* ((mdata (and (fboundp 'completion--field-metadata) (completion--field-metadata (field-beginning)))) (most-try (if (fboundp 'completion--field-metadata) ; Emacs 24 (completion-try-completion name comps nil (length name) mdata) (completion-try-completion name comps nil (length name)))) ... 2. icicles-fn.el http://www.emacswiki.org/emacs/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 (field-beginning))))) (res (if (fboundp 'completion--field-metadata) ; Emacs 24 (completion-all-completions string table pred point mdata) (completion-all-completions string table pred point)))) ... [similarly for `...try...'] Functions `icicle-completion-(all|try)-completion(s)' are used by functions `icicle-unsorted(-file-name)-prefix-candidates', `icicle-prefix-any(-file-name)-candidates-p' (in the same file). Here is a typical use: (if (icicle-not-basic-prefix-completion-p) (icicle-completion-try-completion input minibuffer-completion-table minibuffer-completion-predicate (length input) (and (fboundp 'completion--field-metadata) (completion--field-metadata ; Emacs 24 (field-beginning)))) (try-completion input minibuffer-completion-table minibuffer-completion-predicate)) `icicle-not-basic-prefix-completion-p' returns non-nil if the user chooses to take advantage of Emacs 23+ `completion-styles' etc.