From mboxrd@z Thu Jan 1 00:00:00 1970 From: Antoine Levitt 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> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org To: Stefan Monnier Cc: emacs-orgmode@gnu.org, emacs-devel@gnu.org List-Id: emacs-orgmode.gnu.org 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)))