[PATCH 0/4] rename pick to tree

Mark Walters markwalters1009 at gmail.com
Sat Oct 26 14:44:45 PDT 2013


Please ignore this version. There were stale files around in my git tree
which meant it misses the actual key pick->tree move but all still
worked (and all tests passed)!

I will resend once I have tested on a fresh clone

Best wishes

Mark


On Sat, 26 Oct 2013, Mark Walters <markwalters1009 at gmail.com> wrote:
> After some discussion on irc it was decided to rename "pick" to
> "tree".  This series implements this change. Obviously the patch is
> rather large. I have split it as best as I can: the first moves all of
> the lisp from the "pick" namespace to the "tree" namespace, the second
> does the user facing part of the tests (ie what is printed when the
> test is run), the third updates the auxillary test files (expected
> outputs) and the final one moves the test itself.
>
> I haven't updated the documentation or moved the notmuch-pick
> directory as that will all be moot once pick moves into mainline.
>
> For the main lisp change I piped the pick.el file through sed
> 's/pick/tree/g'. Then I hand editted the result. The diff from the
> hand editting is below as that may give the best clue as to any actual
> changes. (The main one is to use "tree view" rather than just "tree"
> in docstrings etc.)
>
> For any users this will mean they need to update their require
> 'notmuch-pick to require 'notmuch-tree.
>
>
> Best wishes
>
> Mark
>
>
>
> Mark Walters (4):
>   contrib: pick: move lisp names from pick to tree
>   pick: Change the test names and print out for pick tests
>   pick: rename test outputs from pick to tree
>   pick: rename test emacs-pick to emacs-tree
>
>  contrib/notmuch-pick/notmuch-pick.el               |  668 ++++++++++----------
>  contrib/notmuch-pick/run-tests.sh                  |    4 +-
>  contrib/notmuch-pick/test/emacs-pick               |  210 ------
>  contrib/notmuch-pick/test/emacs-tree               |  210 ++++++
>  .../pick.expected-output/notmuch-pick-show-window  |   40 --
>  .../notmuch-pick-single-thread                     |    6 -
>  .../pick.expected-output/notmuch-pick-tag-inbox    |   53 --
>  .../notmuch-pick-tag-inbox-tagged                  |   53 --
>  .../notmuch-pick-tag-inbox-thread-tagged           |   53 --
>  .../tree.expected-output/notmuch-tree-show-window  |   40 ++
>  .../notmuch-tree-single-thread                     |    6 +
>  .../tree.expected-output/notmuch-tree-tag-inbox    |   53 ++
>  .../notmuch-tree-tag-inbox-tagged                  |   53 ++
>  .../notmuch-tree-tag-inbox-thread-tagged           |   53 ++
>  14 files changed, 751 insertions(+), 751 deletions(-)
>  delete mode 100755 contrib/notmuch-pick/test/emacs-pick
>  create mode 100755 contrib/notmuch-pick/test/emacs-tree
>  delete mode 100644 contrib/notmuch-pick/test/pick.expected-output/notmuch-pick-show-window
>  delete mode 100644 contrib/notmuch-pick/test/pick.expected-output/notmuch-pick-single-thread
>  delete mode 100644 contrib/notmuch-pick/test/pick.expected-output/notmuch-pick-tag-inbox
>  delete mode 100644 contrib/notmuch-pick/test/pick.expected-output/notmuch-pick-tag-inbox-tagged
>  delete mode 100644 contrib/notmuch-pick/test/pick.expected-output/notmuch-pick-tag-inbox-thread-tagged
>  create mode 100644 contrib/notmuch-pick/test/tree.expected-output/notmuch-tree-show-window
>  create mode 100644 contrib/notmuch-pick/test/tree.expected-output/notmuch-tree-single-thread
>  create mode 100644 contrib/notmuch-pick/test/tree.expected-output/notmuch-tree-tag-inbox
>  create mode 100644 contrib/notmuch-pick/test/tree.expected-output/notmuch-tree-tag-inbox-tagged
>  create mode 100644 contrib/notmuch-pick/test/tree.expected-output/notmuch-tree-tag-inbox-thread-tagged
>
> From 338fd0c981ef9ed4d5b4f7880b1e21826f7d182c Mon Sep 17 00:00:00 2001
> From: Mark Walters <markwalters1009 at gmail.com>
> Date: Sat, 26 Oct 2013 13:48:04 +0100
> Subject: [PATCH] by hand
>
> ---
>  contrib/notmuch-pick/notmuch-pick.el |   34 +++++++++++++++++-----------------
>  1 files changed, 17 insertions(+), 17 deletions(-)
>
> diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
> index aaadad4..3b0cc0e 100644
> --- a/contrib/notmuch-pick/notmuch-pick.el
> +++ b/contrib/notmuch-pick/notmuch-pick.el
> @@ -60,7 +60,7 @@
>      ("authors" . "%-20s")
>      ((("tree" . "%s")("subject" . "%s")) ." %-54s ")
>      ("tags" . "(%s)"))
> -  "Result formatting for Pick. Supported fields are: date,
> +  "Result formatting for Tree view. Supported fields are: date,
>          authors, subject, tree, tags.  Tree means the thread tree
>          box graphics. The field may also be a list in which case
>          the formatting rules are applied recursively and then the
> @@ -175,8 +175,8 @@ Note the author string should not contain
>    "The window of the message pane.
>  
>  It is set in both the tree buffer and the child show buffer. It
> -is used to try and close the message pane when quitting tree or
> -the child show buffer.")
> +is used to try and close the message pane when quitting tree view
> +or the child show buffer.")
>  (make-variable-buffer-local 'notmuch-tree-message-window)
>  (put 'notmuch-tree-message-window 'permanent-local t)
>  
> @@ -252,7 +252,7 @@ FUNC."
>      (define-key map "R" (notmuch-tree-close-message-pane-and #'notmuch-show-reply))
>      (define-key map "V" (notmuch-tree-close-message-pane-and #'notmuch-show-view-raw-message))
>  
> -    ;; The main tree bindings
> +    ;; The main tree view bindings
>      (define-key map (kbd "RET") 'notmuch-tree-show-message)
>      (define-key map [mouse-1] 'notmuch-tree-show-message)
>      (define-key map "x" 'notmuch-tree-quit)
> @@ -287,7 +287,7 @@ Some useful entries are:
>  ;; XXX This should really be a lib function but we are trying to
>  ;; reduce impact on the code base.
>  (defun notmuch-show-get-prop (prop &optional props)
> -  "This is a tree overridden version of notmuch-show-get-prop
> +  "This is a tree view overridden version of notmuch-show-get-prop
>  
>  It gets property PROP from PROPS or, if PROPS is nil, the current
>  message in either tree or show. This means that several functions
> @@ -391,10 +391,10 @@ Does NOT change the database."
>     (list (notmuch-read-tag-changes (notmuch-tree-get-tags) "Tag message" "-")))
>    (notmuch-tree-tag tag-changes))
>  
> -;; The next two functions close the message window before searching or
> -;; treeing 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).
> +;; The next two functions close the message window before calling
> +;; notmuch-search or notmuch-tree 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-tree-to-search ()
>    "Run \"notmuch search\" with the given `query' and display results."
> @@ -404,9 +404,9 @@ Does NOT change the database."
>      (notmuch-search query)))
>  
>  (defun notmuch-tree-to-tree ()
> -  "Run a query and display results in experimental notmuch-tree mode"
> +  "Run a query and display results in Tree view"
>    (interactive)
> -  (let ((query (notmuch-read-query "Notmuch tree: ")))
> +  (let ((query (notmuch-read-query "Notmuch tree view search: ")))
>      (notmuch-tree-close-message-window)
>      (notmuch-tree query)))
>  
> @@ -856,7 +856,7 @@ Complete list of currently available key bindings:
>  		      (atbob (bobp)))
>  		  (goto-char (point-max))
>  		  (if (eq status 'signal)
> -		      (insert "Incomplete search results (tree process was killed).\n"))
> +		      (insert "Incomplete search results (tree view process was killed).\n"))
>  		  (when (eq status 'exit)
>  		    (insert "End of search results.")
>  		    (unless (= exit-status 0)
> @@ -864,7 +864,7 @@ Complete list of currently available key bindings:
>  		    (insert "\n")))))))))
>  
>  (defun notmuch-tree-process-filter (proc string)
> -  "Process and filter the output of \"notmuch show\" (for tree)"
> +  "Process and filter the output of \"notmuch show\" for tree view"
>    (let ((results-buf (process-buffer proc))
>          (parse-buf (process-get proc 'parse-buf))
>          (inhibit-read-only t)
> @@ -880,7 +880,7 @@ Complete list of currently available key bindings:
>  					 results-buf)))))
>  
>  (defun notmuch-tree-worker (basic-query &optional query-context target open-target)
> -  "Insert the actual tree search in the current buffer.
> +  "Insert the tree view of the search in the current buffer.
>  
>  This is is a helper function for notmuch-tree. The arguments are
>  the same as for the function notmuch-tree."
> @@ -921,13 +921,13 @@ The arguments are:
>        is QUERY and QUERY-CONTEXT unless that does not match any messages
>        in which case we fall back to just QUERY.
>    TARGET: A message ID (with the id: prefix) that will be made
> -      current if it appears in the tree results.
> -  BUFFER-NAME: the name of the buffer to show the tree tree. If
> +      current if it appears in the tree view results.
> +  BUFFER-NAME: the name of the buffer to display the tree view. If
>        it is nil \"*notmuch-tree\" followed by QUERY is used.
>    OPEN-TARGET: If TRUE open the target message in the message pane."
>    (interactive)
>    (if (null query)
> -      (setq query (notmuch-read-query "Notmuch tree: ")))
> +      (setq query (notmuch-read-query "Notmuch tree view search: ")))
>    (let ((buffer (get-buffer-create (generate-new-buffer-name
>  				    (or buffer-name
>  					(concat "*notmuch-tree-" query "*")))))
> -- 
> 1.7.9.1


More information about the notmuch mailing list