From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: Re: Completing with anything Date: Tue, 22 Mar 2011 14:13:42 +0000 Message-ID: <87oc53meeh.fsf@ucl.ac.uk> References: <87r5bhysp6.fsf@keller.adm.naquadah.org> <878vxovsym.fsf@keller.adm.naquadah.org> <87k4h7ua23.fsf@member.fsf.org> <87vd0romky.fsf@keller.adm.naquadah.org> <87mxm2na63.fsf@member.fsf.org> <87vd0qfhu3.fsf@member.fsf.org> <87lj08fxge.fsf@member.fsf.org> <87wrjr7t9e.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=59717 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q22LL-0007AH-5l for emacs-orgmode@gnu.org; Tue, 22 Mar 2011 10:13:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q22LJ-0006oL-Qt for emacs-orgmode@gnu.org; Tue, 22 Mar 2011 10:13:55 -0400 Received: from vscane-a2.ucl.ac.uk ([144.82.108.42]:41976) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q22LJ-0006mn-Mu for emacs-orgmode@gnu.org; Tue, 22 Mar 2011 10:13:53 -0400 In-Reply-To: <87wrjr7t9e.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Tue, 22 Mar 2011 11:01:49 +0800") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Abrahamsen Cc: emacs-orgmode@gnu.org Eric Abrahamsen writes: [...] > 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 This looks quite nice; I have been missing the possibility of a regex search for mail addresses and the combination with ido is quite appealing. How do you invoke it? I am currently struggling with the interactions between .mailrc (emacs mail aliases, expanding as abbrevs) and bbdb (expanding with TAB). This is partly why I haven't even considered using org-contacts yet... As always, with Emacs, too many choices, too little time! ;-) -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 : using Org-mode version 7.5 (release_7.5.92.gf702.dirty)