Gnus development mailing list
 help / color / mirror / Atom feed
From: "Darren/Torin/Who Ever..." <torin@daft.com>
Subject: Re: how to turn off fontification...
Date: 03 Jun 1997 01:04:13 -0700	[thread overview]
Message-ID: <87206k159q.fsf@perv.daft.com> (raw)
In-Reply-To: David Hedbor's message of 02 Jun 1997 16:25:19 -0700

-----BEGIN PGP SIGNED MESSAGE-----

David Hedbor, in an immanent manifestation of deity, wrote:
>To make this post a bit more on topic - have anyone made hacks for
>BBDB, which automatically includes the newsgroups a person has posted
>in or perhaps a hack that extracts X-Url?

Well, here's what I've done to grab the (mail|news)group that someone
has posted to:
(defun bbdb-add-gnus-group (record)
  "Put the current gnus group in this record's posted-to field if it's not there"
    (or bbdb-readonly-p
	(let* ((group gnus-newsgroup-name)
	      (field (bbdb-record-getprop record 'posted-to))
	      (pos (string-match ":" group)) 	     ; we don't want the nnm[hl]: part
	      )
	  (setq group (substring group (cond
					(pos (1+ pos))
					(t 0))))     ; we didn't match on ":"
	  (if (or
	       (not field)			     ; the field isn't there yet.
	       (not (string-match (concat (regexp-quote group) "\\(\n\\|$\\)") field)))
		(bbdb-annotate-notes record group 'posted-to)))))

As for X-Url and more typical things, you can just use
bbdb-auto-note-alist.  Here's what I use, adapted from the bbdb
info-page:
(setq bbdb-auto-notes-alist 
      (append
       (list
	'("Organization" ("\\s-*\\(.*\\)\\s-*" company 1 t))
	'("Organisation" ("\\s-*\\(.*\\)\\s-*" company 1 t))
	'("X-Organization" ("\\s-*\\(.*\\)\\s-*" company 1 t))
	'("X-Organisation" ("\\s-*\\(.*\\)\\s-*" company 1 t))
	'("Web" ("\\s-*\\(.*\\)\\s-*" url 1))
	'("X-Web" ("\\s-*\\(.*\\)\\s-*" url 1))
	'("X-WWW-Homepage" ("\\s-*\\(.*\\)\\s-*" url 1))
	'("X-WWW-page" ("\\s-*\\(.*\\)\\s-*" url 1))
	'("X-Homepage" ("\\s-*\\(.*\\)\\s-*" url 0))
	;; This is what Netscape puts in when sending a URL reference
	'("X-Url" ("\\s-*\\(.*\\)\\s-*" last-url 1))
	'("X-Mailer" ("\\s-*\\(.*\\)\\s-*" mailer 1 t))
	'("X-Newsreader" ("\\s-*\\(.*\\)\\s-*" mailer 1 t))
	'("X-Mua" ("\\s-*\\(.*\\)\\s-*" mailer 1 t))
	(list "X-Face"
	      (list (concat "[ \t\n]*\\([^ \t\n]*\\)"
			    "\\([ \t\n]+\\([^ \t\n]+\\)\\)?"
			    "\\([ \t\n]+\\([^ \t\n]+\\)\\)?"
			    "\\([ \t\n]+\\([^ \t\n]+\\)\\)?"
			    )
		    'x-face
		    "\\1\\3\\5\\7" t))

	)
       ))

(X?Emacs regexes are so ugly.)

And finally, to get bbdb to actually use these, you have it run the
appropriate function during notice:

(add-hook 'bbdb-notice-hook 'bbdb-auto-notes-hook)
(add-hook 'bbdb-notice-hook 'bbdb-add-gnus-group)

Darren
- -- 
<torin@daft.com> <http://www.daft.com/~torin> <torin@debian.org> <torin@io.com>
Darren Stalder/2608 Second Ave, @282/Seattle, WA 98121-1212/USA/+1-800-921-4996
@ Do you have your clothes on? I probably don't. Take yours off. Feel better. @
@ Sysadmin, webweaver, postmaster for hire.  C/Perl/CGI programmer and tutor. @

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3
Charset: noconv
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQCVAwUBM5PQBY4wrq++1Ls5AQEnmAP9EhGmNqnJl0ZZEifHGQD6ThM3L8ceozvK
Hg8vRM7Dc6K4Va4N7fCuRbT4WgnDGDMdV2a5D/l/alpAwwNJCp8yjAw0HnqsFuIO
39IeEZhHW/11mdyQfnEjtx32HqQqnyR5VGjCK/ElwAmGV+9qMwLQ4hgRnilMwcCf
RSjhvLEI5LY=
=3uAo
-----END PGP SIGNATURE-----


  parent reply	other threads:[~1997-06-03  8:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-02 21:04 andreas
1997-06-02 22:32 ` Hrvoje Niksic
1997-06-02 23:25   ` David Hedbor
1997-06-03  4:27     ` Andrew J Cosgriff
1997-06-03 17:40       ` Michael Lamoureux
1997-06-03  8:04     ` Darren/Torin/Who Ever... [this message]
1997-06-03  8:42       ` David Hedbor

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=87206k159q.fsf@perv.daft.com \
    --to=torin@daft.com \
    /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).