unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/3] emacs: Don't overload same-window-regexps
@ 2010-10-27 17:26 Aneesh Kumar K.V
  2010-10-27 17:26 ` [PATCH 2/3] notmuch: Add support for In-Reply-To in header Aneesh Kumar K.V
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Aneesh Kumar K.V @ 2010-10-27 17:26 UTC (permalink / raw)
  To: cworth; +Cc: Aneesh Kumar K.V, notmuch

From: Aneesh Kumar K.V <aneesh.kumar@gmail.com>

Also add unset mail to the regexps. Recent emacs changes change the buffer name

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
---
 emacs/notmuch-mua.el |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 0ad079f..23ffd96 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -85,10 +85,13 @@ list."
 	      (setq headers (mail-header-extract)))))
       (forward-line 1)
       (setq body (buffer-substring (point) (point-max))))
-    (let
+    (progn
 	;; Overlay the composition window on that being used to read
 	;; the original message.
-	((same-window-regexps '("\\*mail .*")))
+      (add-hook 'same-window-regexps
+		(purecopy "\\*unsent mail.*"))
+      (add-hook 'same-window-regexps
+		(purecopy "\\*mail .*"))
       (notmuch-mua-mail (mail-header 'to headers)
 			(mail-header 'subject headers)
 			(message-headers-to-generate headers t '(to subject))))
-- 
1.7.1

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

* [PATCH 2/3] notmuch: Add support for In-Reply-To in header
  2010-10-27 17:26 [PATCH 1/3] emacs: Don't overload same-window-regexps Aneesh Kumar K.V
@ 2010-10-27 17:26 ` Aneesh Kumar K.V
  2010-10-27 17:26 ` [PATCH 3/3] notmuch: Add support for listing the parent message Aneesh Kumar K.V
  2010-11-16 17:51 ` [PATCH] emacs: Accommodate message-mode updates David Edmondson
  2 siblings, 0 replies; 11+ messages in thread
From: Aneesh Kumar K.V @ 2010-10-27 17:26 UTC (permalink / raw)
  To: cworth; +Cc: Aneesh Kumar K.V, notmuch

This will later used to implment switching to the replied to mail
from emacs

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
---
 notmuch-show.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/notmuch-show.c b/notmuch-show.c
