emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: emacs-orgmode@gnu.org
Subject: Re: Completing with anything
Date: Tue, 22 Mar 2011 23:02:33 +0800	[thread overview]
Message-ID: <87wrjrp59y.fsf@ericabrahamsen.net> (raw)
In-Reply-To: 87oc53meeh.fsf@ucl.ac.uk

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> 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!  ;-)

I only ever invoke it through M-x, as I only ever use it to paste other
people's contact details into an email (something I find myself doing
surprisingly often).

The trick was definitely figuring out at what "level" to let ido do its
thing. The key was that bbdb came with both its own generic search
function, and its own formatting function—ido is just the glue between,
if necessary.

I don't really like the fact that you first produce a collection of
records, then pick *the name* of one record and essentially re-search
all the records for that particular name, but I couldn't figure out a
way to have ido select from among *representations* of actual records,
and then return the record directly. I think that's where ido will trip
you up: it's only made to select from strings.

E

  reply	other threads:[~2011-03-22 15:03 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-09  9:02 Announcing org-contacts, a bbdb-like contact manager for Org Julien Danjou
2011-02-09 19:00 ` John Hendy
2011-02-09 20:04   ` Sébastien Vauban
2011-02-09 20:43     ` Julien Danjou
2011-02-09 21:10       ` Russell Adams
2011-02-09 21:25         ` Marcelo de Moraes Serpa
2011-02-09 20:42   ` Julien Danjou
2011-02-10 14:34     ` John Hendy
2011-02-10 14:42       ` Julien Danjou
2011-02-09 19:16 ` Tassilo Horn
2011-02-09 19:26 ` John Hendy
2011-02-10 13:39 ` Dan Griswold
2011-02-10 14:42   ` Julien Danjou
2011-02-10 14:45 ` Dan Davison
2011-02-10 14:56   ` Julien Danjou
2011-02-10 15:05     ` John Hendy
2011-02-10 15:08     ` Dan Davison
2011-02-10 15:26     ` Rodrigo Lazo
2011-02-10 16:30     ` Tassilo Horn
2011-02-10 16:56       ` Julien Danjou
2011-02-10 18:20         ` Stefan Monnier
2011-02-11 10:21           ` [Orgmode] " Tassilo Horn
2011-02-11 14:47             ` Stefan Monnier
2011-02-11 20:15               ` Tassilo Horn
2011-02-11 23:08                 ` Stefan Monnier
2011-02-12 18:37                   ` Tassilo Horn
2011-02-20 16:58                     ` Julien Danjou
2011-03-18 15:00                   ` Completing with anything (was: [Orgmode] Re: Announcing org-contacts, a bbdb-like contact manager for Org) Julien Danjou
2011-03-18 18:16                     ` Completing with anything Stefan Monnier
2011-03-21 11:23                       ` Julien Danjou
2011-03-21 12:51                         ` Tassilo Horn
2011-03-21 13:36                           ` Julien Danjou
2011-03-21 14:17                             ` Tassilo Horn
2011-03-21 16:27                             ` Stefan Monnier
2011-03-21 16:55                               ` Dimitri Fontaine
2011-03-21 17:04                               ` Julien Danjou
2011-03-21 22:00                                 ` Stefan Monnier
2011-03-22  3:01                                   ` Eric Abrahamsen
2011-03-22 14:13                                     ` Eric S Fraga
2011-03-22 15:02                                       ` Eric Abrahamsen [this message]
2011-03-23  9:45                                       ` Julien Danjou
2011-03-23 14:13                                         ` Eric S Fraga
2011-03-23 15:05                                           ` Julien Danjou
2011-03-23 16:03                                             ` Eric S Fraga
2011-03-24 20:15                                             ` Cian
2011-03-25 10:16                                               ` Julien Danjou
2011-03-26 22:06                                                 ` Michael Markert
2011-03-26 23:40                                                   ` Michael Markert
2011-04-09 12:13                                                     ` Julien Danjou
2011-04-09 13:54                                                       ` Michael Markert
2011-04-11  9:24                                                         ` Julien Danjou
2011-04-11  9:37                                                           ` Bastien
2011-04-11 13:42                                                             ` Michael Markert
2011-04-30 13:39                                                               ` Michael Markert
2011-05-03  8:09                                                     ` Julien Danjou
2011-03-22 10:00                                 ` Aankhen
2011-03-22 11:57                                   ` Tassilo Horn
2011-03-22 12:03                                     ` Julien Danjou
2011-03-22 12:31                                       ` Tassilo Horn
2011-03-21 15:19                         ` Stefan Monnier
2011-03-21 15:54                           ` Julien Danjou
2011-04-09 15:11                             ` Julien Danjou
2011-04-10  4:03                               ` Stefan Monnier
2011-04-11  9:21                                 ` Julien Danjou
2011-04-12  3:42                                   ` Stefan Monnier
2011-04-12  9:48                                     ` Julien Danjou
2011-05-04 15:07                                       ` Stefan Monnier
2011-05-04 15:34                                         ` Julien Danjou
2011-05-24  3:14                                           ` Stefan Monnier
2011-05-24  7:33                                             ` Julien Danjou
2011-05-24  9:16                                             ` Antoine Levitt
2011-05-24 12:47                                               ` Stefan Monnier
2011-05-24 13:18                                                 ` Antoine Levitt
2011-05-24 14:04                                                   ` Stefan Monnier
2011-05-24 14:05                                                   ` Stefan Monnier
2011-05-24 14:45                                                     ` Antoine Levitt
2011-05-24 18:05                                                   ` Stefan Monnier
2011-05-24 18:30                                                     ` Antoine Levitt
2011-05-26  2:23                                                       ` Stefan Monnier
2011-05-26  7:50                                                         ` Antoine Levitt
2011-05-28  2:15                                                           ` Stefan Monnier
2011-02-11 11:08         ` Announcing org-contacts, a bbdb-like contact manager for Org Thierry Volpiatto
2011-02-11 15:08 ` Darlan Cavalcante Moreira
2011-02-23 11:09   ` Julien Danjou
2011-02-12 12:18 ` Bastien
2011-02-12 16:35   ` John Hendy
2011-02-12 17:12     ` Bastien
2011-02-23 11:11     ` Julien Danjou
2011-02-12 19:42   ` Matt Lundin
2011-02-23 11:14     ` Julien Danjou
2011-02-14 18:24   ` Wes Hardaker
2011-02-23 11:10   ` Julien Danjou
2011-02-26 17:26     ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wrjrp59y.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).