]> code.delx.au - gnu-emacs-elpa/blob - packages/gnorb/gnorb-bbdb.el
Merge commit '4d47113ec079dfac1bacb987572c93eefdb176ba'
[gnu-emacs-elpa] / packages / gnorb / gnorb-bbdb.el
1 ;;; gnorb-bbdb.el --- The BBDB-centric functions of gnorb
2
3 ;; Copyright (C) 2014 Free Software Foundation, Inc.
4
5 ;; Author: Eric Abrahamsen <eric@ericabrahamsen.net>
6 ;; Keywords:
7
8 ;; This program is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
12
13 ;; This program is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
17
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21 ;;; Commentary:
22
23 ;;
24
25 ;;; Code:
26
27 (require 'bbdb nil t)
28 (require 'gnorb-utils)
29 (require 'cl-lib)
30
31 (defgroup gnorb-bbdb nil
32 "The BBDB bits of gnorb."
33 :tag "Gnorb BBDB"
34 :group 'gnorb)
35
36 (defcustom gnorb-bbdb-org-tag-field 'org-tags
37 "The name (as a symbol) of the field to use for org tags."
38 :group 'gnorb-bbdb
39 :type 'symbol)
40
41 (when (boundp 'bbdb-separator-alist) ;Allow compilation if BBDB is absent!
42 (unless (assoc gnorb-bbdb-org-tag-field bbdb-separator-alist)
43 (push `(,gnorb-bbdb-org-tag-field ":" ":") bbdb-separator-alist)))
44
45 (defcustom gnorb-bbdb-messages-field 'messages
46 "The name (as a symbol) of the field where links to recent gnus
47 messages from this record are stored.
48
49 \\<bbdb-mode-map>Records that do not have this field defined
50 will not collect links to messages: you have to call
51 \"\\[gnorb-bbdb-open-link]\" on the record once -- after that,
52 message links will be collected and updated automatically."
53 :group 'gnorb-bbdb
54 :type 'symbol)
55
56 (defcustom gnorb-bbdb-collect-N-messages 5
57 "For records with a `gnorb-bbdb-messages-field' defined,
58 collect links to a maximum of this many messages."
59 :group 'gnorb-bbdb
60 :type 'integer)
61
62 (defcustom gnorb-bbdb-define-recent 'seen
63 "For records with a `gnorb-bbdb-message-tag-field' defined,
64 this variable controls how gnorb defines a \"recent\" message.
65 Setting it to the symbol seen will collect the messages most
66 recently opened and viewed. The symbol received means gnorb will
67 collect the most recent messages by Date header.
68
69 In other words, if this variable is set to 'received, and a
70 record's messages field is already full of recently-received
71 messages, opening a five-year-old message (for instance) from
72 this record will not push a link to the message into the field."
73 :group 'gnorb-bbdb
74 :type '(choice (const :tag "Most recently seen" 'seen)
75 (const :tag "Most recently received" 'received)))
76
77 (defcustom gnorb-bbdb-message-link-format-multi "%:count. %D: %:subject"
78 "How a single message is formatted in the list of recent messages.
79 This format string is used in multi-line record display.
80
81 Available information for each message includes the subject, the
82 date, and the message's count in the list, as an integer. You can
83 access subject and count using the %:subject and %:count escapes.
84 The message date can be formatted using any of the escapes
85 mentioned in the docstring of `format-time-string', which see."
86 :group 'gnorb-bbdb
87 :type 'string)
88
89 (defcustom gnorb-bbdb-message-link-format-one "%:count"
90 "How a single message is formatted in the list of recent messages.
91 This format string is used in single-line display -- note that by
92 default, no user-created xfields are displayed in the 'one-line
93 layout found in `bbdb-layout-alist'. If you want this field to
94 appear there, put its name in the \"order\" list of the 'one-line
95 layout.
96
97 Available information for each message includes the subject, the
98 date, and the message's count in the list, as an integer. You can
99 access subject and count using the %:subject and %:count escapes.
100 The message date can be formatted using any of the escapes
101 mentioned in the docstring of `format-time-string', which see."
102 :group 'gnorb-bbdb
103 :type 'string)
104
105 (defface gnorb-bbdb-link (org-compatible-face 'org-link nil)
106 "Custom face for displaying message links in the *BBDB* buffer.
107 Defaults to org-link."
108 :group 'gnorb-bbdb)
109
110 (cl-defstruct gnorb-bbdb-link
111 subject date group id)
112
113 (defcustom gnorb-bbdb-posting-styles nil
114 "An alist of styles to use when composing messages to the BBDB
115 record(s) under point. This is entirely analogous to
116 `gnus-posting-styles', it simply works by examining record fields
117 rather than group names.
118
119 When composing a message to multiple contacts (using the \"*\"
120 prefix), the records will be scanned in order, with the record
121 initially under point (if any) set aside for last. That means
122 that, in the case of conflicting styles, the record under point
123 will override the others.
124
125 In order not to be too intrusive, this option has no effect on
126 the usual `bbdb-mail' command. Instead, the wrapper command
127 `gnorb-bbdb-mail' is provided, which consults this option and
128 then hands off to `bbdb-compose-mail'. If you'd always like to
129 use `gnorb-bbdb-mail', you can simply bind it to \"m\" in the
130 `bbdb-mode-map'.
131
132 The value of the option should be a list of sexps, each one
133 matching a single field. The first element should match a field
134 name: one of the built-in fields like lastname, or an xfield.
135 Field names should be given as symbols.
136
137 The second element is a regexp used to match against the value of
138 the field (non-string field values will be cast to strings, if
139 possible). It can also be a cons of two strings, the first of
140 which matches the field label, the second the field value.
141
142 Alternately, the first element can be the name of a custom
143 function that is called with the record as its only argument, and
144 returns either t or nil. In this case, the second element of the
145 list is disregarded.
146
147 All following elements should be field setters for the message to
148 be composed, just as in `gnus-posting-styles'.
149
150 An example value might look like:"
151 :group 'gnorb-bbdb)
152
153 (when (fboundp 'bbdb-record-xfield-string)
154 (fset (intern (format "bbdb-read-xfield-%s"
155 gnorb-bbdb-org-tag-field))
156 (lambda (&optional init)
157 (gnorb-bbdb-read-org-tags init)))
158
159 (fset (intern (format "bbdb-display-%s-multi-line"
160 gnorb-bbdb-org-tag-field))
161 (lambda (record)
162 (gnorb-bbdb-display-org-tags record))))
163
164 (defun gnorb-bbdb-read-org-tags (&optional init)
165 "Read Org mode tags, with `completing-read-multiple'."
166 (if (string< "24.3" (substring emacs-version 0 4))
167 (let ((crm-separator
168 (concat "[ \t\n]*"
169 (cadr (assq gnorb-bbdb-org-tag-field
170 bbdb-separator-alist))
171 "[ \t\n]*"))
172 (crm-local-completion-map bbdb-crm-local-completion-map)
173 (table (cl-mapcar #'car
174 (org-global-tags-completion-table
175 (org-agenda-files))))
176 (init (if (consp init)
177 (bbdb-join init
178 (nth 2 (assq gnorb-bbdb-org-tag-field
179 bbdb-separator-alist)))
180 init)))
181 (completing-read-multiple
182 "Tags: " table
183 nil nil init))
184 (bbdb-split gnorb-bbdb-org-tag-field
185 (bbdb-read-string "Tags: " init))))
186
187 (defun gnorb-bbdb-display-org-tags (record)
188 "Display the Org tags associated with the record.
189
190 Org tags are stored in the `gnorb-bbdb-org-tags-field'."
191 (let ((full-field (assq gnorb-bbdb-org-tag-field
192 (bbdb-record-xfields record)))
193 (val (bbdb-record-xfield
194 record
195 gnorb-bbdb-org-tag-field)))
196 (when val
197 ;; We already know that `fmt' and `indent' are dynamically
198 ;; bound, shut up about it.
199 (with-no-warnings
200 (bbdb-display-text (format fmt gnorb-bbdb-org-tag-field)
201 `(xfields ,full-field field-label)
202 'bbdb-field-name)
203 (if (consp val)
204 (bbdb-display-list val gnorb-bbdb-org-tag-field "\n")
205 (insert
206 (bbdb-indent-string (concat val "\n") indent)))))))
207
208 (defvar message-mode-hook)
209
210 ;;;###autoload
211 (defun gnorb-bbdb-mail (records &optional subject n verbose)
212 "\\<bbdb-mode-map>Acts just like `bbdb-mail', except runs
213 RECORDS through `gnorb-bbdb-posting-styles', allowing
214 customization of message styles for certain records. From the
215 `bbdb-mail' docstring:
216
217 Compose a mail message to RECORDS (optional: using SUBJECT).
218 Interactively, use BBDB prefix \\[bbdb-do-all-records], see
219 `bbdb-do-all-records'. By default, the first mail addresses of
220 RECORDS are used. If prefix N is a number, use Nth mail address
221 of RECORDS (starting from 1). If prefix N is C-u (t
222 noninteractively) use all mail addresses of RECORDS. If VERBOSE
223 is non-nil (as in interactive calls) be verbose."
224 ;; see the function `gnus-configure-posting-styles' for tips on how
225 ;; to actually do this.
226 (interactive (list (bbdb-do-records) nil
227 (or (consp current-prefix-arg)
228 current-prefix-arg)
229 t))
230 (setq records (bbdb-record-list records))
231 (if (not records)
232 (user-error "No records displayed")
233 (let ((head (bbdb-current-record))
234 (to (bbdb-mail-address records n nil verbose))
235 (message-mode-hook (copy-sequence message-mode-hook)))
236 (setq records (remove head records))
237 (when gnorb-bbdb-posting-styles
238 (add-hook 'message-mode-hook
239 `(lambda ()
240 (gnorb-bbdb-configure-posting-styles (quote ,records))
241 (gnorb-bbdb-configure-posting-styles (list ,head)))))
242 (bbdb-compose-mail to subject))))
243
244 (defun gnorb-bbdb-configure-posting-styles (recs)
245 ;; My most magnificent work of copy pasta!
246 (dolist (r recs)
247 (let (field val label rec-val element filep
248 element v value results name address)
249 (dolist (style gnorb-bbdb-posting-styles)
250 (setq field (pop style)
251 val (pop style))
252 (when (consp val) ;; (label value)
253 (setq label (pop val)
254 val (pop val)))
255 (unless (fboundp field)
256 ;; what's the record's existing value for this field?
257 (setq rec-val (bbdb-record-field r field)))
258 (when (cond
259 ((eq field 'address)
260 (dolist (a rec-val)
261 (unless (and label
262 (not (string-match label (car a))))
263 (string-match val (bbdb-format-address-default a)))))
264 ((eq field 'phone)
265 (dolist (p rec-val)
266 (unless (and label
267 (not (string-match label (car p))))
268 (string-match val (bbdb-phone-string p)))))
269 ((consp rec-val)
270 (dolist (f rec-val)
271 (string-match val f)))
272 ((fboundp field)
273 (funcall field r))
274 ((stringp rec-val)
275 (string-match val rec-val)))
276 ;; there are matches, run through the field setters in last
277 ;; element of the sexp
278 (dolist (attribute style)
279 (setq element (pop attribute)
280 filep nil)
281 (setq value
282 (cond
283 ((eq (car attribute) :file)
284 (setq filep t)
285 (cadr attribute))
286 ((eq (car attribute) :value)
287 (cadr attribute))
288 (t
289 (car attribute))))
290 ;; We get the value.
291 (setq v
292 (cond
293 ((stringp value)
294 value)
295 ((or (symbolp value)
296 (functionp value))
297 (cond ((functionp value)
298 (funcall value))
299 ((boundp value)
300 (symbol-value value))))
301 ((listp value)
302 (eval value))))
303 ;; Post-processing for the signature posting-style:
304 (and (eq element 'signature) filep
305 message-signature-directory
306 ;; don't actually use the signature directory
307 ;; if message-signature-file contains a path.
308 (not (file-name-directory v))
309 (setq v (nnheader-concat message-signature-directory v)))
310 ;; Get the contents of file elems.
311 (when (and filep v)
312 (setq v (with-temp-buffer
313 (insert-file-contents v)
314 (buffer-substring
315 (point-min)
316 (progn
317 (goto-char (point-max))
318 (if (zerop (skip-chars-backward "\n"))
319 (point)
320 (1+ (point))))))))
321 (setq results (delq (assoc element results) results))
322 (push (cons element v) results))))
323 (setq name (assq 'name results)
324 address (assq 'address results))
325 (setq results (delq name (delq address results)))
326 (gnus-make-local-hook 'message-setup-hook)
327 (setq results (sort results (lambda (x y)
328 (string-lessp (car x) (car y)))))
329 (dolist (result results)
330 (add-hook 'message-setup-hook
331 (cond
332 ((eq 'eval (car result))
333 'ignore)
334 ((eq 'body (car result))
335 `(lambda ()
336 (save-excursion
337 (message-goto-body)
338 (insert ,(cdr result)))))
339 ((eq 'signature (car result))
340 (set (make-local-variable 'message-signature) nil)
341 (set (make-local-variable 'message-signature-file) nil)
342 (if (not (cdr result))
343 'ignore
344 `(lambda ()
345 (save-excursion
346 (let ((message-signature ,(cdr result)))
347 (when message-signature
348 (message-insert-signature)))))))
349 (t
350 (let ((header
351 (if (symbolp (car result))
352 (capitalize (symbol-name (car result)))
353 (car result))))
354 `(lambda ()
355 (save-excursion
356 (message-remove-header ,header)
357 (let ((value ,(cdr result)))
358 (when value
359 (message-goto-eoh)
360 (insert ,header ": " value)
361 (unless (bolp)
362 (insert "\n")))))))))
363 t 'local))
364 (when (or name address)
365 (add-hook 'message-setup-hook
366 `(lambda ()
367 (set (make-local-variable 'user-mail-address)
368 ,(or (cdr address) user-mail-address))
369 (let ((user-full-name ,(or (cdr name) (user-full-name)))
370 (user-mail-address
371 ,(or (cdr address) user-mail-address)))
372 (save-excursion
373 (message-remove-header "From")
374 (message-goto-eoh)
375 (insert "From: " (message-make-from) "\n"))))
376 t 'local)))))
377
378 ;;;###autoload
379 (defun gnorb-bbdb-tag-agenda (records)
380 "Open an Org agenda tags view from the BBDB buffer, using the
381 value of the record's org-tags field. This shows only TODOs by
382 default; a prefix argument shows all tagged headings; a \"*\"
383 prefix operates on all currently visible records. If you want
384 both, use \"C-u\" before the \"*\"."
385 (interactive (list (bbdb-do-records)))
386 (require 'org-agenda)
387 (unless (and (eq major-mode 'bbdb-mode)
388 (equal (buffer-name) bbdb-buffer-name))
389 (error "Only works in the BBDB buffer"))
390 (setq records (bbdb-record-list records))
391 (let ((tag-string
392 (mapconcat
393 'identity
394 (delete-dups
395 (cl-mapcan
396 (lambda (r)
397 (bbdb-record-xfield-split r gnorb-bbdb-org-tag-field))
398 records))
399 "|")))
400 (if tag-string
401 ;; C-u = all headings, not just todos
402 (if (equal current-prefix-arg '(4))
403 (org-tags-view nil tag-string)
404 (org-tags-view t tag-string))
405 (error "No org-tags field present"))))
406
407 ;;;###autoload
408 (defun gnorb-bbdb-mail-search (records)
409 "Initiate a mail search from the BBDB buffer.
410
411 Use the prefix arg to edit the search string first, and the \"*\"
412 prefix to search mails from all visible contacts. When using both
413 a prefix arg and \"*\", the prefix arg must come first."
414 (interactive (list (bbdb-do-records)))
415 (unless (and (eq major-mode 'bbdb-mode)
416 (equal (buffer-name) bbdb-buffer-name))
417 (error "Only works in the BBDB buffer"))
418 (setq records (bbdb-record-list records))
419 (require 'gnorb-gnus)
420 (let* ((backend (or (assoc gnorb-gnus-mail-search-backend
421 gnorb-gnus-mail-search-backends)
422 (error "No search backend specified")))
423 (search-string
424 (funcall (cl-second backend)
425 (cl-mapcan 'bbdb-record-mail records))))
426 (when (equal current-prefix-arg '(4))
427 (setq search-string
428 (read-from-minibuffer
429 (format "%s search string: " (first backend)) search-string)))
430 (funcall (cl-third backend) search-string)
431 (delete-other-windows)))
432
433 ;;;###autoload
434 (defun gnorb-bbdb-cite-contact (rec)
435 (interactive (list (gnorb-prompt-for-bbdb-record)))
436 (let ((mail-string (bbdb-dwim-mail rec)))
437 (if (called-interactively-p 'any)
438 (insert mail-string)
439 mail-string)))
440
441 ;;; Field containing links to recent messages
442 (when (boundp 'bbdb-xfield-label-list)
443 (add-to-list 'bbdb-xfield-label-list gnorb-bbdb-messages-field nil 'eq))
444
445 (defun gnorb-bbdb-display-messages (record format)
446 "Show links to the messages collected in the
447 `gnorb-bbdb-messages-field' field of a BBDB record. Each link
448 will be formatted using the format string in
449 `gnorb-bbdb-message-link-format-multi' or
450 `gnorb-bbdb-message-link-format-one', depending on the current
451 layout type."
452 (let ((full-field (assq gnorb-bbdb-messages-field
453 (bbdb-record-xfields record)))
454 (val (bbdb-record-xfield record gnorb-bbdb-messages-field))
455 (map (make-sparse-keymap))
456 (count 1)) ; one-indexed to fit with prefix arg to `gnorb-bbdb-open-link'
457 (define-key map [mouse-1] 'gnorb-bbdb-mouse-open-link)
458 (define-key map (kbd "<RET>") 'gnorb-bbdb-RET-open-link)
459 (when val
460 (when (eq format 'multi)
461 (with-no-warnings ; For `fmt'
462 (bbdb-display-text (format fmt gnorb-bbdb-messages-field)
463 `(xfields ,full-field field-label)
464 'bbdb-field-name)))
465 (insert (cond ((and (stringp val)
466 (eq format 'multi))
467 (with-no-warnings ; For `indent'
468 (bbdb-indent-string (concat val "\n") indent)))
469 ((listp val)
470 ;; Why aren't I using `bbdb-display-list' with a
471 ;; preformatted list of messages?
472 (concat
473 (with-no-warnings ; For `indent' again
474 (bbdb-indent-string
475 (mapconcat
476 (lambda (m)
477 (prog1
478 (org-propertize
479 (concat
480 (format-time-string
481 (replace-regexp-in-string
482 "%:subject" (gnorb-bbdb-link-subject m)
483 (replace-regexp-in-string
484 "%:count" (number-to-string count)
485 (if (eq format 'multi)
486 gnorb-bbdb-message-link-format-multi
487 gnorb-bbdb-message-link-format-one)))
488 (gnorb-bbdb-link-date m)))
489 'face 'gnorb-bbdb-link
490 'mouse-face 'highlight
491 'gnorb-bbdb-link-count count
492 'keymap map)
493 (incf count)))
494 val (if (eq format 'multi)
495 "\n" ", "))
496 indent))
497 (if (eq format 'multi) "\n" "")))
498 (t
499 ""))))))
500
501 (fset (intern (format "bbdb-display-%s-multi-line"
502 gnorb-bbdb-messages-field))
503 (lambda (record)
504 (gnorb-bbdb-display-messages record 'multi)))
505
506 (fset (intern (format "bbdb-display-%s-one-line"
507 gnorb-bbdb-messages-field))
508 (lambda (record)
509 (gnorb-bbdb-display-messages record 'one)))
510
511 ;; Don't allow direct editing of this field
512
513 (fset (intern (format "bbdb-read-xfield-%s"
514 gnorb-bbdb-messages-field))
515 (lambda (&optional init)
516 (user-error "This field shouldn't be edited manually")))
517
518 ;; Open links from the *BBDB* buffer.
519
520 ;;;###autoload
521 (defun gnorb-bbdb-open-link (record arg)
522 "\\<bbdb-mode-map>Call this on a BBDB record to open one of the
523 links in the message field. By default, the first link will be
524 opened. Use a prefix arg to open different links. For instance,
525 M-3 \\[gnorb-bbdb-open-link] will open the third link in the
526 list. If the %:count escape is present in the message formatting
527 string (see `gnorb-bbdb-message-link-format-multi' and
528 `gnorb-bbdb-message-link-format-one'), that's the number to use.
529
530 This function also needs to be called on a contact once before
531 that contact will start collecting links to messages."
532 (interactive (list
533 (or (bbdb-current-record)
534 (user-error "No record under point"))
535 current-prefix-arg))
536 (unless (fboundp 'bbdb-record-xfield-string)
537 (user-error "This function only works with the git version of BBDB"))
538 (let* ((record (bbdb-current-record))
539 msg-list target-msg)
540 (if (not (memq gnorb-bbdb-messages-field
541 (mapcar 'car (bbdb-record-xfields record))))
542 (when (y-or-n-p
543 (format "Start collecting message links for %s?"
544 (bbdb-record-name record)))
545 (bbdb-record-set-xfield record gnorb-bbdb-messages-field "no links yet")
546 (message "Opening messages from %s will add links to the %s field"
547 (bbdb-record-name record)
548 gnorb-bbdb-messages-field)
549 (bbdb-change-record record))
550 (setq msg-list
551 (bbdb-record-xfield record gnorb-bbdb-messages-field))
552 (setq target-msg
553 (or (and arg
554 (nth (1- arg) msg-list))
555 (car msg-list)))
556 (when target-msg
557 (org-gnus-follow-link (gnorb-bbdb-link-group target-msg)
558 (gnorb-bbdb-link-id target-msg))))))
559
560 (defun gnorb-bbdb-mouse-open-link (event)
561 (interactive "e")
562 (mouse-set-point event)
563 (let ((rec (bbdb-current-record))
564 (num (get-text-property (point) 'gnorb-bbdb-link-count)))
565 (if (not num)
566 (user-error "No link under point")
567 (gnorb-bbdb-open-link rec num))))
568
569 (defun gnorb-bbdb-RET-open-link ()
570 (interactive)
571 (let ((rec (bbdb-current-record))
572 (num (get-text-property (point) 'gnorb-bbdb-link-count)))
573 (if (not num)
574 (user-error "No link under point")
575 (gnorb-bbdb-open-link rec num))))
576
577 (defun gnorb-bbdb-store-message-link (record)
578 "Used in the `bbdb-notice-record-hook' to possibly save a link
579 to a message into the record's `gnorb-bbdb-messages-field'."
580
581 (when (not (fboundp 'bbdb-record-xfield-string))
582 (user-error "This function only works with the git version of BBDB"))
583 (unless (or (not (and (memq gnorb-bbdb-messages-field
584 (mapcar 'car (bbdb-record-xfields record)))
585 (memq major-mode '(gnus-summary-mode gnus-article-mode))))
586 (with-current-buffer gnus-article-buffer
587 (not ; only store messages if the record is the sender
588 (member (nth 1 (car (bbdb-get-address-components 'sender)))
589 (bbdb-record-mail record)))))
590 (with-current-buffer gnus-summary-buffer
591 (let* ((val (bbdb-record-xfield record gnorb-bbdb-messages-field))
592 (art-no (gnus-summary-article-number))
593 (heads (gnus-summary-article-header art-no))
594 (date (apply 'encode-time
595 (parse-time-string (mail-header-date heads))))
596 (subject (mail-header-subject heads))
597 (id (mail-header-id heads))
598 (group (gnorb-get-real-group-name
599 gnus-newsgroup-name
600 art-no))
601 link)
602 (if (not (and date subject id group))
603 (message "Could not save a link to this message")
604 (setq link (make-gnorb-bbdb-link :subject subject :date date
605 :group group :id id))
606 (when (stringp val)
607 (setq val nil))
608 (setq val (cons link (delete link val)))
609 (when (eq gnorb-bbdb-define-recent 'received)
610 (setq val (sort val
611 (lambda (a b)
612 (time-less-p
613 (gnorb-bbdb-link-date b)
614 (gnorb-bbdb-link-date a))))))
615 (setq val (cl-subseq val 0 (min (length val) gnorb-bbdb-collect-N-messages)))
616 (bbdb-record-set-xfield record
617 gnorb-bbdb-messages-field
618 (delq nil val))
619 (bbdb-change-record record))))))
620
621 (add-hook 'bbdb-notice-record-hook 'gnorb-bbdb-store-message-link)
622
623 (provide 'gnorb-bbdb)
624 ;;; gnorb-bbdb.el ends here