index ea465de..dbb4672 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -287,7 +287,7 @@ static void
 format_headers_text (const void *ctx, notmuch_message_t *message)
 {
     const char *headers[] = {
-	"Subject", "From", "To", "Cc", "Bcc", "Date"
+	"Subject", "From", "To", "Cc", "Bcc", "Date", "In-Reply-To"
     };
     const char *name, *value;
     unsigned int i;
@@ -306,7 +306,7 @@ static void
 format_headers_json (const void *ctx, notmuch_message_t *message)
 {
     const char *headers[] = {
-	"Subject", "From", "To", "Cc", "Bcc", "Date"
+	"Subject", "From", "To", "Cc", "Bcc", "Date", "In-Reply-To"
     };
     const char *name, *value;
     unsigned int i;
-- 
1.7.1

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

* [PATCH 3/3] notmuch: Add support for listing the parent message
  2010-10-27 17:26 [PATCH 1/3] emacs: Don't overload same-window-regexps Aneesh Kumar K.V
  2010-10-27 17:26 ` [PATCH 2/3] notmuch: Add support for In-Reply-To in header Aneesh Kumar K.V
@ 2010-10-27 17:26 ` Aneesh Kumar K.V
  2010-11-04  9:28   ` David Edmondson
  2010-11-16 17:51 ` [PATCH] emacs: Accommodate message-mode updates David Edmondson
  2 siblings, 1 reply; 11+ messages in thread
From: Aneesh Kumar K.V @ 2010-10-27 17:26 UTC (permalink / raw)
  To: cworth; +Cc: Aneesh Kumar K.V, notmuch

From: Aneesh Kumar K.V <aneesh.kumar@gmail.com>

When you have long thread, it would be nice to be able to
show the message to which the current message is a reply

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
---
 emacs/notmuch-show.el |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 3fc3787..139c44d 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -582,6 +582,7 @@ function is used. "
 	(define-key map " " 'notmuch-show-advance-and-archive)
 	(define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)
 	(define-key map (kbd "RET") 'notmuch-show-toggle-message)
+	(define-key map "A" 'notmuch-show-search-parent)
 	map)
       "Keymap for \"notmuch show\" buffers.")
 (fset 'notmuch-show-mode-map notmuch-show-mode-map)
@@ -1095,4 +1096,15 @@ buffer."
 
 ;;
 
+(defun notmuch-show-get-parent ()
+  (let ((id (notmuch-show-get-header :In-Reply-To)))
+    (if (string-match "^<\\(.*\\)>$" id)
+	(match-string 1 id)
+      id)))
+
+(defun notmuch-show-search-parent ()
+  "Search parent message"
+  (interactive)
+  (notmuch-search (concat "id:\"" (notmuch-show-get-parent) "\"")))
+
 (provide 'notmuch-show)
-- 
1.7.1

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

* Re: [PATCH 3/3] notmuch: Add support for listing the parent message
  2010-10-27 17:26 ` [PATCH 3/3] notmuch: Add support for listing the parent message Aneesh Kumar K.V
@ 2010-11-04  9:28   ` David Edmondson
  2010-11-04 10:36     ` Aneesh Kumar K. V
  0 siblings, 1 reply; 11+ messages in thread
From: David Edmondson @ 2010-11-04  9:28 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 602 bytes --]

On Wed, 27 Oct 2010 22:56:57 +0530, "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> wrote:
> From: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
> 
> When you have long thread, it would be nice to be able to
> show the message to which the current message is a reply

The patch fires up a new search, destroying my context. Shouldn't the
parent message be visible in the current thread and, if so, perhaps just
searching in the current buffer for it (and jumping back there) be
possible? (Maybe even with a key to pop back to the child easily.)

dme.
-- 
David Edmondson, http://dme.org

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [PATCH 3/3] notmuch: Add support for listing the parent message
  2010-11-04  9:28   ` David Edmondson
@ 2010-11-04 10:36     ` Aneesh Kumar K. V
  2010-11-04 13:24       ` David Edmondson
  0 siblings, 1 reply; 11+ messages in thread
From: Aneesh Kumar K. V @ 2010-11-04 10:36 UTC (permalink / raw)
  To: David Edmondson; +Cc: notmuch

On Thu, 04 Nov 2010 09:28:40 +0000, David Edmondson <dme@dme.org> wrote:
> On Wed, 27 Oct 2010 22:56:57 +0530, "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> wrote:
> > From: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
> > 
> > When you have long thread, it would be nice to be able to
> > show the message to which the current message is a reply
> 
> The patch fires up a new search, destroying my context. Shouldn't the
> parent message be visible in the current thread and, if so, perhaps just
> searching in the current buffer for it (and jumping back there) be
> possible? (Maybe even with a key to pop back to the child easily.)
> 

It should actually stack up. That is, it fires up a new search but then a
'q' should bring back the old context. One of the thing i really
wanted to keep was the ability to go back to the old context with a key
binding which in this case is achieved by 'q'

-aneesh

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

* Re: [PATCH 3/3] notmuch: Add support for listing the parent message
  2010-11-04 10:36     ` Aneesh Kumar K. V
@ 2010-11-04 13:24       ` David Edmondson
  0 siblings, 0 replies; 11+ messages in thread
From: David Edmondson @ 2010-11-04 13:24 UTC (permalink / raw)
  To: Aneesh Kumar K. V; +Cc: notmuch

On Thu, 04 Nov 2010 16:06:39 +0530, "Aneesh Kumar K. V" <aneesh.kumar@linux.vnet.ibm.com> wrote:
> On Thu, 04 Nov 2010 09:28:40 +0000, David Edmondson <dme@dme.org> wrote:
> > On Wed, 27 Oct 2010 22:56:57 +0530, "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> wrote:
> > > From: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
> > > 
> > > When you have long thread, it would be nice to be able to
> > > show the message to which the current message is a reply
> > 
> > The patch fires up a new search, destroying my context. Shouldn't the
> > parent message be visible in the current thread and, if so, perhaps just
> > searching in the current buffer for it (and jumping back there) be
> > possible? (Maybe even with a key to pop back to the child easily.)
> > 
> 
> It should actually stack up. That is, it fires up a new search but then a
> 'q' should bring back the old context. One of the thing i really
> wanted to keep was the ability to go back to the old context with a key
> binding which in this case is achieved by 'q'

I played some more and I agree, it's fine as is.

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

* [PATCH] emacs: Accommodate message-mode updates.
  2010-10-27 17:26 [PATCH 1/3] emacs: Don't overload same-window-regexps Aneesh Kumar K.V
  2010-10-27 17:26 ` [PATCH 2/3] notmuch: Add support for In-Reply-To in header Aneesh Kumar K.V
  2010-10-27 17:26 ` [PATCH 3/3] notmuch: Add support for listing the parent message Aneesh Kumar K.V
@ 2010-11-16 17:51 ` David Edmondson
  2010-11-19 16:01   ` Aneesh Kumar K. V
  2 siblings, 1 reply; 11+ messages in thread
From: David Edmondson @ 2010-11-16 17:51 UTC (permalink / raw)
  To: notmuch

Message mode uses a different name for composition buffers in newer
versions of emacs. Allow for this when causing the composition window
to overlay the viewing window.
---

I don't understand why Aneesh chose to use `add-hook' and `purecopy'.

 emacs/notmuch-mua.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index dc7b386..70c8dff 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -88,7 +88,7 @@ list."
     (let
 	;; Overlay the composition window on that being used to read
 	;; the original message.
-	((same-window-regexps '("\\*mail .*")))
+	((same-window-regexps '("\\*mail .*" "\\*unsent mail .*")))
       (notmuch-mua-mail (mail-header 'to headers)
 			(mail-header 'subject headers)
 			(message-headers-to-generate headers t '(to subject))))
-- 
1.7.2.3

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

* Re: [PATCH] emacs: Accommodate message-mode updates.
  2010-11-16 17:51 ` [PATCH] emacs: Accommodate message-mode updates David Edmondson
@ 2010-11-19 16:01   ` Aneesh Kumar K. V
  2010-11-19 16:06     ` David Edmondson
  0 siblings, 1 reply; 11+ messages in thread
From: Aneesh Kumar K. V @ 2010-11-19 16:01 UTC (permalink / raw)
  To: David Edmondson, notmuch

On Tue, 16 Nov 2010 17:51:38 +0000, David Edmondson <dme@dme.org> wrote:
> Message mode uses a different name for composition buffers in newer
> versions of emacs. Allow for this when causing the composition window
> to overlay the viewing window.
> ---
> 
> I don't understand why Aneesh chose to use `add-hook' and `purecopy'.

So what when i have unset mail added via .emacs even the older version
will work. making sure if the name change again i can fix it by a .emacs
update rather than notmuch code update.



> 
>  emacs/notmuch-mua.el |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
> index dc7b386..70c8dff 100644
> --- a/emacs/notmuch-mua.el
> +++ b/emacs/notmuch-mua.el
> @@ -88,7 +88,7 @@ list."
>      (let
>  	;; Overlay the composition window on that being used to read
>  	;; the original message.
> -	((same-window-regexps '("\\*mail .*")))
> +	((same-window-regexps '("\\*mail .*" "\\*unsent mail .*")))
>        (notmuch-mua-mail (mail-header 'to headers)
>  			(mail-header 'subject headers)
>  			(message-headers-to-generate headers t '(to subject))))


-aneesh

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

* Re: [PATCH] emacs: Accommodate message-mode updates.
  2010-11-19 16:01   ` Aneesh Kumar K. V
@ 2010-11-19 16:06     ` David Edmondson
  2010-11-19 16:35       ` Aneesh Kumar K. V
  0 siblings, 1 reply; 11+ messages in thread
From: David Edmondson @ 2010-11-19 16:06 UTC (permalink / raw)
  To: Aneesh Kumar K. V, notmuch

[-- Attachment #1: Type: text/plain, Size: 724 bytes --]

On Fri, 19 Nov 2010 21:31:36 +0530, "Aneesh Kumar K. V" <aneesh.kumar@linux.vnet.ibm.com> wrote:
> On Tue, 16 Nov 2010 17:51:38 +0000, David Edmondson <dme@dme.org> wrote:
> > Message mode uses a different name for composition buffers in newer
> > versions of emacs. Allow for this when causing the composition window
> > to overlay the viewing window.
> > ---
> > 
> > I don't understand why Aneesh chose to use `add-hook' and `purecopy'.
> 
> So what when i have unset mail added via .emacs even the older version
> will work. making sure if the name change again i can fix it by a .emacs
> update rather than notmuch code update.

What would you add to .emacs?

dme.
-- 
David Edmondson, http://dme.org

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [PATCH] emacs: Accommodate message-mode updates.
  2010-11-19 16:06     ` David Edmondson
@ 2010-11-19 16:35       ` Aneesh Kumar K. V
  2010-11-19 17:12         ` David Edmondson
  0 siblings, 1 reply; 11+ messages in thread
From: Aneesh Kumar K. V @ 2010-11-19 16:35 UTC (permalink / raw)
  To: David Edmondson, notmuch

On Fri, 19 Nov 2010 16:06:40 +0000, David Edmondson <dme@dme.org> wrote:
> On Fri, 19 Nov 2010 21:31:36 +0530, "Aneesh Kumar K. V" <aneesh.kumar@linux.vnet.ibm.com> wrote:
> > On Tue, 16 Nov 2010 17:51:38 +0000, David Edmondson <dme@dme.org> wrote:
> > > Message mode uses a different name for composition buffers in newer
> > > versions of emacs. Allow for this when causing the composition window
> > > to overlay the viewing window.
> > > ---
> > > 
> > > I don't understand why Aneesh chose to use `add-hook' and `purecopy'.
> > 
> > So what when i have unset mail added via .emacs even the older version
> > will work. making sure if the name change again i can fix it by a .emacs
> > update rather than notmuch code update.
> 
> What would you add to .emacs?
> 

In custom-set-variable i have the below

 '(same-window-buffer-names (quote ("*unsent mail*" "*shell*" "*mail*" "*inferior-lisp*" "*ielm*" "*scheme*")))
 '(same-window-regexps (quote ("\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)" "\\*telnet-.*\\*\\(\\|<[0-9]+>\\)" "^\\*rlogin-.*\\*\\(\\|<[0-9]+>\\)" "\\*info\\*\\(\\|<[0-9]+>\\)" "\\*gud-.*\\*\\(\\|<[0-9]+>\\)" "\\`\\*Customiz.*\\*\\'" "\\*unsent mail .*")))


-aneesh

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

* Re: [PATCH] emacs: Accommodate message-mode updates.
  2010-11-19 16:35       ` Aneesh Kumar K. V
@ 2010-11-19 17:12         ` David Edmondson
  0 siblings, 0 replies; 11+ messages in thread
From: David Edmondson @ 2010-11-19 17:12 UTC (permalink / raw)
  To: Aneesh Kumar K. V, notmuch

[-- Attachment #1: Type: text/plain, Size: 1043 bytes --]

On Fri, 19 Nov 2010 22:05:25 +0530, "Aneesh Kumar K. V" <aneesh.kumar@linux.vnet.ibm.com> wrote:
> > > > I don't understand why Aneesh chose to use `add-hook' and `purecopy'.
> > > 
> > > So what when i have unset mail added via .emacs even the older version
> > > will work. making sure if the name change again i can fix it by a .emacs
> > > update rather than notmuch code update.
> > 
> > What would you add to .emacs?
> > 
> 
> In custom-set-variable i have the below
> 
>  '(same-window-buffer-names (quote ("*unsent mail*" "*shell*" "*mail*" "*inferior-lisp*" "*ielm*" "*scheme*")))
>  '(same-window-regexps (quote ("\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)" "\\*telnet-.*\\*\\(\\|<[0-9]+>\\)" "^\\*rlogin-.*\\*\\(\\|<[0-9]+>\\)" "\\*info\\*\\(\\|<[0-9]+>\\)" "\\*gud-.*\\*\\(\\|<[0-9]+>\\)" "\\`\\*Customiz.*\\*\\'" "\\*unsent mail .*")))

I see. So you want a solution that _augments_ the existing value of
`same-window-regexps' in `notmuch-mua-reply' rather than overriding it?

dme.
-- 
David Edmondson, http://dme.org

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

end of thread, other threads:[~2010-11-19 17:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-27 17:26 [PATCH 1/3] emacs: Don't overload same-window-regexps Aneesh Kumar K.V
2010-10-27 17:26 ` [PATCH 2/3] notmuch: Add support for In-Reply-To in header Aneesh Kumar K.V
2010-10-27 17:26 ` [PATCH 3/3] notmuch: Add support for listing the parent message Aneesh Kumar K.V
2010-11-04  9:28   ` David Edmondson
2010-11-04 10:36     ` Aneesh Kumar K. V
2010-11-04 13:24       ` David Edmondson
2010-11-16 17:51 ` [PATCH] emacs: Accommodate message-mode updates David Edmondson
2010-11-19 16:01   ` Aneesh Kumar K. V
2010-11-19 16:06     ` David Edmondson
2010-11-19 16:35       ` Aneesh Kumar K. V
2010-11-19 17:12         ` David Edmondson

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

	https://yhetil.org/notmuch.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).