Re: [O] Completing with anything

2011-05-27 Thread Stefan Monnier
With these two modifications, it runs fine (that is, using the old calling convention and just using (setq-default completion-at-point-functions '(my-dabbrev-expand))) Thanks, installed, Stefan

Re: [O] Completing with anything

2011-05-25 Thread Stefan Monnier
Another is to do it more selectively, flag some of completion-at-point-functions as not-exclusive, meaning that if completion fails with those we should keep trying with subsequent functions. E.g. the nick completion in rcirc could be flagged as non-exclusive since it applies everywhere,

Re: [O] Completing with anything

2011-05-24 Thread Julien Danjou
On Tue, May 24 2011, Stefan Monnier wrote: I've now added a :exit-function property that completion-at-point-functions can return which is a function that gets called when completion is finished. It operates outside of the completion-table, so has access to the buffer text and can do things

Re: [O] Completing with anything

2011-05-24 Thread 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

Re: [O] Completing with anything

2011-05-24 Thread Antoine Levitt
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)

Re: [O] Completing with anything

2011-05-24 Thread Stefan Monnier
Oh well, I guess that I'm the only one who wants this kind of behaviour, No, I'm interested as well, but haven't found a good solution yet. Stefan

Re: [O] Completing with anything

2011-05-24 Thread Stefan Monnier
(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))) BTW, you can avoid the advice by using your own (defun al-completion-at-point ()

Re: [O] Completing with anything

2011-05-24 Thread Antoine Levitt
24/05/11 16:05, Stefan Monnier (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))) BTW, you can avoid the advice by using your own

Re: [O] Completing with anything

2011-05-24 Thread Stefan Monnier
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: To get back to this discussion. Before worrying about how to implement it, I'm wondering

Re: [O] Completing with anything

2011-05-24 Thread Antoine Levitt
24/05/11 20:05, Stefan Monnier 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: To get back to this discussion. Before worrying about how to

Re: [O] Completing with anything

2011-05-23 Thread Stefan Monnier
So at least cycling-completion seems fundamentally incompatible with this idea of abbrev-expansion-after-completion, at least if you want to allow arbitrarily complex abbrevs like skeletons. Indeed, this is a real problem. I've now added a :exit-function property that

Re: [O] Completing with anything

2011-05-04 Thread Stefan Monnier
Hmm... good point, doing it in completion-choices is not reliable, tho using as completion table something like: (lambda (string pred action) (let ((res (complete-with-action action completion-choices string pred))) (if (and (eq action nil) (assq (if (eq res t) string res)

Re: [O] Completing with anything

2011-05-04 Thread Julien Danjou
On Wed, May 04 2011, Stefan Monnier wrote: So at least cycling-completion seems fundamentally incompatible with this idea of abbrev-expansion-after-completion, at least if you want to allow arbitrarily complex abbrevs like skeletons. Indeed, this is a real problem. Could you give me an idea

Re: [O] Completing with anything

2011-05-03 Thread Julien Danjou
On Sun, Mar 27 2011, Michael Markert wrote: Attached code handles both capturing from summary and message buffer. I've added this file into contrib, beside org-contacts.el -- Julien Danjou ❱ http://julien.danjou.info pgpYWL7yrdunj.pgp Description: PGP signature

Re: [O] Completing with anything

2011-04-30 Thread Michael Markert
On 11 Apr 2011, Michael Markert wrote: On 11 Apr 2011, Bastien wrote: Julien Danjou jul...@danjou.info writes: On Sat, Apr 09 2011, Michael Markert wrote: No, but if it's necessary (or helping) I'll do so. Well, since org-contacts is part of contrib I think it's not necessary, so I'll

Re: [O] Completing with anything

2011-04-12 Thread Julien Danjou
On Tue, Apr 12 2011, Stefan Monnier wrote: Hmm... good point, doing it in completion-choices is not reliable, tho using as completion table something like: (lambda (string pred action) (let ((res (complete-with-action action completion-choices string pred))) (if (and (eq action nil)

Re: [O] Completing with anything

2011-04-11 Thread Stefan Monnier
Because this one return (list start end completion-choies), and does not do anything else. I can't do it myself using the current completion mechanism, IIUC. Hmm... good point, doing it in completion-choices is not reliable, tho using as completion table something like: (lambda (string pred

[O] Completing with anything (was: [Orgmode] Re: Announcing org-contacts, a bbdb-like contact manager for Org)

2011-03-18 Thread Julien Danjou
On Sat, Feb 12 2011, Stefan Monnier wrote: For more complex cases, there is also the issue of what to do when some parts of the completion are case-sensitive and other parts aren't (e.g. completion of case-sensitive envvars in case-insensitive file names), although this is less important for