chiark / gitweb /
dot/emacs (bbdb-canonicalize-net-hook): Handle `nil' address.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 24 Mar 2016 11:06:41 +0000 (11:06 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 14 Apr 2016 08:22:57 +0000 (09:22 +0100)
It turns out that, despite the documentation not mentioning this at all,
that the hook is allowed to return `nil' to suppress insertion of the
address into the database at all.  The only snag is that `nil' is
/still/ sent back to the hook to check for convergence.  So notice this
and return `nil' back, since it's not like we're going to be able to
turn it into anything more useful.

dot/emacs

index 13ac888936c23fbc947306447cf3c0b6c90dd3e4..afb08bdf4be21b053732a6bfbf28c81808ae2a7e 100644 (file)
--- a/dot/emacs
+++ b/dot/emacs
              "\\)$")
       bbdb-canonicalize-net-hook
       (lambda (addr)
-       (cond ((string-match (concat "^reply-[0-9a-f]+-[0-9a-f]+_"
+       (cond ((null addr)
+              nil)
+             ((string-match (concat "^reply-[0-9a-f]+-[0-9a-f]+_"
                                     "HTML-[0-9]+-[0-9]+-[0-9]+"
                                     "@\\(nationwide-communications\\.co\\.uk\\)")
                             addr)