[notmuch] [PATCH v2] Add functions notmuch-show-get-(bcc, cc, date, from, subject, to).

2010-02-20 Thread Carl Worth
On Thu, 11 Feb 2010 22:44:10 -0400, david at tethera.net wrote:
> Return the corresponding header field for the current message as a
> string.  These are thin wrappers around notmuch-show-get-header, which
> means they each cause a full parse of the RFC822 header. The main idea
> is to fix an api.

OK. You at least acknowledge the only misgiving I had about this
patch. (And frankly, my own emacs lisp code probably has much worse
performance bugs.) So I'm not going to worry about that for now.

> Sorry, resending with fixed commit message.

Much appreciated.

> +(defun notmuch-show-get-bcc ()
> +  "Return To address of current message"
> +  (notmuch-show-get-header-field 'bcc))
> +
> +(defun notmuch-show-get-cc ()
> +  "Return To address of current message"
> +  (notmuch-show-get-header-field 'cc))
> +
> +(defun notmuch-show-get-date ()
> +  "Return To address of current message"
> +  (notmuch-show-get-header-field 'date))

I fixed the obviously copied documentation strings above, deleted the
trailing whitespace, and applied this patch.

Thanks!

-Carl
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 



Re: [notmuch] [PATCH v2] Add functions notmuch-show-get-(bcc, cc, date, from, subject, to).

2010-02-20 Thread Carl Worth
On Thu, 11 Feb 2010 22:44:10 -0400, da...@tethera.net wrote:
 Return the corresponding header field for the current message as a
 string.  These are thin wrappers around notmuch-show-get-header, which
 means they each cause a full parse of the RFC822 header. The main idea
 is to fix an api.

OK. You at least acknowledge the only misgiving I had about this
patch. (And frankly, my own emacs lisp code probably has much worse
performance bugs.) So I'm not going to worry about that for now.

 Sorry, resending with fixed commit message.

Much appreciated.

 +(defun notmuch-show-get-bcc ()
 +  Return To address of current message
 +  (notmuch-show-get-header-field 'bcc))
 +
 +(defun notmuch-show-get-cc ()
 +  Return To address of current message
 +  (notmuch-show-get-header-field 'cc))
 +
 +(defun notmuch-show-get-date ()
 +  Return To address of current message
 +  (notmuch-show-get-header-field 'date))

I fixed the obviously copied documentation strings above, deleted the
trailing whitespace, and applied this patch.

Thanks!

-Carl


pgpl4Gm0rHjz6.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[notmuch] [PATCH v2] Add functions notmuch-show-get-(bcc, cc, date, from, subject, to).

2010-02-11 Thread da...@tethera.net
From: David Bremner 

Return the corresponding header field for the current message as a
string.  These are thin wrappers around notmuch-show-get-header, which
means they each cause a full parse of the RFC822 header. The main idea
is to fix an api.
---
Sorry, resending with fixed commit message.

 notmuch.el |   32 
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index c96fd94..d2a3b1b 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -225,6 +225,38 @@ Unlike builtin `previous-line' this version accepts no 
arguments."
 (re-search-forward notmuch-show-tags-regexp)
 (split-string (buffer-substring (match-beginning 1) (match-end 1)

+(defun notmuch-show-get-bcc ()
+  "Return To address of current message"
+  (notmuch-show-get-header-field 'bcc))
+
+(defun notmuch-show-get-cc ()
+  "Return To address of current message"
+  (notmuch-show-get-header-field 'cc))
+
+(defun notmuch-show-get-date ()
+  "Return To address of current message"
+  (notmuch-show-get-header-field 'date))
+
+(defun notmuch-show-get-from ()
+  "Return From address of current message"
+  (notmuch-show-get-header-field 'from))
+
+(defun notmuch-show-get-subject ()
+  "Return subject of current message"
+  (notmuch-show-get-header-field 'subject))
+
+(defun notmuch-show-get-to ()
+  "Return To address of current message"
+  (notmuch-show-get-header-field 'to))
+
+(defun notmuch-show-get-header-field (name) 
+  "Retrieve the header field NAME from the current message.
+NAME should be a symbol, in lower case, as returned by 
+mail-header-extract-no-properties" 
+  (let* ((result (assoc name (notmuch-show-get-header)))
+(val (and result (cdr result
+val))
+
 (defun notmuch-show-get-header ()
   "Retrieve and parse the header from the current message. Returns an alist 
with of (header . value) 
 where header is a symbol and value is a string.  The summary from notmuch-show 
is returned as the 
-- 
1.6.5



[notmuch] [PATCH v2] Add functions notmuch-show-get-(bcc, cc, date, from, subject, to).

2010-02-11 Thread david
From: David Bremner brem...@unb.ca

Return the corresponding header field for the current message as a
string.  These are thin wrappers around notmuch-show-get-header, which
means they each cause a full parse of the RFC822 header. The main idea
is to fix an api.
---
Sorry, resending with fixed commit message.

 notmuch.el |   32 
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index c96fd94..d2a3b1b 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -225,6 +225,38 @@ Unlike builtin `previous-line' this version accepts no 
arguments.
 (re-search-forward notmuch-show-tags-regexp)
 (split-string (buffer-substring (match-beginning 1) (match-end 1)
 
+(defun notmuch-show-get-bcc ()
+  Return To address of current message
+  (notmuch-show-get-header-field 'bcc))
+
+(defun notmuch-show-get-cc ()
+  Return To address of current message
+  (notmuch-show-get-header-field 'cc))
+
+(defun notmuch-show-get-date ()
+  Return To address of current message
+  (notmuch-show-get-header-field 'date))
+
+(defun notmuch-show-get-from ()
+  Return From address of current message
+  (notmuch-show-get-header-field 'from))
+
+(defun notmuch-show-get-subject ()
+  Return subject of current message
+  (notmuch-show-get-header-field 'subject))
+
+(defun notmuch-show-get-to ()
+  Return To address of current message
+  (notmuch-show-get-header-field 'to))
+
+(defun notmuch-show-get-header-field (name) 
+  Retrieve the header field NAME from the current message.
+NAME should be a symbol, in lower case, as returned by 
+mail-header-extract-no-properties 
+  (let* ((result (assoc name (notmuch-show-get-header)))
+(val (and result (cdr result
+val))
+
 (defun notmuch-show-get-header ()
   Retrieve and parse the header from the current message. Returns an alist 
with of (header . value) 
 where header is a symbol and value is a string.  The summary from notmuch-show 
is returned as the 
-- 
1.6.5

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch