]> code.delx.au - gnu-emacs-elpa/commitdiff
Merge commit '3db1ea76a02993663d40e90c58da989212b9e81a' into gnorb-1.0.1
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 20 Apr 2015 01:35:42 +0000 (21:35 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 20 Apr 2015 01:35:42 +0000 (21:35 -0400)
1  2 
packages/gnorb/gnorb-bbdb.el

index 66be7938db83a5ee8d9e2a7cafa036d465c451a6,058011cc58e4fd364bf69404231736482b37c40a..4d32e20bcf8bfe3cbcb8e20fb53f9cc9c60ba8f1
@@@ -1,6 -1,6 +1,6 @@@
  ;;; gnorb-bbdb.el --- The BBDB-centric functions of gnorb
  
 -;; Copyright (C) 2014  Eric Abrahamsen
 +;; Copyright (C) 2014  Free Software Foundation, Inc.
  
  ;; Author: Eric Abrahamsen <eric@ericabrahamsen.net>
  ;; Keywords: 
@@@ -29,7 -29,6 +29,7 @@@
  
  (require 'bbdb)
  (require 'gnorb-utils)
 +(require 'cl-lib)
  
  (defgroup gnorb-bbdb nil
    "The BBDB bits of gnorb."
@@@ -41,9 -40,8 +41,9 @@@
    :group 'gnorb-bbdb
    :type 'symbol)
  
 -(unless (assoc gnorb-bbdb-org-tag-field bbdb-separator-alist)
 -  (push `(,gnorb-bbdb-org-tag-field ":" ":") bbdb-separator-alist))
 +(when (boundp 'bbdb-separator-alist)    ;Allow compilation if BBDB is absent!
 +  (unless (assoc gnorb-bbdb-org-tag-field bbdb-separator-alist)
 +    (push `(,gnorb-bbdb-org-tag-field ":" ":") bbdb-separator-alist)))
  
  (defcustom gnorb-bbdb-messages-field 'messages
    "The name (as a symbol) of the field where links to recent gnus
@@@ -110,7 -108,7 +110,7 @@@ mentioned in the docstring of `format-t
    Defaults to org-link."
    :group 'gnorb-bbdb)
  
 -(defstruct gnorb-bbdb-link
 +(cl-defstruct gnorb-bbdb-link
    subject date group id)
  
  (defcustom gnorb-bbdb-posting-styles nil
@@@ -153,8 -151,6 +153,8 @@@ be composed, just as in `gnus-posting-s
  An example value might look like:"
    :group 'gnorb-bbdb)
  
 +(defvar message-mode-hook)
 +
  (when (fboundp 'bbdb-record-xfield-string)
    (fset (intern (format "bbdb-read-xfield-%s"
                        gnorb-bbdb-org-tag-field))
@@@ -395,15 -391,17 +395,15 @@@ both, use \"C-u\" before the \"*\".
         (mapconcat
          'identity
          (delete-dups
 -         (cl-mapcan
 -          (lambda (r)
 -            (bbdb-record-xfield-split r gnorb-bbdb-org-tag-field))
 -          records))
 -        "|")))
 +         (cl-mapcan (lambda (r)
 +                   (bbdb-record-xfield-split r gnorb-bbdb-org-tag-field))
-                  records)))
-         "|")))
++                 records))
++          "|")))
      (if tag-string
        ;; C-u = all headings, not just todos
 -      (if (equal current-prefix-arg '(4))
 -          (org-tags-view nil tag-string)
 -        (org-tags-view t tag-string))
 +      (org-tags-view (not (equal current-prefix-arg '(4)))
 +                       tag-string)
-       (error "No org-tags field present")))
+       (error "No org-tags field present"))))
  
  ;;;###autoload
  (defun gnorb-bbdb-mail-search (records)
@@@ -422,13 -420,13 +422,13 @@@ a prefix arg and \"*\", the prefix arg 
                             gnorb-gnus-mail-search-backends)
                      (error "No search backend specified")))
         (search-string
 -        (funcall (second backend)
 +        (funcall (cl-second backend)
                   (cl-mapcan 'bbdb-record-mail records))))
      (when (equal current-prefix-arg '(4))
        (setq search-string
            (read-from-minibuffer
 -           (format "%s search string: " (first backend)) search-string)))
 -    (funcall (third backend) search-string)
 +           (format "%s search string: " (cl-first backend)) search-string)))
 +    (funcall (cl-third backend) search-string)
      (delete-other-windows)))  
  
  ;;;###autoload
  
  ;;; Field containing links to recent messages
  
 -(add-to-list 'bbdb-xfield-label-list gnorb-bbdb-messages-field nil 'eq)
 +(when (boundp 'bbdb-xfield-label-list)
 +  (add-to-list 'bbdb-xfield-label-list gnorb-bbdb-messages-field nil 'eq))
  
  (defun gnorb-bbdb-display-messages (record format)
    "Show links to the messages collected in the