From cf8ae48b37207f09acc3a9f654743b3df8b7710f Mon Sep 17 00:00:00 2001 From: stardiviner Date: Sun, 6 Mar 2022 22:19:24 +0800 Subject: [PATCH] Add if logic on function erc-nicknames-list --- org-contacts.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/org-contacts.el b/org-contacts.el index d6e2e11..206838a 100644 --- a/org-contacts.el +++ b/org-contacts.el @@ -1040,8 +1040,11 @@ address." &optional predicate require-match initial-input hist def inherit-input-method) "Like `completing-read' but reads a nickname." - (org-completing-read prompt (append collection (erc-nicknames-list)) predicate require-match - initial-input hist def inherit-input-method)) + (if (featurep 'erc) + (org-completing-read prompt (append collection (erc-nicknames-list)) predicate require-match + initial-input hist def inherit-input-method) + (org-completing-read prompt collection predicate require-match + initial-input hist def inherit-input-method))) (defun erc-nicknames-list () "Return all nicknames of all ERC buffers."