[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BBDB] Entry decay?
From: |
Jonas Steverud |
Subject: |
Re: [BBDB] Entry decay? |
Date: |
Fri, 04 Oct 2002 10:18:29 +0200 |
User-agent: |
Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.1 (sparc-sun-solaris2.8) |
Robert Marshall <spam@capuchin.co.uk> writes:
[...]
> So bbdb-expire works with bbdb 'out of the box' rather than what I said!
I made a change to the way it works, i don't like the idea of adding a
"permanent" field to all entries, it is mor common to have permanent
entries then expirable ones in my BBDB so I wrote the following code,
which is tested once (and worked):
;; Beginning of code
;; Since I don't want to expire all kinds of records, only those I've
;; marked for expiry, I need to add this function to
;; bbdb-expire-preservation-functions. Only records that contains the
;; bbdb-expire field and it is set to "Yes" (observe case!) is allowed
;; to be deleted. In my BBDB there are more records which are
;; permanent then there are records that are expireable, so doing this
;; with the "permanent" field is more work then using this approch.
(defun js-bbdb-expire-not-marked-for-expire-p (RECORD)
"If RECORD does contain the bbdb-expire field and it is set to ``Yes'',
it is considered to be expireable and the function returns nil,
otherwise it returns t. The logic is slightly inversed.
Best used in bbdb-expire-preservation-functions."
(not (string-equal "Yes" (bbdb-record-getprop RECORD 'bbdb-expire)))
)
(add-hook 'bbdb-expire-preservation-functions
'js-bbdb-expire-not-marked-for-expire-p)
(bbdb-expire-initialize)
;; End of code
--
( www.dtek.chalmers.se/~d4jonas/ ! Wei Wu Wei )
( Meaning of U2 Lyrics, Roleplaying ! To Do Without Do )