I noticed recently bbdb-expire.el, which loks very promising. The 
only problem is that it patches the existing BBDB (attached).
Would it be possible to integrate this into BBDB?

PS. Please preserve CC, since my mailing list account are 
currently broken.

Jari

http://www.esperi.demon.co.uk/nix/downloads/bbdb-expire-1.4.tar.gz
[as listed in bbdb-change-suppression.diff]

diff -durN bbdb/lisp/bbdb.el bbdb-hacking/lisp/bbdb.el
--- bbdb/lisp/bbdb.el   Wed Jul 18 22:25:51 2001
+++ bbdb-hacking/lisp/bbdb.el   Wed Jul 18 22:25:01 2001
@@ -696,6 +696,20 @@
 (defvar bbdb-mode-search-map nil
   "Keymap for Insidious Big Brother Database searching")
 
+(defvar bbdb-suppress-changed-records-recording nil
+  "Whether to record changed records in variable `bbdb-changed-records'.
+
+If this is false, the BBDB will cease to remember which records are changed
+as the change happens.  It will still remember that records have been changed,
+so the file will still be saved, but the changed records list, and the `!!'
+in the *BBDB* buffer modeline that it depends on, will no longer be updated.
+
+You should bind this variable, not set it; the `!!' is a useful user-
+interface feature, and should only be suppressed when changes need to be
+automatically made to BBDB records which the user will not care directly
+about.")
+
+
 
 ;;; These are the buffer-local variables we use.
 ;;; They are mentioned here so that the compiler doesn't warn about them
@@ -1992,8 +2006,10 @@
 (defun bbdb-delete-record-internal (record)
   (if (null (bbdb-record-marker record)) (error "bbdb: marker unpresent"))
   (bbdb-with-db-buffer
-    (if (memq record bbdb-changed-records) nil
-        (setq bbdb-changed-records (cons record bbdb-changed-records)))
+    (if (or bbdb-suppress-changed-records-recording
+            (memq record bbdb-changed-records))
+        nil
+      (setq bbdb-changed-records (cons record bbdb-changed-records)))
     (let ((tail (memq record bbdb-records)))
       (if (null tail) (error "bbdb: unfound %s" record))
       (setq bbdb-records (delq record bbdb-records))
@@ -2036,8 +2052,10 @@
   (if (null (bbdb-record-marker record))
       (bbdb-record-set-marker record (make-marker)))
   (bbdb-with-db-buffer
-    (if (memq record bbdb-changed-records) nil
-        (setq bbdb-changed-records (cons record bbdb-changed-records)))
+    (if (or bbdb-suppress-changed-records-recording
+            (memq record bbdb-changed-records))
+        nil
+      (setq bbdb-changed-records (cons record bbdb-changed-records)))
     (let ((print-escape-newlines t))
       (bbdb-record-set-sortkey record nil) ; just in case...
       (setq bbdb-records
@@ -2077,8 +2095,10 @@
 
 (defun bbdb-overwrite-record-internal (record unmigrated)
   (bbdb-with-db-buffer
-    (if (memq record bbdb-changed-records) nil
-        (setq bbdb-changed-records (cons record bbdb-changed-records)))
+    (if (or bbdb-suppress-changed-records-recording
+            (memq record bbdb-changed-records))
+        nil
+      (setq bbdb-changed-records (cons record bbdb-changed-records)))
     (let ((print-escape-newlines t)
           (tail bbdb-records))
       ;; Look for record after RECORD in the database.  Use the
@@ -2122,6 +2142,11 @@
         record))))
 
 (defvar inside-bbdb-change-record nil "hands off")
+(defvar inside-bbdb-notice-hook nil
+  "Internal variable; hands off.
+Set to t by the BBDB when inside the `bbdb-notice-hook'.
+
+Calls to the `bbdb-change-hook' are suppressed when this is non-nil.")
 
 (defun bbdb-change-record (record need-to-sort)
   "Update the database after a change to the given record.  Second arg
@@ -2131,7 +2156,8 @@
       record
     (let ((inside-bbdb-change-record t)
           unmigrated)
-      (bbdb-invoke-hook 'bbdb-change-hook record)
+      (or inside-bbdb-notice-hook
+          (bbdb-invoke-hook 'bbdb-change-hook record))
       (bbdb-debug (if (bbdb-record-deleted-p record)
                       (error "bbdb: changing deleted record")))
       (if (/= (cdr bbdb-file-format-migration) bbdb-file-format)
@@ -2893,7 +2919,8 @@
                 (message "noticed naked address \"%s\"" net))))
         (if change-p
             (bbdb-change-record record (eq change-p 'sort)))
-        (bbdb-invoke-hook 'bbdb-notice-hook record)
+        (let ((inside-bbdb-notice-hook t))
+          (bbdb-invoke-hook 'bbdb-notice-hook record))
         record))))
 
 


_______________________________________________
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Reply via email to