Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: jeSPer Holm <jesper@zoonet.dk>
Subject: Re: Auto create "gnus-private" field
Date: Wed, 11 Dec 2002 22:39:46 +0100	[thread overview]
Message-ID: <878yyw1bh9.fsf@zoonet.dk> (raw)
In-Reply-To: <el8snyv5.fsf@rogers.com>

   Hi!

On Sun, 08 Dec 2002 18:34:46 GMT, delirious wrote: 

> Can anyone suggest a function that will automagically create a
> gnus-private field for an BBDB record? For example, if sent to my
> "personal" address, the gnus-private field might become
> "personal.part-of-address-before-@" 

> If sent to my business address:
> "personal.part-of-address-before-@"

I have used the following to create gnus-private fields from the BBDB
buffer - it is not exactly what you asked for, but you might find it
useful anyway...

(defun jesper-bbdb-private-field ()
  (interactive)
  (let (
	firstname
	lastname
	folder-name
        (folder-prefix "personer.")
        )
    (setq firstname    (bbdb-record-firstname (bbdb-current-record)))
    (setq lastname     (bbdb-record-lastname (bbdb-current-record)))
    (setq folder-name (concat firstname "-" lastname))
    (setq folder-name (replace-in-string folder-name " " "-"))
    (setq folder-name (replace-in-string folder-name "\\.\\.+" "-"))
    (setq folder-name (downcase folder-name))
    (bbdb-record-putprop (bbdb-current-record) 
			 'gnus-private 
			 (concat folder-prefix folder-name))
    (display-message 'command folder-name)))

(My Lisp skills are very limited, so I'm quite sure that this can be
done more elegant.)

-- 
zoonet.dk                                                  jeSPer Holm
                                                      jesper@zoonet.dk


           reply	other threads:[~2002-12-11 21:39 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <el8snyv5.fsf@rogers.com>]

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

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

  git send-email \
    --in-reply-to=878yyw1bh9.fsf@zoonet.dk \
    --to=jesper@zoonet.dk \
    /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.
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 NNTP newsgroup(s).