summaryrefslogtreecommitdiff
path: root/lisp/org-bbdb.el
diff options
context:
space:
mode:
authorS├ębastien Delafond <sdelafond@gmail.com>2014-07-13 13:35:27 +0200
committerS├ębastien Delafond <sdelafond@gmail.com>2014-07-13 13:35:27 +0200
commite32a45ed36d6000db4b39171149072d11b77af72 (patch)
treeb5f4a7d43022c08c3298e82b3e9fc50f68be660f /lisp/org-bbdb.el
parent7697fa4daf3ec84f85711a84035d8f0224afd4e3 (diff)
Imported Upstream version 8.0.7
Diffstat (limited to 'lisp/org-bbdb.el')
-rw-r--r--lisp/org-bbdb.el19
1 files changed, 14 insertions, 5 deletions
diff --git a/lisp/org-bbdb.el b/lisp/org-bbdb.el
index be395ad..f122b67 100644
--- a/lisp/org-bbdb.el
+++ b/lisp/org-bbdb.el
@@ -1,6 +1,6 @@
;;; org-bbdb.el --- Support for links to BBDB entries from within Org-mode
-;; Copyright (C) 2004-2012 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2013 Free Software Foundation, Inc.
;; Authors: Carsten Dominik <carsten at orgmode dot org>
;; Thomas Baumann <thomas dot baumann at ch dot tum dot de>
@@ -116,8 +116,10 @@
(declare-function bbdb-search-name "ext:bbdb-com" (regexp &optional layout))
(declare-function bbdb-search-organization "ext:bbdb-com" (regexp &optional layout))
-;; `bbdb-record-note' is part of BBDB v3.x
+;; `bbdb-record-note' was part of BBDB v3.x
(declare-function bbdb-record-note "ext:bbdb" (record label))
+;; `bbdb-record-xfield' replaces it in recent BBDB v3.x+
+(declare-function bbdb-record-xfield "ext:bbdb" (record label))
(declare-function calendar-leap-year-p "calendar" (year))
(declare-function diary-ordinal-suffix "diary-lib" (n))
@@ -306,14 +308,17 @@ The hash table is created on first use.")
"Create a hash with anniversaries extracted from BBDB, for fast access.
The anniversaries are assumed to be stored `org-bbdb-anniversary-field'."
(let ((old-bbdb (fboundp 'bbdb-record-getprop))
+ (record-func (if (fboundp 'bbdb-record-xfield)
+ 'bbdb-record-xfield
+ 'bbdb-record-note))
split tmp annivs)
(clrhash org-bbdb-anniv-hash)
(dolist (rec (bbdb-records))
(when (setq annivs (if old-bbdb
(bbdb-record-getprop
rec org-bbdb-anniversary-field)
- (bbdb-record-note
- rec org-bbdb-anniversary-field)))
+ (funcall record-func
+ rec org-bbdb-anniversary-field)))
(setq annivs (if old-bbdb
(bbdb-split annivs "\n")
;; parameter order is reversed in new bbdb
@@ -338,7 +343,7 @@ This is used by Org to re-create the anniversary hash table."
(add-hook 'bbdb-after-change-hook 'org-bbdb-updated)
;;;###autoload
-(defun org-bbdb-anniversaries()
+(defun org-bbdb-anniversaries ()
"Extract anniversaries from BBDB for display in the agenda."
(require 'bbdb)
(require 'diary-lib)
@@ -433,4 +438,8 @@ END:VEVENT\n"
(provide 'org-bbdb)
+;; Local variables:
+;; generated-autoload-file: "org-loaddefs.el"
+;; End:
+
;;; org-bbdb.el ends here