emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Re: Completing with anything


From: Eric Abrahamsen
Subject: [O] Re: Completing with anything
Date: Tue, 22 Mar 2011 11:01:49 +0800
User-agent: Gnus/5.110016 (No Gnus v0.16) Emacs/23.2 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>>> As Tassilo mentions, maybe we could have a post-completion step that can
>>> perform some kind of expansion/replacement/cleanup once a valid
>>> completion is selected.  I'm not sure what that would look like in terms
>>> of code and API, but if someone wants to try it out a propose a patch to
>>> start a discussion, maybe we could add such a thing.
>
>> Or maybe an upper layer mixing abbrev and completion? Trying one at
>> first, the other one after. This could be useful for message-mode for
>> example, since you probably wants to use both.
>
> That might work even better, yes.
>
>
>         Stefan

This is what I've been using to insert other people's contact
information into emails. Probably no good for general use, but maybe
will provide food for thought.

#+BEGIN_SRC emacs-lisp
(defun my-cite-contact (name)
  (interactive "sName (regexp): ")
  (let ((rec)
        (records (bbdb-search (bbdb-records) name name name nil nil)))
    (if (= (length records) 1)
        (setq rec (car records))
      (if (zerop (length records))
          (error "No matching records")
        (setq rec
              (let ((int-name (ido-completing-read "Pick one: "
                                                   (mapcar 'bbdb-record-name 
records))))
                (car (bbdb-search (bbdb-records) int-name))))))
    (insert (bbdb-dwim-net-address rec))))
#+END_SRC




reply via email to

[Prev in Thread] Current Thread [Next in Thread]