From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: Completing with anything Date: Tue, 22 Mar 2011 11:01:49 +0800 Message-ID: <87wrjr7t9e.fsf@ericabrahamsen.net> 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> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=35521 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q1rrA-0006eL-ET for emacs-orgmode@gnu.org; Mon, 21 Mar 2011 23:02:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q1rr9-0004Ls-CQ for emacs-orgmode@gnu.org; Mon, 21 Mar 2011 23:02:04 -0400 Received: from lo.gmane.org ([80.91.229.12]:51967) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q1rr8-0004Lm-Vi for emacs-orgmode@gnu.org; Mon, 21 Mar 2011 23:02:03 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q1rr7-0007kM-Mq for emacs-orgmode@gnu.org; Tue, 22 Mar 2011 04:02:01 +0100 Received: from 123.121.199.176 ([123.121.199.176]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Mar 2011 04:02:01 +0100 Received: from eric by 123.121.199.176 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Mar 2011 04:02:01 +0100 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: emacs-orgmode@gnu.org Stefan Monnier 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