org-contacts.el: Use `bound-and-true-p' to check (unbound) var

* org-contacts.el (org-contacts-link-store): Use `bound-and-true-p' to
check the truthiness of org-id-link-to-org-use-id, which may or may
not be bound depending on whether org-id has been loaded.  This
simplifies the code.
This commit is contained in:
David Florness 2021-01-04 23:20:51 -05:00 committed by stardiviner
parent eedaff3498
commit 3d9181c0c4

View file

@ -1166,7 +1166,7 @@ are effectively trimmed). If nil, all zero-length substrings are retained."
"Store the contact in `org-contacts-files' with a link." "Store the contact in `org-contacts-files' with a link."
(when (and (eq major-mode 'org-mode) (when (and (eq major-mode 'org-mode)
(member (buffer-file-name) (mapcar 'expand-file-name org-contacts-files))) (member (buffer-file-name) (mapcar 'expand-file-name org-contacts-files)))
(if (and (featurep 'org-id) org-id-link-to-org-use-id) (if (bound-and-true-p org-id-link-to-org-use-id)
(org-id-store-link) (org-id-store-link)
(let ((headline-str (substring-no-properties (org-get-heading t t t t)))) (let ((headline-str (substring-no-properties (org-get-heading t t t t))))
(org-store-link-props (org-store-link-props