From 776024af3d636b5c80e87a5349e8978824a83146 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sat, 26 Oct 2013 22:44:45 +0100 Subject: [PATCH] Re: [PATCH 0/4] rename pick to tree --- 99/d18032c34f94018376dc0de7a5b14835df2554 | 266 ++++++++++++++++++++++ 1 file changed, 266 insertions(+) create mode 100644 99/d18032c34f94018376dc0de7a5b14835df2554 diff --git a/99/d18032c34f94018376dc0de7a5b14835df2554 b/99/d18032c34f94018376dc0de7a5b14835df2554 new file mode 100644 index 000000000..9a5cbe45b --- /dev/null +++ b/99/d18032c34f94018376dc0de7a5b14835df2554 @@ -0,0 +1,266 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id E2C4F431E82 + for ; Sat, 26 Oct 2013 14:44:57 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.098 +X-Spam-Level: +X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 1wNwuBn8WvjY for ; + Sat, 26 Oct 2013 14:44:52 -0700 (PDT) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 15CC1431FD9 + for ; Sat, 26 Oct 2013 14:44:52 -0700 (PDT) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1VaBf5-0006FA-NG; Sat, 26 Oct 2013 22:44:48 +0100 +Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) + (envelope-from ) + id 1VaBf5-0003pL-9t; Sat, 26 Oct 2013 22:44:47 +0100 +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: Re: [PATCH 0/4] rename pick to tree +In-Reply-To: <1382822481-26659-1-git-send-email-markwalters1009@gmail.com> +References: <1382822481-26659-1-git-send-email-markwalters1009@gmail.com> +User-Agent: Notmuch/0.16 (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Sat, 26 Oct 2013 22:44:45 +0100 +Message-ID: <87ob6blnaq.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 93.97.24.31 +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: 599c673b1ac3d333106f3ee1fe8a07bc (of first 20000 bytes) +X-SpamAssassin-Score: 0.0 +X-SpamAssassin-SpamBar: / +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored 0.0 points. Summary of the scoring: + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * 0.0 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 26 Oct 2013 21:44:58 -0000 + + +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 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 +> 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 -- 2.26.2