[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] scratch/org-contacts-rebased fc25530 074/118: contrib/lisp/org-co
From: |
Stefan Monnier |
Subject: |
[elpa] scratch/org-contacts-rebased fc25530 074/118: contrib/lisp/org-contacts.el: Add a hook to allow users to plug completion functions |
Date: |
Fri, 12 Nov 2021 15:37:07 -0500 (EST) |
branch: scratch/org-contacts-rebased
commit fc2553023b42928f0e9e964572c83c0cf011f70e
Author: Grégoire Jadi <gregoire.jadi@gmail.com>
Commit: Grégoire Jadi <gregoire.jadi@gmail.com>
contrib/lisp/org-contacts.el: Add a hook to allow users to plug completion
functions
* contrib/lisp/org-contacts.el (org-contacts-complete-functions): A
hook that contains the list of functions used to complete contacts.
(org-contacts-message-complete-function): Use the new hook.
Suggested by John Kitchin.
---
org-contacts.el | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/org-contacts.el b/org-contacts.el
index 7cc42fc..ac43f9d 100644
--- a/org-contacts.el
+++ b/org-contacts.el
@@ -183,6 +183,12 @@ This overrides `org-email-link-description-format' if set."
:group 'org-contacts
:type 'boolean)
+(defcustom org-contacts-complete-functions
+ '(org-contacts-complete-group org-contacts-complete-name)
+ "List of functions used to complete contacts in `message-mode'."
+ :group 'org-contacts
+ :type 'hook)
+
;; Decalre external functions and variables
(declare-function org-reverse-string "org")
(declare-function diary-ordinal-suffix "ext:diary-lib")
@@ -512,7 +518,6 @@ A group FOO is composed of contacts with the tag FOO."
(completion-table-case-fold completion-list
(not
org-contacts-completion-ignore-case))))))))
-
(defun org-contacts-remove-ignored-property-values (ignore-list list)
"Remove all ignore-list's elements from list and you can use
regular expressions in the ignore list."
@@ -570,8 +575,8 @@ A group FOO is composed of contacts with the tag FOO."
(goto-char (match-end 0))
(point))))
(string (buffer-substring start end)))
- (or (org-contacts-complete-group start end string)
- (org-contacts-complete-name start end string))))))
+ (run-hook-with-args-until-success
+ 'org-contacts-complete-functions start end string)))))
(defun org-contacts-gnus-get-name-email ()
"Get name and email address from Gnus message."
- [elpa] scratch/org-contacts-rebased 7b87e73 106/118: Prefer HTTPS to HTTP in most links, (continued)
- [elpa] scratch/org-contacts-rebased 7b87e73 106/118: Prefer HTTPS to HTTP in most links, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 03dc64d 110/118: Change how completion is done, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 18ba907 114/118: Try to support different type of AVATAR property., Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 45bc95a 083/118: org-contacts: Fix org-contacts-matcher for BIRTHDAYs, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 49dd482 089/118: Use `string-match-p' instead of `org-string-match-p', Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 124cc7a 098/118: org-contacts.el: Add usage comments, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased b2837af 109/118: simplify logic, remove unused variables, switch to lexical binding, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 5174678 116/118: Fix AVATAR property value not exist problem, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 1be8aa9 069/118: Merge branch 'maint', Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 9c233be 070/118: Revert "Update copyright years.", Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased fc25530 074/118: contrib/lisp/org-contacts.el: Add a hook to allow users to plug completion functions,
Stefan Monnier <=
- [elpa] scratch/org-contacts-rebased d3509e4 076/118: contrib/lisp/org-contacts.el: Complete contacts using tags and properties, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 6bcb093 079/118: contrib: Fix error messages., Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 44968ec 084/118: Make `org-make-tags-matcher' lexical binding friendly, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 034be20 093/118: org-contacts.el: Add new link type "contact:", Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 7161351 094/118: contrib/lisp/org-contacts.el: Add stardiviner as the maintainer, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 3beb906 057/118: org-contacts: Use progress-reporter for cache update message, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 0c439a4 102/118: org-contacts.el: Fix store link function does not return link., Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased cf0668a 064/118: org-contacts: Provide ordering when using cycle completion, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 8e07b36 082/118: contrib: move a few libraries to cl-lib in place of compile-time cl., Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 9a80cca 085/118: org-contacts: Register "tel" link, Stefan Monnier, 2021/11/12