Make org-link-set-parameters <- org-add-link-type API compatible.

This commit is contained in:
stardiviner 2022-06-01 13:54:13 +08:00
parent 2916aae933
commit 2de057e423

View file

@ -1206,7 +1206,9 @@ link string and return the pure link target."
;; Add the link type supported by org-contacts-strip-link ;; Add the link type supported by org-contacts-strip-link
;; so everything is in order for its use in Org files ;; so everything is in order for its use in Org files
(if (fboundp 'org-link-set-parameters)
(org-link-set-parameters "tel") (org-link-set-parameters "tel")
(org-add-link-type "tel"))
(defun org-contacts-split-property (string &optional separators omit-nulls) (defun org-contacts-split-property (string &optional separators omit-nulls)
"Custom version of `split-string'. "Custom version of `split-string'.
@ -1247,11 +1249,13 @@ are effectively trimmed). If nil, all zero-length substrings are retained."
;;;###autoload ;;;###autoload
;;; Add an Org link type `org-contact:' for easy jump to or searching org-contacts headline. ;;; Add an Org link type `org-contact:' for easy jump to or searching org-contacts headline.
;;; link spec: [[org-contact:query][desc]] ;;; link spec: [[org-contact:query][desc]]
(if (fboundp 'org-link-set-parameters)
(org-link-set-parameters "org-contact" (org-link-set-parameters "org-contact"
:follow #'org-contacts-link-open :follow #'org-contacts-link-open
:complete #'org-contacts-link-complete :complete #'org-contacts-link-complete
:store #'org-contacts-link-store :store #'org-contacts-link-store
:face 'org-contacts-link-face) :face 'org-contacts-link-face)
(org-add-link-type "org-contact" 'org-contacts-link-open))
;;;###autoload ;;;###autoload
(defun org-contacts-link-store () (defun org-contacts-link-store ()
@ -1343,7 +1347,9 @@ Each element has the form (NAME . (FILE . POSITION))."
;;; org-mode link "mailto:" email completion. ;;; org-mode link "mailto:" email completion.
(if (fboundp 'org-link-set-parameters)
(org-link-set-parameters "mailto" :complete #'org-contacts-mailto-link-completion) (org-link-set-parameters "mailto" :complete #'org-contacts-mailto-link-completion)
(org-add-link-type "mailto"))
(defun org-contacts-mailto-link--get-all-emails () (defun org-contacts-mailto-link--get-all-emails ()
"Retrieve all org-contacts EMAIL property values." "Retrieve all org-contacts EMAIL property values."