emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] scratch/org-contacts-rebased 5f1806a 012/118: org-contacts: fix e


From: Stefan Monnier
Subject: [elpa] scratch/org-contacts-rebased 5f1806a 012/118: org-contacts: fix errors when Gnus or ERC are not loaded
Date: Fri, 12 Nov 2021 15:36:55 -0500 (EST)

branch: scratch/org-contacts-rebased
commit 5f1806a8d0ae631bd18f16e194af214a4fc80ad7
Author: Lomax Escarmant <lomax.e@gmail.com>
Commit: Julien Danjou <julien@danjou.info>

    org-contacts: fix errors when Gnus or ERC are not loaded
    
    Signed-off-by: Julien Danjou <julien@danjou.info>
---
 org-contacts.el | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/org-contacts.el b/org-contacts.el
index f846fe2..545e90e 100644
--- a/org-contacts.el
+++ b/org-contacts.el
@@ -239,9 +239,10 @@ If both match values are nil, return all contacts."
 
 (defun org-contacts-gnus-get-name-email ()
   "Get name and email address from Gnus message."
-  (gnus-with-article-headers
-    (mail-extract-address-components
-     (or (mail-fetch-field "From") ""))))
+  (if (gnus-alive-p)
+      (gnus-with-article-headers
+        (mail-extract-address-components
+         (or (mail-fetch-field "From") "")))))
 
 (defun org-contacts-gnus-article-from-get-marker ()
   "Return a marker for a contact based on From."
@@ -533,10 +534,11 @@ If ASK is set, ask for the email address even if there's 
only one address."
 
 (defun erc-nicknames-list ()
   "Return all nicknames of all ERC buffers."
-  (loop for buffer in (erc-buffer-list)
-        nconc (with-current-buffer buffer
-                (loop for user-entry in (mapcar 'car 
(erc-get-channel-user-list))
-                      collect (elt user-entry 1)))))
+  (if (fboundp 'erc-buffer-list)
+      (loop for buffer in (erc-buffer-list)
+            nconc (with-current-buffer buffer
+                    (loop for user-entry in (mapcar 'car 
(erc-get-channel-user-list))
+                          collect (elt user-entry 1))))))
 
 (add-to-list 'org-property-set-functions-alist
              `(,org-contacts-nickname-property . 
org-contacts-completing-read-nickname))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]