From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.bugs Subject: bug#12852: 24.2; `exit-function' not supported in completion table's metadata alist Date: Sun, 11 Nov 2012 14:45:02 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1352616360 7825 80.91.229.3 (11 Nov 2012 06:46:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 11 Nov 2012 06:46:00 +0000 (UTC) To: 12852@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 11 07:46:10 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1TXRJ3-0006mM-4h for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Nov 2012 07:46:09 +0100 Original-Received: from localhost ([::1]:53077 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXRIr-0005yx-Oe for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Nov 2012 01:45:57 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXRIm-0005y5-NY for bug-gnu-emacs@gnu.org; Sun, 11 Nov 2012 01:45:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXRIg-0004zd-9r for bug-gnu-emacs@gnu.org; Sun, 11 Nov 2012 01:45:49 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50431) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXRIf-0004zW-Ux for bug-gnu-emacs@gnu.org; Sun, 11 Nov 2012 01:45:46 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TXRIw-0004Wh-Cx for bug-gnu-emacs@gnu.org; Sun, 11 Nov 2012 01:46:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Leo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Nov 2012 06:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12852 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.135261634917381 (code B ref -1); Sun, 11 Nov 2012 06:46:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Nov 2012 06:45:49 +0000 Original-Received: from localhost ([127.0.0.1]:60682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TXRIg-0004WF-T0 for submit@debbugs.gnu.org; Sun, 11 Nov 2012 01:45:49 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:45265) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TXRIc-0004W5-NZ for submit@debbugs.gnu.org; Sun, 11 Nov 2012 01:45:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXRII-0004vk-II for submit@debbugs.gnu.org; Sun, 11 Nov 2012 01:45:25 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:34410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXRII-0004vg-FG for submit@debbugs.gnu.org; Sun, 11 Nov 2012 01:45:22 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXRIF-0005vB-CV for bug-gnu-emacs@gnu.org; Sun, 11 Nov 2012 01:45:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXRIC-0004rh-95 for bug-gnu-emacs@gnu.org; Sun, 11 Nov 2012 01:45:19 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:34345) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXRIC-0004rV-26 for bug-gnu-emacs@gnu.org; Sun, 11 Nov 2012 01:45:16 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TXRII-0006Iv-Di for bug-gnu-emacs@gnu.org; Sun, 11 Nov 2012 07:45:22 +0100 Original-Received: from 119.255.41.67 ([119.255.41.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 11 Nov 2012 07:45:22 +0100 Original-Received: from sdl.web by 119.255.41.67 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 11 Nov 2012 07:45:22 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 55 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 119.255.41.67 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (OS X 10.8.2) Cancel-Lock: sha1:ybbGSJwnjqC9GNTXZogf9SnQi+w= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -3.0 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-Spam-Score: -3.0 (---) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:66756 Archived-At: On 2012-11-11 06:33 +0800, Stefan Monnier wrote: > AFAIK, the exit-function is a global property that applies to the whole > completion, whereas the annotation function is related to the > all-completions output, which can vary depending on where point is > (e.g. in file-name completion the *Completions* buffer may list files or > envvars, so you may need two different annotation-functions). > > Hence the exit-function doesn't make much sense in the completion > table's metadata. It still seems inconsistent to me. I am finding myself writing this in order to group related code. (cond ((eq action 'metadata) (make-local-variable 'completion-extra-properties) (setq completion-extra-properties (plist-put 'completion-extra-properties :exit-function (lambda (comp status) (when (cadr (assoc (car (last (split-string comp "[.]" t))) python-module--completion-table)) (minibuffer-message "package"))))) '(metadata (annotation-function . (lambda (comp) (when (cadr (assoc comp python-module--completion-table)) "

"))))) .......) Otherwise I'd have to go to completing-read, xxxxx-completion-at-point and the like to install the exit-function on each one of them. This is repetitive and ugly. I was hoping I could just write (cond ((eq action 'metadata) '(metadata (annotation-function . (lambda (comp) (when (cadr (assoc comp python-module--completion-table)) "

"))) (exit-function . (lambda (comp status) (when (cadr (assoc (car (last (split-string comp "[.]" t))) python-module--completion-table)) (minibuffer-message "package")))))) .......) Looks like with some change to completion--done we can have this. What do you think? Leo