[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-contacts fe466ab2ae 139/154: Add org-mode mailto: l
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-contacts fe466ab2ae 139/154: Add org-mode mailto: link type :complete supporting |
Date: |
Fri, 9 Sep 2022 15:58:55 -0400 (EDT) |
branch: externals/org-contacts
commit fe466ab2aeeb4201179be88ac58a997473214aad
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>
Add org-mode mailto: link type :complete supporting
---
org-contacts.el | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/org-contacts.el b/org-contacts.el
index b06e39f16a..d452118f90 100644
--- a/org-contacts.el
+++ b/org-contacts.el
@@ -1318,7 +1318,7 @@ Each element has the form (NAME . (FILE . POSITION))."
;;;###autoload
(defun org-contacts-link-complete (&optional _arg)
"Create a org-contacts link using completion."
- (let ((name (completing-read "org-contact Name: "
+ (let ((name (completing-read "org-contacts NAME: "
(mapcar
(lambda (plist) (plist-get plist :name))
(org-contacts--all-contacts)))))
@@ -1331,6 +1331,32 @@ Each element has the form (NAME . (FILE . POSITION))."
'(:background "sky blue" :overline t :slant 'italic))
(t '(:inherit 'org-link))))
+
+;;; org-mode link "mailto:" email completion.
+(org-link-set-parameters "mailto" :complete
#'org-contacts-mailto-link-completion)
+
+(defun org-contacts-mailto-link--get-all-emails ()
+ "Retrieve all org-contacts EMAIL property values."
+ (mapcar
+ (lambda (contact)
+ (let* ((org-contacts-buffer (find-file-noselect (car org-contacts-files)))
+ (name (plist-get contact :name))
+ (position (plist-get contact :position))
+ (email (save-excursion
+ (with-current-buffer org-contacts-buffer
+ (goto-char position)
+ ;; (symbol-name (org-property-or-variable-value 'EMAIL))
+ (org-entry-get (point) "EMAIL")))))
+ ;; (cons name email)
+ email))
+ (org-contacts--all-contacts)))
+
+(defun org-contacts-mailto-link-completion (&optional _arg)
+ "Org mode link `mailto:' completion with org-contacts emails."
+ (let ((email (completing-read "org-contacts EMAIL: "
+ (org-contacts-mailto-link--get-all-emails))))
+ (concat "mailto:" email)))
+
(provide 'org-contacts)
;;; org-contacts.el ends here
- [elpa] externals/org-contacts 2c0bb90259 097/154: contrib/lisp/org-contacts.el: Add stardiviner as the maintainer, (continued)
- [elpa] externals/org-contacts 2c0bb90259 097/154: contrib/lisp/org-contacts.el: Add stardiviner as the maintainer, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts ca3b10d5a8 098/154: org-contacts.el: Fix org-store-link error caused by org-contacts, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 0e33f05c4e 105/154: org-contacts.el: Fix store link function does not return link., ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 3d9181c0c4 104/154: org-contacts.el: Use `bound-and-true-p' to check (unbound) var, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 3fa6b4c36b 120/154: Add package introduction in README, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 507e48cbd1 116/154: add README.org, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 986a5b3280 109/154: Prefer HTTPS to HTTP in most links, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 85dd965906 126/154: Remove testing code, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 39c7aba7dc 127/154: Remove all-completions code logic, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 0501463909 149/154: Also detect whether org API function `org-add-link-type' available., ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts fe466ab2ae 139/154: Add org-mode mailto: link type :complete supporting,
ELPA Syncer <=
- [elpa] externals/org-contacts 03a563b471 135/154: Add autoload cookies for org-link functions, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 3e075cdee4 123/154: Fix most of the compiler wanrings and add `Version:', ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 919511eb86 154/154: Adding org-contacts to GNU ELPA, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 2916aae933 144/154: Fix warning: Invalid face reference: quote. Invalid face attribute :inherit 'org-link, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 84436fd7bc 136/154: Fix org-contacts file narrowed not widen recovered bug., ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts e64df72db4 094/154: Rationalize `org-link-(un)escape', ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 478dfcc9b7 096/154: org-contacts.el: Add new link type "contact:", ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 2f8b3f024c 108/154: Prefer HTTPS to HTTP for links to gnu.org, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts f64d6edcd0 121/154: Update source code metadata keywords and usage description, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts bdf172eab8 129/154: Merge branch 'complete-contact', ELPA Syncer, 2022/09/09