From: Mark Wooding Date: Fri, 29 Apr 2016 16:00:53 +0000 (+0100) Subject: el/dot-emacs.el (org-bbdb-anniversaries): Fix up the list it returns. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/319736bd87f8b8ca3c86a13cd89a3dfe88587ca6?hp=--cc el/dot-emacs.el (org-bbdb-anniversaries): Fix up the list it returns. The standard function in Emacs 24 returns a list of strings (and nil things), which is bogus. Turn it into a string with newlines. This does work when more than one anniversary falls on the same date. --- 319736bd87f8b8ca3c86a13cd89a3dfe88587ca6 diff --git a/el/dot-emacs.el b/el/dot-emacs.el index cdc65f3..b235fcd 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -397,6 +397,19 @@ (defadvice diary-add-to-list (before mdw-trim-leading-space compile activate) (if (equal str old) (setq done t))) (ad-set-arg 1 str)))) +(defadvice org-bbdb-anniversaries (after mdw-fixup-list compile activate) + "Return a string rather than a list." + (with-temp-buffer + (let ((anyp nil)) + (dolist (e (let ((ee ad-return-value)) + (if (atom ee) (list ee) ee))) + (when e + (when anyp (insert ?\n)) + (insert e) + (setq anyp t))) + (setq ad-return-value + (and anyp (buffer-string)))))) + ;; Fighting with Org-mode's evil key maps. (defvar mdw-evil-keymap-keys