From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vitalie Spinu Newsgroups: gmane.emacs.devel Subject: Completion with (:exclusive 'no) is called twice, and doesn't pass over on sole completion. Date: Fri, 16 Mar 2012 12:05:14 +0100 Organization: EUR Message-ID: <87haxoyff9.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1331895995 6971 80.91.229.3 (16 Mar 2012 11:06:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 16 Mar 2012 11:06:35 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 16 12:06:35 2012 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 1S8UzN-0000cC-SS for ged-emacs-devel@m.gmane.org; Fri, 16 Mar 2012 12:06:29 +0100 Original-Received: from localhost ([::1]:35454 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8UzN-0005q4-5u for ged-emacs-devel@m.gmane.org; Fri, 16 Mar 2012 07:06:29 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8Uyt-0005ia-OV for emacs-devel@gnu.org; Fri, 16 Mar 2012 07:06:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8UyW-0003s3-6A for emacs-devel@gnu.org; Fri, 16 Mar 2012 07:05:59 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:55336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8UyV-0003rp-Q5 for emacs-devel@gnu.org; Fri, 16 Mar 2012 07:05:35 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1S8UyS-0008C6-Az for emacs-devel@gnu.org; Fri, 16 Mar 2012 12:05:32 +0100 Original-Received: from e138158.upc-e.chello.nl ([213.93.138.158]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 16 Mar 2012 12:05:32 +0100 Original-Received: from spinuvit by e138158.upc-e.chello.nl with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 16 Mar 2012 12:05:32 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: e138158.upc-e.chello.nl User-Agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.0.94 (gnu/linux) Cancel-Lock: sha1:NDGcIfRC0qPr/vSL1/GAuhQUB6c= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:149096 Archived-At: Hi, The completion in emacs 24 is called twice. For example (defun foo-completion () (when (save-excursion (re-search-backward "\\<\\w*" (point-at-bol) t)) (let ((token (match-string-no-properties 0)) (beg (match-beginning 0)) (end (match-end 0))) (message "%s:" token) (when (= end (point)) (list beg end (list "aaaa" "aaaaaaa" "bbbb" "truncat") :exclusive 'no))))) (add-to-list 'completion-at-point-functions 'foo-completion) ;; it is now (foo-completion lisp-completion-at-point t) Place your point at the end of 'aaaa and you try to complete. I am getting aaa: aaaa: in my message buffer. Which means the completion is called twice. I hope this is not an intended behavior, as it might seriously interfere with custom completion. For example I might want to have a different behavior on the second consequent invocation of the completion (give a message, modify the candidates etc). Second problem is that if the completion is sole, the handling is not passed over. For example after 'truncat I am getting a message "Sole completion" and the lisp-completion-at-point is not reached at all. I believe it's not how it should work. In all the rest, new completion system is virtually perfect, thanks. Vitalie.