Remove testing code

This commit is contained in:
stardiviner 2021-11-18 15:08:05 +08:00
parent f3fa9fc0b8
commit 85dd965906

View file

@ -676,7 +676,8 @@ description."
(cons (current-buffer) position)))) (cons (current-buffer) position))))
(defun org-contacts-org-complete-function () (defun org-contacts-org-complete-function ()
"Function used in `completion-at-point-functions' in `org-mode' to complete @name." "Function used in `completion-at-point-functions' in `org-mode' to complete @name.
Usage: (add-hook 'completion-at-point-functions 'org-contacts-org-complete-function nil 'local)"
(when-let* ((end (point)) (when-let* ((end (point))
(begin (save-excursion (skip-chars-backward "[:alnum:]@") (point))) (begin (save-excursion (skip-chars-backward "[:alnum:]@") (point)))
(symbol (buffer-substring-no-properties begin end)) (symbol (buffer-substring-no-properties begin end))
@ -711,32 +712,6 @@ description."
;; :company-location #'org-contacts-org-complete--location-function ;; :company-location #'org-contacts-org-complete--location-function
)))) ))))
(add-hook 'completion-at-point-functions 'org-contacts-org-complete-function nil 'local)
(try-completion
"tri"
(mapcar
(lambda (contact) (plist-get contact :name))
(org-contacts--all-contacts)))
(all-completions "Chr" (nth 2 (org-contacts-org-complete-function)))
;; @Chris
;; (type-of
;; (all-completions
;; "tri"
;; (mapcar
;; (lambda (contact) (plist-get contact :name))
;; (org-contacts--all-contacts))
;; 'stringp))
;;; TEST
;;; @chris
;; (add-hook 'completion-at-point-functions 'org-contacts-org-complete-function nil 'local)
;; (remove-hook 'completion-at-point-functions 'org-contacts-completion-at-point 'local)
;; (add-to-list 'completion-at-point-functions 'org-contacts-org-complete-function)
(defun org-contacts-gnus-get-name-email () (defun org-contacts-gnus-get-name-email ()
"Get name and email address from Gnus message." "Get name and email address from Gnus message."
(if (gnus-alive-p) (if (gnus-alive-p)