emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH 1/3] Add docstring for `wl-get-from-header-content'.
@ 2011-05-06  8:43 Michael Markert
  2011-05-06  8:58 ` [PATCH 2/3] Add name-email function for to unificate template interface Michael Markert
  2011-05-06  9:24 ` [PATCH 3/3] Adjust wl-contact functions to overall conventions Michael Markert
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Markert @ 2011-05-06  8:43 UTC (permalink / raw)
  To: emacs-orgmode

---
 contrib/lisp/org-contacts.el |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 3f4d97c..f0cf131 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -404,6 +404,9 @@ This adds `org-contacts-gnus-check-mail-address' and
   (add-hook 'gnus-article-prepare-hook 'org-contacts-gnus-store-last-mail))
 
 (defun 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."
   (save-excursion
     (set-buffer (org-capture-get :original-buffer))
     (cond
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/3] Add name-email function for to unificate template interface.
  2011-05-06  8:43 [PATCH 1/3] Add docstring for `wl-get-from-header-content' Michael Markert
@ 2011-05-06  8:58 ` Michael Markert
  2011-05-06  9:24 ` [PATCH 3/3] Adjust wl-contact functions to overall conventions Michael Markert
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Markert @ 2011-05-06  8:58 UTC (permalink / raw)
  To: emacs-orgmode

---
 contrib/lisp/org-contacts.el |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index f0cf131..60eb542 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -420,6 +420,14 @@ 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 (wl-get-from-header-content)))
+    (when from
+      (cons (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))
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 3/3] Adjust wl-contact functions to overall conventions.
  2011-05-06  8:43 [PATCH 1/3] Add docstring for `wl-get-from-header-content' Michael Markert
  2011-05-06  8:58 ` [PATCH 2/3] Add name-email function for to unificate template interface Michael Markert
@ 2011-05-06  9:24 ` Michael Markert
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Markert @ 2011-05-06  9:24 UTC (permalink / raw)
  To: emacs-orgmode

---
 contrib/lisp/org-contacts.el |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 60eb542..ff4374d 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/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."
@@ -429,16 +429,18 @@ See `org-contacts-wl-get-from-header-content' for limitations."
 	    (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.
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-06 10:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-06  8:43 [PATCH 1/3] Add docstring for `wl-get-from-header-content' Michael Markert
2011-05-06  8:58 ` [PATCH 2/3] Add name-email function for to unificate template interface Michael Markert
2011-05-06  9:24 ` [PATCH 3/3] Adjust wl-contact functions to overall conventions Michael Markert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).