unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] contrib: pick: slightly tweak running search and pick from pick buffer
@ 2012-12-08 12:44 Mark Walters
  2012-12-24 15:18 ` David Bremner
  2012-12-24 23:05 ` David Bremner
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Walters @ 2012-12-08 12:44 UTC (permalink / raw)
  To: notmuch

Previously running search or pick from the pick buffer did not close
the message pane (if open). This meant that then new search ends up in
a very small window. Fix this so that the message pane is
shut. However, make it so that the pane is shut after the search
string is entered in case the user is basing the search on something
in the current message.
---

This is essentially an independent patch but the context clashes with
id:1354970494-18050-1-git-send-email-markwalters1009@gmail.com so that
should be applied first for testing.

If there is any problem with the first patch I can trivially rebase
this one.

Best wishes

Mark


 contrib/notmuch-pick/notmuch-pick.el |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
index 36587a6..b474231 100644
--- a/contrib/notmuch-pick/notmuch-pick.el
+++ b/contrib/notmuch-pick/notmuch-pick.el
@@ -175,8 +175,8 @@
     (define-key map "?" 'notmuch-help)
     (define-key map "a" 'notmuch-pick-archive-message-then-next)
     (define-key map "=" 'notmuch-pick-refresh-view)
-    (define-key map "s" 'notmuch-search)
-    (define-key map "z" 'notmuch-pick)
+    (define-key map "s" 'notmuch-pick-to-search)
+    (define-key map "z" 'notmuch-pick-to-pick)
     (define-key map "m" 'notmuch-pick-new-mail)
     (define-key map "f" 'notmuch-pick-forward-message)
     (define-key map "r" 'notmuch-pick-reply-sender)
@@ -289,6 +289,25 @@ Does NOT change the database."
   (interactive)
   (notmuch-pick-tag "-"))
 
+;; The next two functions close the message window before searching or
+;; picking but they do so after the user has entered the query (in
+;; case the user was basing the query on something in the message
+;; window).
+
+(defun notmuch-pick-to-search ()
+  "Run \"notmuch search\" with the given `query' and display results."
+  (interactive)
+  (let ((query (notmuch-read-query "Notmuch search: ")))
+    (notmuch-pick-close-message-window)
+    (notmuch-search query)))
+
+(defun notmuch-pick-to-pick ()
+  "Run a query and display results in experimental notmuch-pick mode"
+  (interactive)
+  (let ((query (notmuch-read-query "Notmuch pick: ")))
+    (notmuch-pick-close-message-window)
+    (notmuch-pick query)))
+
 ;; This function should be in notmuch-hello.el but we are trying to
 ;; minimise impact on the rest of the codebase.
 (defun notmuch-pick-from-hello (&optional search)
-- 
1.7.9.1

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

* Re: [PATCH] contrib: pick: slightly tweak running search and pick from pick buffer
  2012-12-08 12:44 [PATCH] contrib: pick: slightly tweak running search and pick from pick buffer Mark Walters
@ 2012-12-24 15:18 ` David Bremner
  2012-12-24 23:05 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2012-12-24 15:18 UTC (permalink / raw)
  To: Mark Walters, notmuch

Mark Walters <markwalters1009@gmail.com> writes:

> Previously running search or pick from the pick buffer did not close
> the message pane (if open). This meant that then new search ends up in
> a very small window. Fix this so that the message pane is
> shut. However, make it so that the pane is shut after the search
> string is entered in case the user is basing the search on something
> in the current message.
> ---

Seems fine to me, queuing to push.

d

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

* Re: [PATCH] contrib: pick: slightly tweak running search and pick from pick buffer
  2012-12-08 12:44 [PATCH] contrib: pick: slightly tweak running search and pick from pick buffer Mark Walters
  2012-12-24 15:18 ` David Bremner
@ 2012-12-24 23:05 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2012-12-24 23:05 UTC (permalink / raw)
  To: Mark Walters, notmuch

Mark Walters <markwalters1009@gmail.com> writes:

> Previously running search or pick from the pick buffer did not close
> the message pane (if open). This meant that then new search ends up in
> a very small window. Fix this so that the message pane is
> shut. However, make it so that the pane is shut after the search
> string is entered in case the user is basing the search on something
> in the current message.

pushed,

d

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

end of thread, other threads:[~2012-12-24 23:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-08 12:44 [PATCH] contrib: pick: slightly tweak running search and pick from pick buffer Mark Walters
2012-12-24 15:18 ` David Bremner
2012-12-24 23:05 ` David Bremner

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).