Fix wanderlust interface for org-contact.el
Patches by Michael Markert.
This commit is contained in:
parent
b78a119f7a
commit
4f5c58197e
1 changed files with 19 additions and 9 deletions
|
@ -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-check-mail-address)
|
||||||
(add-hook 'gnus-article-prepare-hook 'org-contacts-gnus-store-last-mail))
|
(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.
|
"Retrieve the content of the `From' header of an email.
|
||||||
Works from wl-summary-mode and mime-view-mode - that is while viewing email.
|
Works from wl-summary-mode and mime-view-mode - that is while viewing email.
|
||||||
Depends on Wanderlust been loaded."
|
Depends on Wanderlust been loaded."
|
||||||
|
@ -420,17 +420,27 @@ Depends on Wanderlust been loaded."
|
||||||
(std11-fetch-field "From")
|
(std11-fetch-field "From")
|
||||||
(widen))))))
|
(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)
|
(defun org-contacts-template-wl-name (&optional return-value)
|
||||||
(let ((from (wl-get-from-header-content)))
|
"Try to return the contact name for a template from wl.
|
||||||
(or (and from (wl-address-header-extract-realname from))
|
If not found return RETURN-VALUE or something that would ask the user."
|
||||||
|
(or (car (org-contacts-wl-get-name-email))
|
||||||
return-value
|
return-value
|
||||||
"%^{Name}")))
|
"%^{Name}"))
|
||||||
|
|
||||||
(defun org-contacts-template-wl-email (&optional return-value)
|
(defun org-contacts-template-wl-email (&optional return-value)
|
||||||
(let ((from (wl-get-from-header-content)))
|
"Try to return the contact email for a template from wl.
|
||||||
(or (and from (wl-address-header-extract-address from))
|
If not found return RETURN-VALUE or something that would ask the user."
|
||||||
|
(or (cadr (org-contacts-wl-get-name-email))
|
||||||
return-value
|
return-value
|
||||||
(concat "%^{" org-contacts-email-property "}p"))))
|
(concat "%^{" org-contacts-email-property "}p")))
|
||||||
|
|
||||||
(defun org-contacts-view-send-email (&optional ask)
|
(defun org-contacts-view-send-email (&optional ask)
|
||||||
"Send email to the contact at point.
|
"Send email to the contact at point.
|
||||||
|
|
Loading…
Reference in a new issue