On Monday, September 25, 2006 at 09:02:29, Robert Goldman wrote:
[...]
> OK, I just tried using this function and I'm confused. AFAICT (or
> maybe I have a stale BBDB?) it doesn't look for a special field, it
> looks in the notes-field. E.g.:
Notes and notes are two things in BBDB. The result of
bbdb-record-raw-notes is an alist with (field value)
elements, where one of the standard fields is the 'notes'
field, i.e. the one you add notes to an record.
> (setq records
> (delete
> nil
> (mapcar (lambda (r)
> (let ((notes (bbdb-record-raw-notes r)))
> (if (and notes
> (assq
> bbdb/vm-set-auto-folder-alist-field
> notes))
> r
> nil)))
> (bbdb-records))))
>
> At least in my database, the notes field is a simple string, and
> calling assq on it causes BBDB to blow up....
Did you actually got an error? I believe it is for ages
like I described it above ...
> My attempt to do this, admittedly redundant, did
>
> (bbdb-record-getprop record alist-field)
Still you are right, that it would be nicer to use
bbdb-record-getprop and it es even shorter and easier to
understand:
diff -u -r1.98 bbdb-vm.el
--- lisp/bbdb-vm.el 7 Mar 2003 22:13:25 -0000 1.98
+++ lisp/bbdb-vm.el 9 Oct 2006 22:50:38 -0000
@@ -297,12 +297,8 @@
(delete
nil
(mapcar (lambda (r)
- (let ((notes (bbdb-record-raw-notes r)))
- (if (and notes
- (assq bbdb/vm-set-auto-folder-alist-field
- notes))
- r
- nil)))
+ (if (bbdb-record-getprop r
bbdb/vm-set-auto-folder-alist-field)
+ r))
(bbdb-records))))
(while headers
It is in CVS now.
Robert
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/