[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-contacts 271ec25b43 062/154: contrib/lisp/org-conta
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-contacts 271ec25b43 062/154: contrib/lisp/org-contacts.el: Permit to unload properly `org-contacts' |
Date: |
Fri, 9 Sep 2022 15:58:27 -0400 (EDT) |
branch: externals/org-contacts
commit 271ec25b43470ad451b0d97c3120e734b9c0efbc
Author: Grégoire Jadi <gregoire.jadi@gmail.com>
Commit: Grégoire Jadi <gregoire.jadi@gmail.com>
contrib/lisp/org-contacts.el: Permit to unload properly `org-contacts'
* contrib/lisp/org-contacts.el (org-contacts-setup-completion-at-point):
Setup `completion-at-point-functions' in a dedicated function so it's
easier to add and to remove it from `message-mode-hook'.
(org-contacts-unload-hook): This function removes all hooks added while
loading `org-contacts' in order to respect Emacs coding conventions.
---
org-contacts.el | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/org-contacts.el b/org-contacts.el
index c84f1f2f99..d81d43bc4b 100644
--- a/org-contacts.el
+++ b/org-contacts.el
@@ -702,12 +702,18 @@ This adds `org-contacts-gnus-check-mail-address' and
(add-hook 'gnus-article-prepare-hook 'org-contacts-gnus-check-mail-address)
(add-hook 'gnus-article-prepare-hook 'org-contacts-gnus-store-last-mail))
+(defun org-contacts-setup-completion-at-point ()
+ "Add `org-contacts-message-complete-function' as a new function
+to complete the thing at point."
+ (add-to-list 'completion-at-point-functions
+ 'org-contacts-message-complete-function))
+
+(defun org-contacts-unload-hook ()
+ (remove-hook 'message-mode-hook 'org-contacts-setup-completion-at-point))
+
(when (and org-contacts-enable-completion
(boundp 'completion-at-point-functions))
- (add-hook 'message-mode-hook
- (lambda ()
- (add-to-list 'completion-at-point-functions
- 'org-contacts-message-complete-function))))
+ (add-hook 'message-mode-hook 'org-contacts-setup-completion-at-point))
(defun org-contacts-wl-get-from-header-content ()
"Retrieve the content of the `From' header of an email.
- [elpa] externals/org-contacts 25211e8066 068/154: org-contacts: Ensure contacts cache is updated if it contains markers with no buffer, (continued)
- [elpa] externals/org-contacts 25211e8066 068/154: org-contacts: Ensure contacts cache is updated if it contains markers with no buffer, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts dcd8af90c9 028/154: Merge branch 'maint', ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts ad7f57a603 023/154: Fix error messages: don't use a dot at the end, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 81129c4c07 046/154: org-contacts.el: Fix or add docstrings, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts f6d87ee7f3 044/154: contrib/lisp/org-contacts.el: Fix compiler warnings., ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts b789764458 047/154: contrib/lisp/*el: Fix license information and add "This file is not part...", ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 58afa03d8c 050/154: Let org-contacts.el has the ability which can export email-address list, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts ea8cbe4ca1 013/154: Fix copyright years for elisp files in core and contrib., ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts fb87d0eac0 032/154: contrib/lisp/org-contacts.el: Delete trailing whitespaces, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 43d2cdde45 057/154: contrib/lisp/org-contacts: Fix two typos in comments, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 271ec25b43 062/154: contrib/lisp/org-contacts.el: Permit to unload properly `org-contacts',
ELPA Syncer <=
- [elpa] externals/org-contacts 4d41ad256d 074/154: Merge branch 'maint', ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 36c6b30ec2 077/154: contrib/lisp/org-contacts.el: Add a hook to allow users to plug completion functions, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 2ec03e18b8 086/154: org-contacts: Fix org-contacts-matcher for BIRTHDAYs, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 33c5e0582c 085/154: contrib: move a few libraries to cl-lib in place of compile-time cl., ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 27bec00a60 089/154: org-agenda: Remove unnecessary visibility modification, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts f07048b75d 092/154: Use `string-match-p' instead of `org-string-match-p', ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 4e3f139857 095/154: Fix function declarations, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts eedaff3498 103/154: org-contacts.el: Only use org-id-store-link if org-id is loaded, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 4540f987ec 111/154: Clean up some more headers, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts c98281fcfe 113/154: Remove compatibility code, ELPA Syncer, 2022/09/09