[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] scratch/org-contacts-rebased 4f5c581 006/118: Fix wanderlust inte
From: |
Stefan Monnier |
Subject: |
[elpa] scratch/org-contacts-rebased 4f5c581 006/118: Fix wanderlust interface for org-contact.el |
Date: |
Fri, 12 Nov 2021 15:36:53 -0500 (EST) |
branch: scratch/org-contacts-rebased
commit 4f5c58197e4dab32ceaafe3e4c3fb2c2a7397385
Author: Carsten Dominik <carsten.dominik@gmail.com>
Commit: Carsten Dominik <carsten.dominik@gmail.com>
Fix wanderlust interface for org-contact.el
Patches by Michael Markert.
---
org-contacts.el | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/org-contacts.el b/org-contacts.el
index f0cf131..6bb7abf 100644
--- a/org-contacts.el
+++ b/org-contacts.el
@@ -403,7 +403,7 @@ 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 wl-get-from-header-content ()
+(defun org-contacts-wl-get-from-header-content ()
"Retrieve the content of the `From' header of an email.
Works from wl-summary-mode and mime-view-mode - that is while viewing email.
Depends on Wanderlust been loaded."
@@ -420,17 +420,27 @@ Depends on Wanderlust been loaded."
(std11-fetch-field "From")
(widen))))))
+(defun org-contacts-wl-get-name-email ()
+ "Get name and email address from wanderlust email.
+See `org-contacts-wl-get-from-header-content' for limitations."
+ (let ((from (org-contacts-wl-get-from-header-content)))
+ (when from
+ (list (wl-address-header-extract-realname from)
+ (wl-address-header-extract-address from)))))
+
(defun org-contacts-template-wl-name (&optional return-value)
- (let ((from (wl-get-from-header-content)))
- (or (and from (wl-address-header-extract-realname from))
- return-value
- "%^{Name}")))
+ "Try to return the contact name for a template from wl.
+If not found return RETURN-VALUE or something that would ask the user."
+ (or (car (org-contacts-wl-get-name-email))
+ return-value
+ "%^{Name}"))
(defun org-contacts-template-wl-email (&optional return-value)
- (let ((from (wl-get-from-header-content)))
- (or (and from (wl-address-header-extract-address from))
- return-value
- (concat "%^{" org-contacts-email-property "}p"))))
+ "Try to return the contact email for a template from wl.
+If not found return RETURN-VALUE or something that would ask the user."
+ (or (cadr (org-contacts-wl-get-name-email))
+ return-value
+ (concat "%^{" org-contacts-email-property "}p")))
(defun org-contacts-view-send-email (&optional ask)
"Send email to the contact at point.
- [elpa] branch scratch/org-contacts-rebased created (now 3f635df), Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 6e66e4a 003/118: org-contacts: added custom org-contacts-birthday-format, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 4f5c581 006/118: Fix wanderlust interface for org-contact.el,
Stefan Monnier <=
- [elpa] scratch/org-contacts-rebased b78a119 005/118: Add docstring for `wl-get-from-header-content'., Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 4a36f4a 004/118: Merge org-contacts-wl in org-contacts, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 4d5b508 007/118: org-contacts: check that completion-at-point-functions is bound, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased ad99d80 001/118: org-contacts: import, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased d0caf96 015/118: Replace org-mode-p with usual (eq major-mode 'org-mode) check, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 7fcd20b 025/118: contrib/lisp/org-contacts.el: Docstring fixes and small code clean up, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased dcd313e 021/118: Tags/properties matcher: Fixed issues with todo-only matches, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 938ca34 019/118: Add missing word to org-contacts y-or-n-p question, Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased c0f4677 024/118: contrib/lisp/org-contacts.el: Require 'org-agenda., Stefan Monnier, 2021/11/12
- [elpa] scratch/org-contacts-rebased 6b235b4 044/118: contrib/lisp/*el: Fix license information and add "This file is not part...", Stefan Monnier, 2021/11/12