unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [Patch v3 0/3] contrib: pick: remove an unused variable
@ 2013-09-02 20:15 Mark Walters
  2013-09-02 20:15 ` [Patch v3 1/3] contrib: pick: remove unneeded variable notmuch-pick-buffer-name Mark Walters
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Mark Walters @ 2013-09-02 20:15 UTC (permalink / raw)
  To: notmuch

v2 of this is at id:1377551345-27147-1-git-send-email-markwalters1009@gmail.com

This is unchanged except it is rebased on top of the series
id:1377460534-6022-1-git-send-email-markwalters1009@gmail.com so that
should be applied first.

The only difference is in the context of patch 1 of this series (and
slight line number changes). The diff of the patches is below

I will mark this as ready based on Tomi's review of v2.

Best wishes

Mark

1c1
< From 8d989eca9ccccbc9bc2e65d24a10d5ce6bc04b14 Mon Sep 17 00:00:00 2001
---
> From ba60dbf7f8f3f1f92839a03400c54d769a33c724 Mon Sep 17 00:00:00 2001
17c17
< index f7caaa8..32bd6b5 100644
---
> index 8c499b0..5943ac2 100644
31c31
< @@ -590,13 +586,11 @@ message will be \"unarchived\", i.e. the tag changes in
---
> @@ -586,13 +582,11 @@ message will be \"unarchived\", i.e. the tag changes in
45,47c45,47
<  (defun notmuch-pick-thread-top ()
<    (when (notmuch-pick-get-message-properties)
< @@ -859,12 +853,11 @@ Complete list of currently available key bindings:
---
>  (defun notmuch-pick-clean-address (address)
>    "Try to clean a single email ADDRESS for display. Return
> @@ -795,12 +789,11 @@ Complete list of currently available key bindings:
61c61
< @@ -877,7 +870,7 @@ Complete list of currently available key bindings:
---
> @@ -813,7 +806,7 @@ Complete list of currently available key bindings:
70c70
< @@ -910,13 +903,13 @@ The arguments are:
---
> @@ -846,13 +839,13 @@ The arguments are:




Mark Walters (3):
  contrib: pick: remove unneeded variable notmuch-pick-buffer-name
  contrib: pick: add docstring for notmuch-pick-worker
  contrib: pick: test: refresh view

 contrib/notmuch-pick/notmuch-pick.el |   29 +++++++++++++----------------
 contrib/notmuch-pick/test/emacs-pick |   11 +++++++++++
 2 files changed, 24 insertions(+), 16 deletions(-)

-- 
1.7.9.1

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

* [Patch v3 1/3] contrib: pick: remove unneeded variable notmuch-pick-buffer-name
  2013-09-02 20:15 [Patch v3 0/3] contrib: pick: remove an unused variable Mark Walters
@ 2013-09-02 20:15 ` Mark Walters
  2013-09-02 20:15 ` [Patch v3 2/3] contrib: pick: add docstring for notmuch-pick-worker Mark Walters
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Mark Walters @ 2013-09-02 20:15 UTC (permalink / raw)
  To: notmuch

This variable is essentially unused: it was only used for making sure
it itself got reset after a refresh of the buffer.

It did this by passing an unnecessary argument to notmuch-pick-worker
so remove that too.
---
 contrib/notmuch-pick/notmuch-pick.el |   25 +++++++++----------------
 1 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
index f7caaa8..32bd6b5 100644
--- a/contrib/notmuch-pick/notmuch-pick.el
+++ b/contrib/notmuch-pick/notmuch-pick.el
@@ -161,10 +161,6 @@
   "A buffer local copy of argument open-target to the function notmuch-pick")
 (make-variable-buffer-local 'notmuch-pick-open-target)
 
-(defvar notmuch-pick-buffer-name nil
-  "A buffer local copy of argument buffer-name to the function notmuch-pick")
-(make-variable-buffer-local 'notmuch-pick-buffer-name)
-
 (defvar notmuch-pick-message-window nil
   "The window of the message pane.
 
@@ -590,13 +586,11 @@ message will be \"unarchived\", i.e. the tag changes in
   (let ((inhibit-read-only t)
 	(basic-query notmuch-pick-basic-query)
 	(query-context notmuch-pick-query-context)
-	(target (notmuch-pick-get-message-id))
-	(buffer-name notmuch-pick-buffer-name))
+	(target (notmuch-pick-get-message-id)))
     (erase-buffer)
     (notmuch-pick-worker basic-query
 			 query-context
-			 target
-			 (get-buffer buffer-name))))
+			 target)))
 
 (defun notmuch-pick-thread-top ()
   (when (notmuch-pick-get-message-properties)
@@ -859,12 +853,11 @@ Complete list of currently available key bindings:
 	(notmuch-sexp-parse-partial-list 'notmuch-pick-insert-forest-thread
 					 results-buf)))))
 
-(defun notmuch-pick-worker (basic-query &optional query-context target buffer open-target)
+(defun notmuch-pick-worker (basic-query &optional query-context target open-target)
   (interactive)
   (notmuch-pick-mode)
   (setq notmuch-pick-basic-query basic-query)
   (setq notmuch-pick-query-context query-context)
-  (setq notmuch-pick-buffer-name (buffer-name buffer))
   (setq notmuch-pick-target-msg target)
   (setq notmuch-pick-open-target open-target)
 
@@ -877,7 +870,7 @@ Complete list of currently available key bindings:
     (if (equal (car (process-lines notmuch-command "count" search-args)) "0")
 	(setq search-args basic-query))
     (let ((proc (notmuch-start-notmuch
-		 "notmuch-pick" buffer #'notmuch-pick-process-sentinel
+		 "notmuch-pick" (current-buffer) #'notmuch-pick-process-sentinel
 		 "show" "--body=false" "--format=sexp"
 		 message-arg search-args))
 	  ;; Use a scratch buffer to accumulate partial output.
@@ -910,13 +903,13 @@ The arguments are:
 					(concat "*notmuch-pick-" query "*")))))
 	(inhibit-read-only t))
 
-    (switch-to-buffer buffer)
-    ;; Don't track undo information for this buffer
-    (set 'buffer-undo-list t)
+    (switch-to-buffer buffer))
+  ;; Don't track undo information for this buffer
+  (set 'buffer-undo-list t)
 
-    (notmuch-pick-worker query query-context target buffer open-target)
+  (notmuch-pick-worker query query-context target open-target)
 
-    (setq truncate-lines t)))
+  (setq truncate-lines t))
 
 
 ;; Set up key bindings from the rest of notmuch.
-- 
1.7.9.1

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

* [Patch v3 2/3] contrib: pick: add docstring for notmuch-pick-worker
  2013-09-02 20:15 [Patch v3 0/3] contrib: pick: remove an unused variable Mark Walters
  2013-09-02 20:15 ` [Patch v3 1/3] contrib: pick: remove unneeded variable notmuch-pick-buffer-name Mark Walters
