From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Antoine Levitt Newsgroups: gmane.emacs.devel Subject: Re: ERC completion Date: Fri, 29 Apr 2011 09:43:54 +0200 Message-ID: <87liytfqo5.fsf@gmail.com> References: <87y62ved2o.fsf@gmail.com> <871v0mu033.fsf@gmail.com> <87liyujgxv.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1304063056 30891 80.91.229.12 (29 Apr 2011 07:44:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 29 Apr 2011 07:44:16 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 29 09:44:12 2011 Return-path: Envelope-to: ged-emacs-devel@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 1QFiMy-0005JK-Sx for ged-emacs-devel@m.gmane.org; Fri, 29 Apr 2011 09:44:09 +0200 Original-Received: from localhost ([::1]:39807 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFiMy-0008BP-DD for ged-emacs-devel@m.gmane.org; Fri, 29 Apr 2011 03:44:08 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:50111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFiMr-0008B5-So for emacs-devel@gnu.org; Fri, 29 Apr 2011 03:44:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFiMq-0000kF-Re for emacs-devel@gnu.org; Fri, 29 Apr 2011 03:44:01 -0400 Original-Received: from mail-ww0-f49.google.com ([74.125.82.49]:63669) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFiMq-0000k0-Gq for emacs-devel@gnu.org; Fri, 29 Apr 2011 03:44:00 -0400 Original-Received: by wwb39 with SMTP id 39so3352383wwb.30 for ; Fri, 29 Apr 2011 00:43:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=HMubymL4umoD1RPksHN3B0A8Xm+I6Jy7cEGhmKLisw0=; b=WPqJTPxtn+wwFe7b3QIRUaGSKyvRIik2kRFa1SNlsWhTLADc+aFBabfIZmsmsbPvyJ kYDF+g7S+dpF1wLobe+s6fhzXyYxdk8ZiHglfEgJOmg/o48HhBus9RzDZihY22leMUFn U8ZiQ1XCIw6PUq0wS6PqJEztA6jjj03qNAGuc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=oxzZ2warvFu0eZi1o30aEqs5bQkfMS6t89gXbvYp94sXygBZgHZio1TYeVL88liAXT kaUKSPkg7kW/mxoCY9i0OCVjF0hnW/MIzDfTMi+grWZCe9/ciVrid5XrfINVvvaJqhAE xpbXDD1v1kfwPzZOUzE7lOLQfQRBZbppv89Y4= Original-Received: by 10.227.199.68 with SMTP id er4mr466299wbb.47.1304063039041; Fri, 29 Apr 2011 00:43:59 -0700 (PDT) Original-Received: from lambda (ney92-7-78-233-218-202.fbx.proxad.net [78.233.218.202]) by mx.google.com with ESMTPS id w25sm1529012wbd.56.2011.04.29.00.43.56 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Apr 2011 00:43:58 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Thu, 28 Apr 2011 21:50:09 -0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.49 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:138886 Archived-At: 29/04/11 02:50, Stefan Monnier >>>> Sorry, it isn't ignored. But rather, erc-pcompletions-at-point always >>>> return non-nil, even when it does not complete anything, so that my >>>> customization >>>> (setq erc-complete-functions '(erc-pcompletions-at-point >>>> my-dabbrev-expand)) >>>> does not work as expected. (the intent is to have dabbrev take over if >>>> I'm not completing a nick) >>> Hmm, does the patch below help? > >> It's looks like it's a step in the right direction, but it does not fix >> the problem: "completions" is still non-nil, and includes every nick, >> even those that don't begin by the word before point. > > I see. The problem is that completion-at-point-functions is meant to > first decide what kind of completion should take place at point, > regardless of whether the text at point might match any one of those > completions (and determining whether or not it matches would need to pay > attention to completion-styles and completion-in-region-function, ..., > i.e. do a dry-run of completion-in-region). Note that the decision > should take place separately from the completion itself since we want to > be able to do things like completion-help-at-point. > > IIUC in your case, you seem to want to use "nick completion if such > a completion exists, or else fallback on dabbrev". > > I'm not sure how best provide that kind of behavior (other than by > trying to merge the two entries using something like > completion-table-in-turn). Can't you just wrap the new framework as a function that completes and returns nil if it did not do anything, and use this for erc-complete-functions? In any cases the change breaks erc-complete-functions. Maybe this should be resolved in a general way before converting ERC (and maybe others that use a similar way of customizing completions) to the new completion framework. Or just drop erc-complete-functions support and document a way of achieving the same effect under the new framework. > >> Also, while on the subject of ERC completions, it seems an extra space >> is appended after erc-pcomplete-nick-postfix, originating from the same >> commit. > > Hmm... can you show me exactly what you've done, what was the result > with the code and what is the result with the new code? Just run emacs -Q, join any channel, and complete a username. Old code did "ERC> some_nick: " new code does "ERC> some_nick: "