chiark / gitweb /
el/dot-emacs.el (org-bbdb-anniversaries): Fix up the list it returns.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 29 Apr 2016 16:00:53 +0000 (17:00 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 29 Apr 2016 16:00:53 +0000 (17:00 +0100)
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.

el/dot-emacs.el

index cdc65f3343b67f26c266a522b0e151ff14a1c339..b235fcd5c51e419ab06da82e1857e5ec9e5556f9 100644 (file)
@@ -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