@ 2013-09-02 20:15 ` Mark Walters
  2013-09-02 20:15 ` [Patch v3 3/3] contrib: pick: test: refresh view Mark Walters
  2013-09-03  9:20 ` [Patch v3 0/3] contrib: pick: remove an unused variable David Bremner
  3 siblings, 0 replies; 5+ messages in thread
From: Mark Walters @ 2013-09-02 20:15 UTC (permalink / raw)
  To: notmuch

---
 contrib/notmuch-pick/notmuch-pick.el |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
index 32bd6b5..5dcc942 100644
--- a/contrib/notmuch-pick/notmuch-pick.el
+++ b/contrib/notmuch-pick/notmuch-pick.el
@@ -854,6 +854,10 @@ Complete list of currently available key bindings:
 					 results-buf)))))
 
 (defun notmuch-pick-worker (basic-query &optional query-context target open-target)
+  "Insert the actual pick search in the current buffer.
+
+This is is a helper function for notmuch-pick. The arguments are
+the same as for the function notmuch-pick."
   (interactive)
   (notmuch-pick-mode)
   (setq notmuch-pick-basic-query basic-query)
-- 
1.7.9.1

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

* [Patch v3 3/3] contrib: pick: test: refresh view
  2013-09-02 20:15 [Patch v3 0/3] contrib: pick: remove an unused variable Mark Walters
  2013-09-02 20:15 ` [Patch v3 1/3] contrib: pick: remove unneeded variable notmuch-pick-buffer-name Mark Walters
  2013-09-02 20:15 ` [Patch v3 2/3] contrib: pick: add docstring for notmuch-pick-worker Mark Walters
@ 2013-09-02 20:15 ` Mark Walters
  2013-09-03  9:20 ` [Patch v3 0/3] contrib: pick: remove an unused variable David Bremner
  3 siblings, 0 replies; 5+ messages in thread
From: Mark Walters @ 2013-09-02 20:15 UTC (permalink / raw)
  To: notmuch

A recent proposed patch was buggy when refreshing the view. Add a test
for refresh so that this does not reoccur.
---
 contrib/notmuch-pick/test/emacs-pick |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/contrib/notmuch-pick/test/emacs-pick b/contrib/notmuch-pick/test/emacs-pick
index eed5f02..37f974a 100755
--- a/contrib/notmuch-pick/test/emacs-pick
+++ b/contrib/notmuch-pick/test/emacs-pick
@@ -23,6 +23,17 @@ test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
 	    (delete-other-windows)'
 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox
 
+test_begin_subtest "Refreshed notmuch-pick view in emacs"
+test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
+	    (require (quote notmuch-pick))
+	    (notmuch-pick "tag:inbox")
+	    (notmuch-test-wait)
+	    (notmuch-pick-refresh-view)
+	    (notmuch-test-wait)
+	    (test-output)
+	    (delete-other-windows)'
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox
+
 test_begin_subtest "Navigation of notmuch-hello to search results"
 test_emacs '(notmuch-hello)
 	    (goto-char (point-min))
-- 
1.7.9.1

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

* Re: [Patch v3 0/3] contrib: pick: remove an unused variable
  2013-09-02 20:15 [Patch v3 0/3] contrib: pick: remove an unused variable Mark Walters
                   ` (2 preceding siblings ...)
  2013-09-02 20:15 ` [Patch v3 3/3] contrib: pick: test: refresh view Mark Walters
@ 2013-09-03  9:20 ` David Bremner
  3 siblings, 0 replies; 5+ messages in thread
From: David Bremner @ 2013-09-03  9:20 UTC (permalink / raw)
  To: Mark Walters, notmuch

Mark Walters <markwalters1009@gmail.com> writes:

> v2 of this is at id:1377551345-27147-1-git-send-email-markwalters1009@gmail.com
>
> This is unchanged except it is rebased on top of the series
> id:1377460534-6022-1-git-send-email-markwalters1009@gmail.com so that
> should be applied first.

pushed

d

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

end of thread, other threads:[~2013-09-03  9:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-02 20:15 [Patch v3 0/3] contrib: pick: remove an unused variable Mark Walters
2013-09-02 20:15 ` [Patch v3 1/3] contrib: pick: remove unneeded variable notmuch-pick-buffer-name Mark Walters
2013-09-02 20:15 ` [Patch v3 2/3] contrib: pick: add docstring for notmuch-pick-worker Mark Walters
2013-09-02 20:15 ` [Patch v3 3/3] contrib: pick: test: refresh view Mark Walters
2013-09-03  9:20 ` [Patch v3 0/3] contrib: pick: remove an unused variable 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).