From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Antoine Levitt Newsgroups: gmane.emacs.devel,gmane.emacs.orgmode Subject: Re: Completing with anything Date: Tue, 24 May 2011 15:18:59 +0200 Message-ID: <87lixwkzi4.fsf@gmail.com> References: <87r5bhysp6.fsf@keller.adm.naquadah.org> <87mxm2na63.fsf@member.fsf.org> <87vd0qfhu3.fsf@member.fsf.org> <87y63jpii5.fsf@keller.adm.naquadah.org> <871v0ecwe4.fsf@keller.adm.naquadah.org> <87aaecihl2.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1306243166 31705 80.91.229.12 (24 May 2011 13:19:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 24 May 2011 13:19:26 +0000 (UTC) Cc: emacs-orgmode@gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 24 15:19:16 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 1QOrW0-00020L-Da for ged-emacs-devel@m.gmane.org; Tue, 24 May 2011 15:19:16 +0200 Original-Received: from localhost ([::1]:33077 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOrVz-00086K-SD for ged-emacs-devel@m.gmane.org; Tue, 24 May 2011 09:19:15 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:39058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOrVv-00080R-CQ for emacs-devel@gnu.org; Tue, 24 May 2011 09:19:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOrVp-0004hN-Tk for emacs-devel@gnu.org; Tue, 24 May 2011 09:19:11 -0400 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:62296) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOrVo-0004gq-0T; Tue, 24 May 2011 09:19:04 -0400 Original-Received: by wyf19 with SMTP id 19so6127393wyf.0 for ; Tue, 24 May 2011 06:19:02 -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:message-id :user-agent:mime-version:content-type; bh=GyIAN0Kpqbsq4bmfxVB2Q/BOyN63jfoWC0NtIUHvoA4=; b=DnlFX/GboTycmGrAAzE30xTnGEMmg9NiGSKe3p9OZqa9JuLysm+EtpDv9ZC77kzOnM TlYm7GFEqN0tr2vuayJeaQ+L8hs5ryqPMW7UakZzSapBEuADlCMHLEVJFahTUoUJl1HP GJSz+JM8LL26bM4kl+ytwvqs1T5DrepCmrUs0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:message-id:user-agent :mime-version:content-type; b=bjCyxauLwswryw6qiPl4HoTSF1rlAcA5I/IsEvrzR/hqt1xn9KCMBQA4L/MabobMOt JwzmLZRurz8xV7xkBE1bobCNnJYgC+Wicar6sL/fD3PXSwcDS+lad4XHk/M+84vMVfHQ EDsuiqpB/xGV0FUz2yELIBZ9YlfgHyvH4fYms= Original-Received: by 10.216.230.76 with SMTP id i54mr3230971weq.108.1306243142682; Tue, 24 May 2011 06:19:02 -0700 (PDT) Original-Received: from lambda (portable43.ceremade.dauphine.fr [193.48.71.43]) by mx.google.com with ESMTPS id g32sm3822964wej.27.2011.05.24.06.19.00 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 May 2011 06:19:01 -0700 (PDT) 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.169 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:139677 gmane.emacs.orgmode:42189 Archived-At: 24/05/11 14:47, Stefan Monnier >> So, could you add 'failed, which means that no function was able to >> complete? That way I could do something like > >> (setq completion-extra-properties '(:exit-function my-exit-function)) > >> (defun my-exit-function (string finished) >> (when (eq finished 'failed) >> (dabbrev-expand))) > >> and always get a dabbrev-expand as fallback to completion-at-point? > > Hmm... interesting way to attack that problem. I don't think that will > work quite like this: if the completion provides its own :exit-function > (e.g. to add a terminator string), then yours won't be run. Mmh, true. Oh well, I guess that I'm the only one who wants this kind of behaviour, so I just ended up with an advice which seems to do the trick. Sorry for hijacking this thread. In case anyone is interested: (defadvice completion-at-point (after completion-at-point-complete-if-failed activate) "Fallback on dabbrev if completion didn't do anything useful." (unless ad-return-value (dabbrev-expand nil)))