Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Re: Auto create "gnus-private" field
       [not found] <el8snyv5.fsf@rogers.com>
@ 2002-12-11 21:39 ` jeSPer Holm
  0 siblings, 0 replies; only message in thread
From: jeSPer Holm @ 2002-12-11 21:39 UTC (permalink / raw)


   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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-12-11 21:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <el8snyv5.fsf@rogers.com>
2002-12-11 21:39 ` Auto create "gnus-private" field jeSPer Holm

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).