[PATCH 0/4] rename pick to tree
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
[PATCH 4/4] pick: rename test emacs-pick to emacs-tree
Also fixup run-tests.sh --- contrib/notmuch-pick/run-tests.sh|2 +- contrib/notmuch-pick/test/emacs-pick | 210 -- contrib/notmuch-pick/test/emacs-tree | 210 ++ 3 files changed, 211 insertions(+), 211 deletions(-) delete mode 100755 contrib/notmuch-pick/test/emacs-pick create mode 100755 contrib/notmuch-pick/test/emacs-tree diff --git a/contrib/notmuch-pick/run-tests.sh b/contrib/notmuch-pick/run-tests.sh index 4832d72..1767949 100755 --- a/contrib/notmuch-pick/run-tests.sh +++ b/contrib/notmuch-pick/run-tests.sh @@ -7,7 +7,7 @@ fail() { exit 1 } -TESTS="emacs-pick" +TESTS="emacs-tree" TESTFILES="$TESTS tree.expected-output" export PICK_DIR="`cd \`dirname "$0"\` && pwd`" diff --git a/contrib/notmuch-pick/test/emacs-pick b/contrib/notmuch-pick/test/emacs-pick deleted file mode 100755 index 05ce85d..000 --- a/contrib/notmuch-pick/test/emacs-pick +++ /dev/null @@ -1,210 +0,0 @@ -#!/usr/bin/env bash - -test_description="emacs tree view interface" -. test-lib.sh - -EXPECTED=$TEST_DIRECTORY/tree.expected-output - -add_email_corpus -test_begin_subtest "Do we have emacs" -test_emacs '(insert "hello\n") - (test-output)' -cat
[PATCH 3/4] pick: rename test outputs from pick to tree
Rename all the test output files to tree rather than pick, move the containing directory to a tree.expected-output and fix up the references in the test. --- contrib/notmuch-pick/run-tests.sh |2 +- contrib/notmuch-pick/test/emacs-pick | 22 .../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 12 files changed, 217 insertions(+), 217 deletions(-) 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 diff --git a/contrib/notmuch-pick/run-tests.sh b/contrib/notmuch-pick/run-tests.sh index b642ae8..4832d72 100755 --- a/contrib/notmuch-pick/run-tests.sh +++ b/contrib/notmuch-pick/run-tests.sh @@ -8,7 +8,7 @@ fail() { } TESTS="emacs-pick" -TESTFILES="$TESTS pick.expected-output" +TESTFILES="$TESTS tree.expected-output" export PICK_DIR="`cd \`dirname "$0"\` && pwd`" PICK_TEST_DIR="$PICK_DIR/test" diff --git a/contrib/notmuch-pick/test/emacs-pick b/contrib/notmuch-pick/test/emacs-pick index 2cc3edc..05ce85d 100755 --- a/contrib/notmuch-pick/test/emacs-pick +++ b/contrib/notmuch-pick/test/emacs-pick @@ -3,7 +3,7 @@ test_description="emacs tree view interface" . test-lib.sh -EXPECTED=$TEST_DIRECTORY/pick.expected-output +EXPECTED=$TEST_DIRECTORY/tree.expected-output add_email_corpus test_begin_subtest "Do we have emacs" @@ -21,7 +21,7 @@ test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'") (notmuch-test-wait) (test-output) (delete-other-windows)' -test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox +test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox test_begin_subtest "Refreshed notmuch-tree view in emacs" test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'") @@ -32,7 +32,7 @@ test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'") (notmuch-test-wait) (test-output) (delete-other-windows)' -test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox +test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox # In the following tag tests we make sure the display is updated # correctly and, in a separate test, that the database is updated @@ -47,7 +47,7 @@ test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'") (notmuch-tree-tag (list "+test_tag")) (test-output) (delete-other-windows)' -test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox-tagged +test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox-tagged test_begin_subtest "Tag message in notmuch tree view (database)" output=$(notmuch search --output=messages 'tag:test_tag') @@ -62,7 +62,7 @@ test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'") (notmuch-tree-tag (list "-test_tag")) (test-output) (delete-other-windows)' -test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox +test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox test_begin_subtest "Untag message in notmuch tree view (database)" output=$(notmuch search --output=messages 'tag:test_tag') @@ -78,7 +78,7 @@ test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'") (notmuch-tree-tag-thread (list "+test_thread_tag")) (test-output) (delete-other-windows)' -test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox-thread-tagged +test_expect_equal_file OUTPUT
[PATCH 2/4] pick: Change the test names and print out for pick tests
Change from the pick name to the tree name --- contrib/notmuch-pick/test/emacs-pick | 28 ++-- 1 files changed, 14 insertions(+), 14 deletions(-) diff --git a/contrib/notmuch-pick/test/emacs-pick b/contrib/notmuch-pick/test/emacs-pick index fae6e9e..2cc3edc 100755 --- a/contrib/notmuch-pick/test/emacs-pick +++ b/contrib/notmuch-pick/test/emacs-pick @@ -1,6 +1,6 @@ #!/usr/bin/env bash -test_description="emacs pick interface" +test_description="emacs tree view interface" . test-lib.sh EXPECTED=$TEST_DIRECTORY/pick.expected-output @@ -14,7 +14,7 @@ hello EOF test_expect_equal_file OUTPUT EXPECTED -test_begin_subtest "Basic notmuch-pick view in emacs" +test_begin_subtest "Basic notmuch-tree view in emacs" test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'") (require (quote notmuch-tree)) (notmuch-tree "tag:inbox") @@ -23,7 +23,7 @@ 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_begin_subtest "Refreshed notmuch-tree view in emacs" test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'") (require (quote notmuch-tree)) (notmuch-tree "tag:inbox") @@ -38,7 +38,7 @@ test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox # correctly and, in a separate test, that the database is updated # correctly. -test_begin_subtest "Tag message in notmuch pick view (display)" +test_begin_subtest "Tag message in notmuch tree view (display)" test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'") (require (quote notmuch-tree)) (notmuch-tree "tag:inbox") @@ -49,11 +49,11 @@ test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'") (delete-other-windows)' test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox-tagged -test_begin_subtest "Tag message in notmuch pick view (database)" +test_begin_subtest "Tag message in notmuch tree view (database)" output=$(notmuch search --output=messages 'tag:test_tag') test_expect_equal "$output" "id:877h1wv7mg.fsf at inf-8657.int-evry.fr" -test_begin_subtest "Untag message in notmuch pick view" +test_begin_subtest "Untag message in notmuch tree view" test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'") (require (quote notmuch-tree)) (notmuch-tree "tag:inbox") @@ -64,11 +64,11 @@ 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 "Untag message in notmuch pick view (database)" +test_begin_subtest "Untag message in notmuch tree view (database)" output=$(notmuch search --output=messages 'tag:test_tag') test_expect_equal "$output" "" -test_begin_subtest "Tag thread in notmuch pick view" +test_begin_subtest "Tag thread in notmuch tree view" test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'") (require (quote notmuch-tree)) (notmuch-tree "tag:inbox") @@ -80,7 +80,7 @@ test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'") (delete-other-windows)' test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox-thread-tagged -test_begin_subtest "Tag message in notmuch pick view (database)" +test_begin_subtest "Tag message in notmuch tree view (database)" output=$(notmuch search --output=messages 'tag:test_thread_tag') test_expect_equal "$output" \ "id:87ocn0qh6d.fsf at yoom.home.cworth.org @@ -91,7 +91,7 @@ id:20091117203301.GV3165 at dottiness.seas.harvard.edu id:87iqd9rn3l.fsf at vertex.dottedmag id:20091117190054.GU3165 at dottiness.seas.harvard.edu" -test_begin_subtest "Untag thread in notmuch pick view" +test_begin_subtest "Untag thread in notmuch tree view" test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'") (require (quote notmuch-tree)) (notmuch-tree "tag:inbox") @@ -103,7 +103,7 @@ 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 "Untag message in notmuch pick view (database)" +test_begin_subtest "Untag message in notmuch tree view (database)" output=$(notmuch search --output=messages 'tag:test_thread_tag') test_expect_equal "$output" "" @@ -119,7 +119,7 @@ test_emacs '(notmuch-hello) (delete-other-windows)' test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox -test_begin_subtest "Pick of a single thread (from search)" +test_begin_subtest "Tree view of a single thread (from search)" test_emacs '(notmuch-hello) (goto-char (point-min)) (re-search-forward "inbox") @@ -131,7 +131,7 @@ test_emacs '(notmuch-hello) (delete-other-windows)' test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-single-thread -test_begin_subtest "Pick of a single thread
[PATCH 1/4] contrib: pick: move lisp names from pick to tree
This changes all the lisp names from pick to tree (variables, functions etc). It also changes the lisp in the emacs-pick test files to match the new names. --- contrib/notmuch-pick/notmuch-pick.el | 668 +- contrib/notmuch-pick/test/emacs-pick | 74 ++-- 2 files changed, 371 insertions(+), 371 deletions(-) diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index 156ea6d..3b0cc0e 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -1,4 +1,4 @@ -;; notmuch-pick.el --- displaying notmuch forests. +;; notmuch-tree.el --- displaying notmuch forests. ;; ;; Copyright ? Carl Worth ;; Copyright ? David Edmondson @@ -46,21 +46,21 @@ ;; the following variable is defined in notmuch.el (defvar notmuch-search-query-string) -(defgroup notmuch-pick nil +(defgroup notmuch-tree nil "Showing message and thread structure." :group 'notmuch) -(defcustom notmuch-pick-show-out nil +(defcustom notmuch-tree-show-out nil "View selected messages in new window rather than split-pane." :type 'boolean - :group 'notmuch-pick) + :group 'notmuch-tree) -(defcustom notmuch-pick-result-format +(defcustom notmuch-tree-result-format `(("date" . "%12s ") ("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 @@ -70,19 +70,19 @@ Note the author string should not contain whitespace (put it in the neighbouring fields instead). For example: -(setq notmuch-pick-result-format \(\(\"authors\" . \"%-40s\"\) +(setq notmuch-tree-result-format \(\(\"authors\" . \"%-40s\"\) \(\"subject\" . \"%s\"\)\)\)" :type '(alist :key-type (string) :value-type (string)) - :group 'notmuch-pick) + :group 'notmuch-tree) ;; Faces for messages that match the query. -(defface notmuch-pick-match-date-face +(defface notmuch-tree-match-date-face '((t :inherit default)) - "Face used in pick mode for the date in messages matching the query." - :group 'notmuch-pick + "Face used in tree mode for the date in messages matching the query." + :group 'notmuch-tree :group 'notmuch-faces) -(defface notmuch-pick-match-author-face +(defface notmuch-tree-match-author-face 'class color) (background dark)) (:foreground "OliveDrab1")) @@ -91,23 +91,23 @@ Note the author string should not contain (:foreground "dark blue")) (t (:bold t))) - "Face used in pick mode for the date in messages matching the query." - :group 'notmuch-pick + "Face used in tree mode for the date in messages matching the query." + :group 'notmuch-tree :group 'notmuch-faces) -(defface notmuch-pick-match-subject-face +(defface notmuch-tree-match-subject-face '((t :inherit default)) - "Face used in pick mode for the subject in messages matching the query." - :group 'notmuch-pick + "Face used in tree mode for the subject in messages matching the query." + :group 'notmuch-tree :group 'notmuch-faces) -(defface notmuch-pick-match-tree-face +(defface notmuch-tree-match-tree-face '((t :inherit default)) - "Face used in pick mode for the thread tree block graphics in messages matching the query." - :group 'notmuch-pick + "Face used in tree mode for the thread tree block graphics in messages matching the query." + :group 'notmuch-tree :group 'notmuch-faces) -(defface notmuch-pick-match-tag-face +(defface notmuch-tree-match-tag-face 'class color) (background dark)) (:foreground "OliveDrab1")) @@ -116,79 +116,79 @@ Note the author string should not contain (:foreground "navy blue" :bold t)) (t (:bold t))) - "Face used in pick mode for tags in messages matching the query." - :group 'notmuch-pick + "Face used in tree mode for tags in messages matching the query." + :group 'notmuch-tree :group 'notmuch-faces) ;; Faces for messages that do not match the query. -(defface notmuch-pick-no-match-date-face +(defface notmuch-tree-no-match-date-face '((t (:foreground "gray"))) - "Face used in pick mode for non-matching dates." - :group 'notmuch-pick + "Face used in tree mode for non-matching dates." + :group 'notmuch-tree :group 'notmuch-faces) -(defface notmuch-pick-no-match-subject-face +(defface notmuch-tree-no-match-subject-face '((t (:foreground "gray"))) - "Face used in pick mode for non-matching subjects." - :group 'notmuch-pick + "Face used in tree mode for non-matching subjects." + :group 'notmuch-tree :group 'notmuch-faces) -(defface notmuch-pick-no-match-tree-face +(defface
[PATCH 0/4] rename pick to tree
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 WaltersDate: 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
[PATCH 4/4] contrib: pick: use remap for the over-ridden global bindings
Following a suggestion by Austin in id:20130915153642.GY1426 at mit.edu we use remap for the over-riding bindings in pick. This means that if the user modifies the global keymap these modifications will happen in the pick versions of them too. [Pick overrides these to do things like close the message pane before doing the action, so the functionality is very close to the original common keymap function.] --- contrib/notmuch-pick/notmuch-pick.el |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index 156ea6d..73f6501 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -226,13 +226,13 @@ FUNC." (set-keymap-parent map notmuch-common-keymap) ;; The following override the global keymap. ;; Override because we want to close message pane first. -(define-key map "?" (notmuch-pick-close-message-pane-and #'notmuch-help)) +(define-key map [remap notmuch-help] (notmuch-pick-close-message-pane-and #'notmuch-help)) ;; Override because we first close message pane and then close pick buffer. -(define-key map "q" 'notmuch-pick-quit) +(define-key map [remap notmuch-kill-this-buffer] 'notmuch-pick-quit) ;; Override because we close message pane after the search query is entered. -(define-key map "s" 'notmuch-pick-to-search) +(define-key map [remap notmuch-search] 'notmuch-pick-to-search) ;; Override because we want to close message pane first. -(define-key map "m" (notmuch-pick-close-message-pane-and #'notmuch-mua-new-mail)) +(define-key map [remap notmuch-mua-new-mail] (notmuch-pick-close-message-pane-and #'notmuch-mua-new-mail)) ;; these use notmuch-show functions directly (define-key map "|" 'notmuch-show-pipe-message) -- 1.7.9.1
[PATCH 3/4] emacs: help: remap support
If a user or mode uses remap to rebind a keybinding then it appears in the help as a line New function docstring. Special case these remapping lines so that we print the actual binding. --- emacs/notmuch.el | 21 ++--- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index b9db9ba..c354b05 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -140,7 +140,7 @@ This is basically just `format-kbd-macro' but we also convert ESC to M-." "M-" (concat desc " " -(defun notmuch-describe-keymap (keymap ua-keys prefix tail) +(defun notmuch-describe-keymap (keymap ua-keys prefix tail remap) "Return a list of cons cells, each describing one binding in KEYMAP. Each cons cell consists of a string giving a human-readable @@ -150,16 +150,23 @@ documentation is extracted. UA-KEYS should be a key sequence bound to `universal-argument'. It will be used to describe bindings of commands that support a -prefix argument. PREFIX and TAIL are used internally." +prefix argument. PREFIX, TAIL and REMAP are used internally." (map-keymap (lambda (key binding) (cond ((mouse-event-p key) nil) ((keymapp binding) - (setq tail - (notmuch-describe-keymap - binding ua-keys (notmuch-prefix-key-description key) tail))) + (if (equal key 'remap) + (setq tail + (notmuch-describe-keymap + binding ua-keys prefix tail t)) + (setq tail + (notmuch-describe-keymap +binding ua-keys (notmuch-prefix-key-description key) tail (t - (let ((key-string (concat prefix (format-kbd-macro (vector key) + (let* ((actual-key (if remap + (where-is-internal key nil t) +(vector key))) + (key-string (concat prefix (format-kbd-macro actual-key ;; We don't include documentation if the key-binding is ;; over-ridden. Note, over-riding a binding ;; automatically hides the prefixed version too. @@ -168,7 +175,7 @@ prefix argument. PREFIX and TAIL are used internally." (get binding 'notmuch-prefix-doc)) ;; Documentation for prefixed command (let ((ua-desc (key-description ua-keys))) - (push (cons (concat ua-desc " " prefix (format-kbd-macro (vector key))) + (push (cons (concat ua-desc " " prefix (format-kbd-macro actual-key)) (get binding 'notmuch-prefix-doc)) tail))) ;; Documentation for command -- 1.7.9.1
[PATCH 2/4] emacs: help: remove duplicate bindings
If the user (or a mode) overrides a keybinding from the common keymap in one of the modes then both help lines appear in the help screen even though only one of the is applicable. Fix this by checking if we already have that key binding. We do this by constructing an list of (key . docstring) pairs so it is easy to check if we have already had that binding. Then the actual print help routine changes these pairs into strings "key \t docstring" --- emacs/notmuch.el | 38 ++ 1 files changed, 22 insertions(+), 16 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index f98f8cf..b9db9ba 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -141,11 +141,12 @@ This is basically just `format-kbd-macro' but we also convert ESC to M-." (concat desc " " (defun notmuch-describe-keymap (keymap ua-keys prefix tail) - "Return a list of strings, each describing one binding in KEYMAP. + "Return a list of cons cells, each describing one binding in KEYMAP. -Each string gives a human-readable description of the key and a -one-line description of the bound function. See `notmuch-help' -for an overview of how this documentation is extracted. +Each cons cell consists of a string giving a human-readable +description of the key, and a one-line description of the bound +function. See `notmuch-help' for an overview of how this +documentation is extracted. UA-KEYS should be a key sequence bound to `universal-argument'. It will be used to describe bindings of commands that support a @@ -158,19 +159,23 @@ prefix argument. PREFIX and TAIL are used internally." (notmuch-describe-keymap binding ua-keys (notmuch-prefix-key-description key) tail))) (t - (unless (not binding) - (when (and ua-keys (symbolp binding) -(get binding 'notmuch-prefix-doc)) - ;; Documentation for prefixed command - (let ((ua-desc (key-description ua-keys))) - (push (concat ua-desc " " prefix (format-kbd-macro (vector key)) - "\t" (get binding 'notmuch-prefix-doc)) - tail))) - ;; Documentation for command - (push (concat prefix (format-kbd-macro (vector key)) "\t" + (let ((key-string (concat prefix (format-kbd-macro (vector key) + ;; We don't include documentation if the key-binding is + ;; over-ridden. Note, over-riding a binding + ;; automatically hides the prefixed version too. + (unless (or (assoc key-string tail) (not binding)) + (when (and ua-keys (symbolp binding) + (get binding 'notmuch-prefix-doc)) + ;; Documentation for prefixed command + (let ((ua-desc (key-description ua-keys))) + (push (cons (concat ua-desc " " prefix (format-kbd-macro (vector key))) + (get binding 'notmuch-prefix-doc)) + tail))) + ;; Documentation for command + (push (cons key-string (or (and (symbolp binding) (get binding 'notmuch-doc)) (notmuch-documentation-first-line binding))) - tail) + tail)) keymap) tail) @@ -181,7 +186,8 @@ prefix argument. PREFIX and TAIL are used internally." (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1))) (keymap (symbol-value (intern keymap-name))) (ua-keys (where-is-internal 'universal-argument keymap t)) -(desc-list (notmuch-describe-keymap keymap ua-keys)) +(desc-alist (notmuch-describe-keymap keymap ua-keys)) +(desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist)) (desc (mapconcat #'identity desc-list "\n"))) (setq doc (replace-match desc 1 1 doc))) (setq beg (match-end 0))) -- 1.7.9.1
[PATCH 1/4] emacs: help: check for nil key binding
A standard way to unset a key binding is local-unset-key which is equivalent to (define-key (current-local-map) key nil) Currently notmuch-help gives an error and fails if a user has done this. To fix this we check for a nil binding before adding a help line. --- emacs/notmuch.el | 25 + 1 files changed, 13 insertions(+), 12 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 6081245..f98f8cf 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -158,18 +158,19 @@ prefix argument. PREFIX and TAIL are used internally." (notmuch-describe-keymap binding ua-keys (notmuch-prefix-key-description key) tail))) (t - (when (and ua-keys (symbolp binding) - (get binding 'notmuch-prefix-doc)) - ;; Documentation for prefixed command - (let ((ua-desc (key-description ua-keys))) - (push (concat ua-desc " " prefix (format-kbd-macro (vector key)) - "\t" (get binding 'notmuch-prefix-doc)) - tail))) - ;; Documentation for command - (push (concat prefix (format-kbd-macro (vector key)) "\t" - (or (and (symbolp binding) (get binding 'notmuch-doc)) - (notmuch-documentation-first-line binding))) - tail + (unless (not binding) + (when (and ua-keys (symbolp binding) +(get binding 'notmuch-prefix-doc)) + ;; Documentation for prefixed command + (let ((ua-desc (key-description ua-keys))) + (push (concat ua-desc " " prefix (format-kbd-macro (vector key)) + "\t" (get binding 'notmuch-prefix-doc)) + tail))) + ;; Documentation for command + (push (concat prefix (format-kbd-macro (vector key)) "\t" + (or (and (symbolp binding) (get binding 'notmuch-doc)) + (notmuch-documentation-first-line binding))) + tail) keymap) tail) -- 1.7.9.1
[PATCH 0/4] emacs: help: and remap keybindings
This series makes 3 tweaks to the emacs help. The first fixes a bug whereby if a user unsets a keybinding notmuch-help throws an error (function being nil) and does not work. The second removes duplicates from the list of returned keybindings; these occur if a user or mode overrides a keybinding in notmuch-common-keymap. This happens in pick. See id:1381498794-17000-1-git-send-email-markwalters1009 at gmail.com for a different approach. I think this is probably neater but am happy either way. The third patch fixes some problems if a user or mode rebinds keys using remap. Currently they appear in help as " New function docstring". This patch replaces the with the actual key binding. The final patch is separate but is the actual motivation for the earlier ones. It switches pick to use remap for its over bindings. This means the over bindings will work correctly if the user customises the common-keymap. This approach was suggested by Austin in id:20130915153642.GY1426 at mit.edu. All tests pass and it seems to work including modifications to the common-keymap. Best wishes Mark PS Obviously the final patch will clash with a rename of pick to tree, but the rebase will be trivial. Mark Walters (4): emacs: help: check for nil key binding emacs: help: remove duplicate bindings emacs: help: remap support contrib: pick: use remap for the over-ridden global bindings contrib/notmuch-pick/notmuch-pick.el |8 ++-- emacs/notmuch.el | 58 +- 2 files changed, 40 insertions(+), 26 deletions(-) -- 1.7.9.1
Build broken on OS X 10.9
Please post the build log. Jani. On Oct 25, 2013 11:54 PM, "Tad" wrote: > Looks like notmuch 0.16 won't build on OS X 10.9 due to the switch to > libc++. I don't know where to start with fixing this, but thought I'd > let y'all know. > ___ > notmuch mailing list > notmuch at notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch > -- next part -- An HTML attachment was scrubbed... URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20131026/086d37c9/attachment-0001.html>
[PATCH 0/5] Move pick into mainline
> One thing to think about: do we want to keep the name "pick"? If not > then now is the last sensible time to change it. I don't have any > better suggestion however. There have been some suggestions on irc and I give some pros and cons keep the name pick tree/treeview navigation view forest explorer (not serious I think) zoom I think I am happy with any of the first three. At some point later I might add a flat (unthreaded) version of pick (eg just show the matching messages in date order, like mutt's unthreaded views); I don't know if we want a name which will be sensible for that. My thoughts on the names: "pick" is not a very intuitive name, but it is established and would do the unthreaded view too. "tree" is very intuitive. It might be odd for the unthreaded view. "navigation" is intuitive and would be fine for the unthreaded view. It does seem rather long for prefixes in lisp files. Perhaps use navigation for the name for documentation but pick or tree as the list prefix? The current series no longer applies to master (since Austin's series touched the pick file). I thought it might be worth settling on a name before reposting. Best wishes Mark
[PATCH] Compact tests and error handling
Ben Gamari writes: > Here are a few patches adding a test case and some more user feedback on > rename failure during compaction. > Hi Ben; I'd like to include this series in the next release, freezing on Nov. 8. Will you have a chance to revise it before then? d
[PATCH v2] new: Don't scan unchanged directories with no sub-directories
David Bremner writes: > Austin Clements writes: > >> This can substantially reduce the cost of notmuch new in some >> situations, such as when the file system cache is cold or when the >> Maildir is on NFS. > > On my desktop at home (a core i7 950) with spinning rust disks (and lvm > on luks) this patch yields about a 7% slowdown in the intial new perf > test > > from > > Wall(s) Usr(s) Sys(s) Res(K) In/Out(512B) > Initial notmuch new 579.60348.86 14.26 217188 5330266/3501272 > > to > > Wall(s) Usr(s) Sys(s) Res(K) In/Out(512B) > Initial notmuch new 620.51368.62 15.48 217156 5330354/3416456 > > On an SSD I don't detect a significant different (<0.5% speedup) Seems like a false alarm. Averaging over 10 repetitions, the patched version is about 1% faster. Unfortunately it points out that our performance test suite should really do more than one repetition for each test. -- next part -- A non-text attachment was scrubbed... Name: crunch.sh Type: text/x-sh Size: 246 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20131026/68674f26/attachment.sh> -- next part -- A non-text attachment was scrubbed... Name: drop-caches Type: application/octet-stream Size: 111 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20131026/68674f26/attachment.obj>
[PATCH v2 00/11] Fix search tagging races
On Thu, 24 Oct 2013, Austin Clements wrote: > This is v2 of id:1381185201-25197-1-git-send-email-amdragon at mit.edu. > It fixes several comments from Mark and Jani. This has been rebased > on top of the tag completion changes, so doing * from a large search > buffer will no longer crash. Hence, this series depends on the > (currently pending) series in > id:1382487721-31776-1-git-send-email-amdragon at mit.edu. This looks good to me +1 Mark > > This version does not address what happens when you * on a search > buffer that's still filling. With this series, it will apply to all > messages that have appeared when the user finishes entering tag > changes. This isn't ideal, but this seems pretty obscure and I'm not > sure what the right answer is, so I'm punting it to the future. > > Another thing that may be worth changing in a follow-up is what > messages * applies to. Currently, * applies *only* to matched > messages, not all threads in the search, which I think was an accident > of implementation. This series retains that behavior, but opens up > the possibility of applying to all threads instead. I think that > would be much more consistent and less surprising behavior. > > An approximate diff from v1 is below. This diff is prior to rebasing, > since the post-rebase diff is not useful. > > diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el > index a4eec14..36937fb 100644 > --- a/emacs/notmuch-tag.el > +++ b/emacs/notmuch-tag.el > @@ -242,7 +242,11 @@ from TAGS if present." > (error "Changed tag must be of the form `+this_tag' or > `-that_tag'") > (sort result-tags 'string<))) > > -(defconst notmuch-tag-argument-limit 1000) > +(defconst notmuch-tag-argument-limit 1000 > + "Use batch tagging if the tagging query is longer than this. > + > +This limits the length of arguments passed to the notmuch CLI to > +avoid system argument length limits and performance problems.") > > (defun notmuch-tag (query tag-changes) >"Add/remove tags in TAG-CHANGES to messages matching QUERY. > @@ -276,7 +280,6 @@ notmuch-after-tag-hook will be run." >;; Use batch tag mode to avoid argument length limitations >(let ((batch-op (concat (mapconcat #'notmuch-hex-encode tag-changes " > ") > " -- " query))) > - (message "Batch tagging with %s" batch-op) > (notmuch-call-notmuch-process :stdin-string batch-op "tag" "--batch"))) > (run-hooks 'notmuch-after-tag-hook)) >;; in all cases we return tag-changes as a list > diff --git a/notmuch-client.h b/notmuch-client.h > index 1b14910..8bc1a2a 100644 > --- a/notmuch-client.h > +++ b/notmuch-client.h > @@ -144,7 +144,8 @@ chomp_newline (char *str) > #define NOTMUCH_FORMAT_MIN 1 > /* The minimum non-deprecated structured output format version. > * Requests for format versions below this will print a stern warning. > - * Must be >= NOTMUCH_FORMAT_MIN and < NOTMUCH_FORMAT_CUR. > + * Must be between NOTMUCH_FORMAT_MIN and NOTMUCH_FORMAT_CUR, > + * inclusive. > */ > #define NOTMUCH_FORMAT_MIN_ACTIVE 1 > > diff --git a/notmuch-search.c b/notmuch-search.c > index 1d14651..7c973b3 100644 > --- a/notmuch-search.c > +++ b/notmuch-search.c > @@ -53,13 +53,13 @@ sanitize_string (const void *ctx, const char *str) > * NULL. */ > static int > get_thread_query (notmuch_thread_t *thread, > - char **matched_out, char **unmached_out) > + char **matched_out, char **unmatched_out) > { > notmuch_messages_t *messages; > char *escaped = NULL; > size_t escaped_len = 0; > > -*matched_out = *unmached_out = NULL; > +*matched_out = *unmatched_out = NULL; > > for (messages = notmuch_thread_get_messages (thread); >notmuch_messages_valid (messages); > @@ -69,17 +69,16 @@ get_thread_query (notmuch_thread_t *thread, > const char *mid = notmuch_message_get_message_id (message); > /* Determine which query buffer to extend */ > char **buf = notmuch_message_get_flag ( > - message, NOTMUCH_MESSAGE_FLAG_MATCH) ? matched_out : unmached_out; > - /* Allocate the query buffer is this is the first message */ > - if (!*buf && (*buf = talloc_strdup (thread, "")) == NULL) > - return -1; > + message, NOTMUCH_MESSAGE_FLAG_MATCH) ? matched_out : unmatched_out; > /* Add this message's id: query. Since "id" is an exclusive >* prefix, it is implicitly 'or'd together, so we only need to >* join queries with a space. */ > if (make_boolean_term (thread, "id", mid, , _len) < 0) > return -1; > - *buf = talloc_asprintf_append_buffer ( > - *buf, "%s%s", **buf ? " " : "", escaped); > + if (*buf) > + *buf = talloc_asprintf_append_buffer (*buf, " %s", escaped); > + else > + *buf = talloc_strdup (thread, escaped); > if (!*buf) > return -1; > }
Re: [PATCH 0/5] Move pick into mainline
One thing to think about: do we want to keep the name pick? If not then now is the last sensible time to change it. I don't have any better suggestion however. There have been some suggestions on irc and I give some pros and cons keep the name pick tree/treeview navigation view forest explorer (not serious I think) zoom I think I am happy with any of the first three. At some point later I might add a flat (unthreaded) version of pick (eg just show the matching messages in date order, like mutt's unthreaded views); I don't know if we want a name which will be sensible for that. My thoughts on the names: pick is not a very intuitive name, but it is established and would do the unthreaded view too. tree is very intuitive. It might be odd for the unthreaded view. navigation is intuitive and would be fine for the unthreaded view. It does seem rather long for prefixes in lisp files. Perhaps use navigation for the name for documentation but pick or tree as the list prefix? The current series no longer applies to master (since Austin's series touched the pick file). I thought it might be worth settling on a name before reposting. Best wishes Mark ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: Build broken on OS X 10.9
Please post the build log. Jani. On Oct 25, 2013 11:54 PM, Tad tadfis...@gmail.com wrote: Looks like notmuch 0.16 won't build on OS X 10.9 due to the switch to libc++. I don't know where to start with fixing this, but thought I'd let y'all know. ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH v2] new: Don't scan unchanged directories with no sub-directories
David Bremner da...@tethera.net writes: Austin Clements amdra...@mit.edu writes: This can substantially reduce the cost of notmuch new in some situations, such as when the file system cache is cold or when the Maildir is on NFS. On my desktop at home (a core i7 950) with spinning rust disks (and lvm on luks) this patch yields about a 7% slowdown in the intial new perf test from Wall(s) Usr(s) Sys(s) Res(K) In/Out(512B) Initial notmuch new 579.60348.86 14.26 217188 5330266/3501272 to Wall(s) Usr(s) Sys(s) Res(K) In/Out(512B) Initial notmuch new 620.51368.62 15.48 217156 5330354/3416456 On an SSD I don't detect a significant different (0.5% speedup) Seems like a false alarm. Averaging over 10 repetitions, the patched version is about 1% faster. Unfortunately it points out that our performance test suite should really do more than one repetition for each test. #!/bin/bash test_description='notmuch new' . ./perf-test-lib.sh time_start for i in $(seq 1 10); do rm -rf ${MAIL_DIR}/.notmuch sudo /home/bremner/config/scripts/drop-caches time_run notmuch new #$i 'notmuch new' done time_done drop-caches Description: Binary data ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH] Compact tests and error handling
Ben Gamari bgamari.f...@gmail.com writes: Here are a few patches adding a test case and some more user feedback on rename failure during compaction. Hi Ben; I'd like to include this series in the next release, freezing on Nov. 8. Will you have a chance to revise it before then? d ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH 1/4] emacs: help: check for nil key binding
A standard way to unset a key binding is local-unset-key which is equivalent to (define-key (current-local-map) key nil) Currently notmuch-help gives an error and fails if a user has done this. To fix this we check for a nil binding before adding a help line. --- emacs/notmuch.el | 25 + 1 files changed, 13 insertions(+), 12 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 6081245..f98f8cf 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -158,18 +158,19 @@ prefix argument. PREFIX and TAIL are used internally. (notmuch-describe-keymap binding ua-keys (notmuch-prefix-key-description key) tail))) (t - (when (and ua-keys (symbolp binding) - (get binding 'notmuch-prefix-doc)) - ;; Documentation for prefixed command - (let ((ua-desc (key-description ua-keys))) - (push (concat ua-desc prefix (format-kbd-macro (vector key)) - \t (get binding 'notmuch-prefix-doc)) - tail))) - ;; Documentation for command - (push (concat prefix (format-kbd-macro (vector key)) \t - (or (and (symbolp binding) (get binding 'notmuch-doc)) - (notmuch-documentation-first-line binding))) - tail + (unless (not binding) + (when (and ua-keys (symbolp binding) +(get binding 'notmuch-prefix-doc)) + ;; Documentation for prefixed command + (let ((ua-desc (key-description ua-keys))) + (push (concat ua-desc prefix (format-kbd-macro (vector key)) + \t (get binding 'notmuch-prefix-doc)) + tail))) + ;; Documentation for command + (push (concat prefix (format-kbd-macro (vector key)) \t + (or (and (symbolp binding) (get binding 'notmuch-doc)) + (notmuch-documentation-first-line binding))) + tail) keymap) tail) -- 1.7.9.1 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH 0/4] emacs: help: and remap keybindings
This series makes 3 tweaks to the emacs help. The first fixes a bug whereby if a user unsets a keybinding notmuch-help throws an error (function being nil) and does not work. The second removes duplicates from the list of returned keybindings; these occur if a user or mode overrides a keybinding in notmuch-common-keymap. This happens in pick. See id:1381498794-17000-1-git-send-email-markwalters1...@gmail.com for a different approach. I think this is probably neater but am happy either way. The third patch fixes some problems if a user or mode rebinds keys using remap. Currently they appear in help as remapfunction New function docstring. This patch replaces the remapfunction with the actual key binding. The final patch is separate but is the actual motivation for the earlier ones. It switches pick to use remap for its over bindings. This means the over bindings will work correctly if the user customises the common-keymap. This approach was suggested by Austin in id:20130915153642.gy1...@mit.edu. All tests pass and it seems to work including modifications to the common-keymap. Best wishes Mark PS Obviously the final patch will clash with a rename of pick to tree, but the rebase will be trivial. Mark Walters (4): emacs: help: check for nil key binding emacs: help: remove duplicate bindings emacs: help: remap support contrib: pick: use remap for the over-ridden global bindings contrib/notmuch-pick/notmuch-pick.el |8 ++-- emacs/notmuch.el | 58 +- 2 files changed, 40 insertions(+), 26 deletions(-) -- 1.7.9.1 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH 2/4] emacs: help: remove duplicate bindings
If the user (or a mode) overrides a keybinding from the common keymap in one of the modes then both help lines appear in the help screen even though only one of the is applicable. Fix this by checking if we already have that key binding. We do this by constructing an list of (key . docstring) pairs so it is easy to check if we have already had that binding. Then the actual print help routine changes these pairs into strings key \t docstring --- emacs/notmuch.el | 38 ++ 1 files changed, 22 insertions(+), 16 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index f98f8cf..b9db9ba 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -141,11 +141,12 @@ This is basically just `format-kbd-macro' but we also convert ESC to M-. (concat desc (defun notmuch-describe-keymap (keymap ua-keys optional prefix tail) - Return a list of strings, each describing one binding in KEYMAP. + Return a list of cons cells, each describing one binding in KEYMAP. -Each string gives a human-readable description of the key and a -one-line description of the bound function. See `notmuch-help' -for an overview of how this documentation is extracted. +Each cons cell consists of a string giving a human-readable +description of the key, and a one-line description of the bound +function. See `notmuch-help' for an overview of how this +documentation is extracted. UA-KEYS should be a key sequence bound to `universal-argument'. It will be used to describe bindings of commands that support a @@ -158,19 +159,23 @@ prefix argument. PREFIX and TAIL are used internally. (notmuch-describe-keymap binding ua-keys (notmuch-prefix-key-description key) tail))) (t - (unless (not binding) - (when (and ua-keys (symbolp binding) -(get binding 'notmuch-prefix-doc)) - ;; Documentation for prefixed command - (let ((ua-desc (key-description ua-keys))) - (push (concat ua-desc prefix (format-kbd-macro (vector key)) - \t (get binding 'notmuch-prefix-doc)) - tail))) - ;; Documentation for command - (push (concat prefix (format-kbd-macro (vector key)) \t + (let ((key-string (concat prefix (format-kbd-macro (vector key) + ;; We don't include documentation if the key-binding is + ;; over-ridden. Note, over-riding a binding + ;; automatically hides the prefixed version too. + (unless (or (assoc key-string tail) (not binding)) + (when (and ua-keys (symbolp binding) + (get binding 'notmuch-prefix-doc)) + ;; Documentation for prefixed command + (let ((ua-desc (key-description ua-keys))) + (push (cons (concat ua-desc prefix (format-kbd-macro (vector key))) + (get binding 'notmuch-prefix-doc)) + tail))) + ;; Documentation for command + (push (cons key-string (or (and (symbolp binding) (get binding 'notmuch-doc)) (notmuch-documentation-first-line binding))) - tail) + tail)) keymap) tail) @@ -181,7 +186,8 @@ prefix argument. PREFIX and TAIL are used internally. (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1))) (keymap (symbol-value (intern keymap-name))) (ua-keys (where-is-internal 'universal-argument keymap t)) -(desc-list (notmuch-describe-keymap keymap ua-keys)) +(desc-alist (notmuch-describe-keymap keymap ua-keys)) +(desc-list (mapcar (lambda (arg) (concat (car arg) \t (cdr arg))) desc-alist)) (desc (mapconcat #'identity desc-list \n))) (setq doc (replace-match desc 1 1 doc))) (setq beg (match-end 0))) -- 1.7.9.1 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH 3/4] emacs: help: remap support
If a user or mode uses remap to rebind a keybinding then it appears in the help as a line remapfunction New function docstring. Special case these remapping lines so that we print the actual binding. --- emacs/notmuch.el | 21 ++--- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index b9db9ba..c354b05 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -140,7 +140,7 @@ This is basically just `format-kbd-macro' but we also convert ESC to M-. M- (concat desc -(defun notmuch-describe-keymap (keymap ua-keys optional prefix tail) +(defun notmuch-describe-keymap (keymap ua-keys optional prefix tail remap) Return a list of cons cells, each describing one binding in KEYMAP. Each cons cell consists of a string giving a human-readable @@ -150,16 +150,23 @@ documentation is extracted. UA-KEYS should be a key sequence bound to `universal-argument'. It will be used to describe bindings of commands that support a -prefix argument. PREFIX and TAIL are used internally. +prefix argument. PREFIX, TAIL and REMAP are used internally. (map-keymap (lambda (key binding) (cond ((mouse-event-p key) nil) ((keymapp binding) - (setq tail - (notmuch-describe-keymap - binding ua-keys (notmuch-prefix-key-description key) tail))) + (if (equal key 'remap) + (setq tail + (notmuch-describe-keymap + binding ua-keys prefix tail t)) + (setq tail + (notmuch-describe-keymap +binding ua-keys (notmuch-prefix-key-description key) tail (t - (let ((key-string (concat prefix (format-kbd-macro (vector key) + (let* ((actual-key (if remap + (where-is-internal key nil t) +(vector key))) + (key-string (concat prefix (format-kbd-macro actual-key ;; We don't include documentation if the key-binding is ;; over-ridden. Note, over-riding a binding ;; automatically hides the prefixed version too. @@ -168,7 +175,7 @@ prefix argument. PREFIX and TAIL are used internally. (get binding 'notmuch-prefix-doc)) ;; Documentation for prefixed command (let ((ua-desc (key-description ua-keys))) - (push (cons (concat ua-desc prefix (format-kbd-macro (vector key))) + (push (cons (concat ua-desc prefix (format-kbd-macro actual-key)) (get binding 'notmuch-prefix-doc)) tail))) ;; Documentation for command -- 1.7.9.1 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH 4/4] contrib: pick: use remap for the over-ridden global bindings
Following a suggestion by Austin in id:20130915153642.gy1...@mit.edu we use remap for the over-riding bindings in pick. This means that if the user modifies the global keymap these modifications will happen in the pick versions of them too. [Pick overrides these to do things like close the message pane before doing the action, so the functionality is very close to the original common keymap function.] --- contrib/notmuch-pick/notmuch-pick.el |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index 156ea6d..73f6501 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -226,13 +226,13 @@ FUNC. (set-keymap-parent map notmuch-common-keymap) ;; The following override the global keymap. ;; Override because we want to close message pane first. -(define-key map ? (notmuch-pick-close-message-pane-and #'notmuch-help)) +(define-key map [remap notmuch-help] (notmuch-pick-close-message-pane-and #'notmuch-help)) ;; Override because we first close message pane and then close pick buffer. -(define-key map q 'notmuch-pick-quit) +(define-key map [remap notmuch-kill-this-buffer] 'notmuch-pick-quit) ;; Override because we close message pane after the search query is entered. -(define-key map s 'notmuch-pick-to-search) +(define-key map [remap notmuch-search] 'notmuch-pick-to-search) ;; Override because we want to close message pane first. -(define-key map m (notmuch-pick-close-message-pane-and #'notmuch-mua-new-mail)) +(define-key map [remap notmuch-mua-new-mail] (notmuch-pick-close-message-pane-and #'notmuch-mua-new-mail)) ;; these use notmuch-show functions directly (define-key map | 'notmuch-show-pipe-message) -- 1.7.9.1 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH 0/4] rename pick to tree
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 markwalters1...@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)
[PATCH 4/4] pick: rename test emacs-pick to emacs-tree
Also fixup run-tests.sh --- contrib/notmuch-pick/run-tests.sh|2 +- contrib/notmuch-pick/test/emacs-pick | 210 -- contrib/notmuch-pick/test/emacs-tree | 210 ++ 3 files changed, 211 insertions(+), 211 deletions(-) delete mode 100755 contrib/notmuch-pick/test/emacs-pick create mode 100755 contrib/notmuch-pick/test/emacs-tree diff --git a/contrib/notmuch-pick/run-tests.sh b/contrib/notmuch-pick/run-tests.sh index 4832d72..1767949 100755 --- a/contrib/notmuch-pick/run-tests.sh +++ b/contrib/notmuch-pick/run-tests.sh @@ -7,7 +7,7 @@ fail() { exit 1 } -TESTS=emacs-pick +TESTS=emacs-tree TESTFILES=$TESTS tree.expected-output export PICK_DIR=`cd \`dirname $0\` pwd` diff --git a/contrib/notmuch-pick/test/emacs-pick b/contrib/notmuch-pick/test/emacs-pick deleted file mode 100755 index 05ce85d..000 --- a/contrib/notmuch-pick/test/emacs-pick +++ /dev/null @@ -1,210 +0,0 @@ -#!/usr/bin/env bash - -test_description=emacs tree view interface -. test-lib.sh - -EXPECTED=$TEST_DIRECTORY/tree.expected-output - -add_email_corpus -test_begin_subtest Do we have emacs -test_emacs '(insert hello\n) - (test-output)' -cat EOF EXPECTED -hello -EOF -test_expect_equal_file OUTPUT EXPECTED - -test_begin_subtest Basic notmuch-tree view in emacs -test_emacs '(add-to-list (quote load-path) '$PICK_DIR') - (require (quote notmuch-tree)) - (notmuch-tree tag:inbox) - (notmuch-test-wait) - (test-output) - (delete-other-windows)' -test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox - -test_begin_subtest Refreshed notmuch-tree view in emacs -test_emacs '(add-to-list (quote load-path) '$PICK_DIR') - (require (quote notmuch-tree)) - (notmuch-tree tag:inbox) - (notmuch-test-wait) - (notmuch-tree-refresh-view) - (notmuch-test-wait) - (test-output) - (delete-other-windows)' -test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox - -# In the following tag tests we make sure the display is updated -# correctly and, in a separate test, that the database is updated -# correctly. - -test_begin_subtest Tag message in notmuch tree view (display) -test_emacs '(add-to-list (quote load-path) '$PICK_DIR') - (require (quote notmuch-tree)) - (notmuch-tree tag:inbox) - (notmuch-test-wait) - (forward-line) - (notmuch-tree-tag (list +test_tag)) - (test-output) - (delete-other-windows)' -test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox-tagged - -test_begin_subtest Tag message in notmuch tree view (database) -output=$(notmuch search --output=messages 'tag:test_tag') -test_expect_equal $output id:877h1wv7mg@inf-8657.int-evry.fr - -test_begin_subtest Untag message in notmuch tree view -test_emacs '(add-to-list (quote load-path) '$PICK_DIR') - (require (quote notmuch-tree)) - (notmuch-tree tag:inbox) - (notmuch-test-wait) - (forward-line) - (notmuch-tree-tag (list -test_tag)) - (test-output) - (delete-other-windows)' -test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox - -test_begin_subtest Untag message in notmuch tree view (database) -output=$(notmuch search --output=messages 'tag:test_tag') -test_expect_equal $output - -test_begin_subtest Tag thread in notmuch tree view -test_emacs '(add-to-list (quote load-path) '$PICK_DIR') - (require (quote notmuch-tree)) - (notmuch-tree tag:inbox) - (notmuch-test-wait) - ;; move to a sizable thread - (forward-line 26) - (notmuch-tree-tag-thread (list +test_thread_tag)) - (test-output) - (delete-other-windows)' -test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox-thread-tagged - -test_begin_subtest Tag message in notmuch tree view (database) -output=$(notmuch search --output=messages 'tag:test_thread_tag') -test_expect_equal $output \ -id:87ocn0qh6d@yoom.home.cworth.org -id:20091118005040.ga25...@dottiness.seas.harvard.edu -id:yunaayketfm@aiko.keithp.com -id:87fx8can9z.fsf@vertex.dottedmag -id:20091117203301.gv3...@dottiness.seas.harvard.edu -id:87iqd9rn3l.fsf@vertex.dottedmag -id:20091117190054.gu3...@dottiness.seas.harvard.edu - -test_begin_subtest Untag thread in notmuch tree view -test_emacs '(add-to-list (quote load-path) '$PICK_DIR') - (require (quote notmuch-tree)) - (notmuch-tree tag:inbox) - (notmuch-test-wait) - ;; move to the same sizable thread as above - (forward-line 26) - (notmuch-tree-tag-thread (list -test_thread_tag)) - (test-output) - (delete-other-windows)' -test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox - -test_begin_subtest Untag message in notmuch tree view (database) -output=$(notmuch search
[PATCH 2/4] pick: Change the test names and print out for pick tests
Change from the pick name to the tree name --- contrib/notmuch-pick/test/emacs-pick | 28 ++-- 1 files changed, 14 insertions(+), 14 deletions(-) diff --git a/contrib/notmuch-pick/test/emacs-pick b/contrib/notmuch-pick/test/emacs-pick index fae6e9e..2cc3edc 100755 --- a/contrib/notmuch-pick/test/emacs-pick +++ b/contrib/notmuch-pick/test/emacs-pick @@ -1,6 +1,6 @@ #!/usr/bin/env bash -test_description=emacs pick interface +test_description=emacs tree view interface . test-lib.sh EXPECTED=$TEST_DIRECTORY/pick.expected-output @@ -14,7 +14,7 @@ hello EOF test_expect_equal_file OUTPUT EXPECTED -test_begin_subtest Basic notmuch-pick view in emacs +test_begin_subtest Basic notmuch-tree view in emacs test_emacs '(add-to-list (quote load-path) '$PICK_DIR') (require (quote notmuch-tree)) (notmuch-tree tag:inbox) @@ -23,7 +23,7 @@ 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_begin_subtest Refreshed notmuch-tree view in emacs test_emacs '(add-to-list (quote load-path) '$PICK_DIR') (require (quote notmuch-tree)) (notmuch-tree tag:inbox) @@ -38,7 +38,7 @@ test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox # correctly and, in a separate test, that the database is updated # correctly. -test_begin_subtest Tag message in notmuch pick view (display) +test_begin_subtest Tag message in notmuch tree view (display) test_emacs '(add-to-list (quote load-path) '$PICK_DIR') (require (quote notmuch-tree)) (notmuch-tree tag:inbox) @@ -49,11 +49,11 @@ test_emacs '(add-to-list (quote load-path) '$PICK_DIR') (delete-other-windows)' test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox-tagged -test_begin_subtest Tag message in notmuch pick view (database) +test_begin_subtest Tag message in notmuch tree view (database) output=$(notmuch search --output=messages 'tag:test_tag') test_expect_equal $output id:877h1wv7mg@inf-8657.int-evry.fr -test_begin_subtest Untag message in notmuch pick view +test_begin_subtest Untag message in notmuch tree view test_emacs '(add-to-list (quote load-path) '$PICK_DIR') (require (quote notmuch-tree)) (notmuch-tree tag:inbox) @@ -64,11 +64,11 @@ 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 Untag message in notmuch pick view (database) +test_begin_subtest Untag message in notmuch tree view (database) output=$(notmuch search --output=messages 'tag:test_tag') test_expect_equal $output -test_begin_subtest Tag thread in notmuch pick view +test_begin_subtest Tag thread in notmuch tree view test_emacs '(add-to-list (quote load-path) '$PICK_DIR') (require (quote notmuch-tree)) (notmuch-tree tag:inbox) @@ -80,7 +80,7 @@ test_emacs '(add-to-list (quote load-path) '$PICK_DIR') (delete-other-windows)' test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox-thread-tagged -test_begin_subtest Tag message in notmuch pick view (database) +test_begin_subtest Tag message in notmuch tree view (database) output=$(notmuch search --output=messages 'tag:test_thread_tag') test_expect_equal $output \ id:87ocn0qh6d@yoom.home.cworth.org @@ -91,7 +91,7 @@ id:20091117203301.gv3...@dottiness.seas.harvard.edu id:87iqd9rn3l.fsf@vertex.dottedmag id:20091117190054.gu3...@dottiness.seas.harvard.edu -test_begin_subtest Untag thread in notmuch pick view +test_begin_subtest Untag thread in notmuch tree view test_emacs '(add-to-list (quote load-path) '$PICK_DIR') (require (quote notmuch-tree)) (notmuch-tree tag:inbox) @@ -103,7 +103,7 @@ 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 Untag message in notmuch pick view (database) +test_begin_subtest Untag message in notmuch tree view (database) output=$(notmuch search --output=messages 'tag:test_thread_tag') test_expect_equal $output @@ -119,7 +119,7 @@ test_emacs '(notmuch-hello) (delete-other-windows)' test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox -test_begin_subtest Pick of a single thread (from search) +test_begin_subtest Tree view of a single thread (from search) test_emacs '(notmuch-hello) (goto-char (point-min)) (re-search-forward inbox) @@ -131,7 +131,7 @@ test_emacs '(notmuch-hello) (delete-other-windows)' test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-single-thread -test_begin_subtest Pick of a single thread (from show) +test_begin_subtest Tree view of a single thread (from show) test_emacs
[PATCH 2/4] pick: Change the test names and print out for pick tests
Change from the pick name to the tree name --- contrib/notmuch-pick/test/emacs-pick | 28 ++-- 1 files changed, 14 insertions(+), 14 deletions(-) diff --git a/contrib/notmuch-pick/test/emacs-pick b/contrib/notmuch-pick/test/emacs-pick index fae6e9e..2cc3edc 100755 --- a/contrib/notmuch-pick/test/emacs-pick +++ b/contrib/notmuch-pick/test/emacs-pick @@ -1,6 +1,6 @@ #!/usr/bin/env bash -test_description=emacs pick interface +test_description=emacs tree view interface . test-lib.sh EXPECTED=$TEST_DIRECTORY/pick.expected-output @@ -14,7 +14,7 @@ hello EOF test_expect_equal_file OUTPUT EXPECTED -test_begin_subtest Basic notmuch-pick view in emacs +test_begin_subtest Basic notmuch-tree view in emacs test_emacs '(add-to-list (quote load-path) '$PICK_DIR') (require (quote notmuch-tree)) (notmuch-tree tag:inbox) @@ -23,7 +23,7 @@ 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_begin_subtest Refreshed notmuch-tree view in emacs test_emacs '(add-to-list (quote load-path) '$PICK_DIR') (require (quote notmuch-tree)) (notmuch-tree tag:inbox) @@ -38,7 +38,7 @@ test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox # correctly and, in a separate test, that the database is updated # correctly. -test_begin_subtest Tag message in notmuch pick view (display) +test_begin_subtest Tag message in notmuch tree view (display) test_emacs '(add-to-list (quote load-path) '$PICK_DIR') (require (quote notmuch-tree)) (notmuch-tree tag:inbox) @@ -49,11 +49,11 @@ test_emacs '(add-to-list (quote load-path) '$PICK_DIR') (delete-other-windows)' test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox-tagged -test_begin_subtest Tag message in notmuch pick view (database) +test_begin_subtest Tag message in notmuch tree view (database) output=$(notmuch search --output=messages 'tag:test_tag') test_expect_equal $output id:877h1wv7mg@inf-8657.int-evry.fr -test_begin_subtest Untag message in notmuch pick view +test_begin_subtest Untag message in notmuch tree view test_emacs '(add-to-list (quote load-path) '$PICK_DIR') (require (quote notmuch-tree)) (notmuch-tree tag:inbox) @@ -64,11 +64,11 @@ 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 Untag message in notmuch pick view (database) +test_begin_subtest Untag message in notmuch tree view (database) output=$(notmuch search --output=messages 'tag:test_tag') test_expect_equal $output -test_begin_subtest Tag thread in notmuch pick view +test_begin_subtest Tag thread in notmuch tree view test_emacs '(add-to-list (quote load-path) '$PICK_DIR') (require (quote notmuch-tree)) (notmuch-tree tag:inbox) @@ -80,7 +80,7 @@ test_emacs '(add-to-list (quote load-path) '$PICK_DIR') (delete-other-windows)' test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox-thread-tagged -test_begin_subtest Tag message in notmuch pick view (database) +test_begin_subtest Tag message in notmuch tree view (database) output=$(notmuch search --output=messages 'tag:test_thread_tag') test_expect_equal $output \ id:87ocn0qh6d@yoom.home.cworth.org @@ -91,7 +91,7 @@ id:20091117203301.gv3...@dottiness.seas.harvard.edu id:87iqd9rn3l.fsf@vertex.dottedmag id:20091117190054.gu3...@dottiness.seas.harvard.edu -test_begin_subtest Untag thread in notmuch pick view +test_begin_subtest Untag thread in notmuch tree view test_emacs '(add-to-list (quote load-path) '$PICK_DIR') (require (quote notmuch-tree)) (notmuch-tree tag:inbox) @@ -103,7 +103,7 @@ 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 Untag message in notmuch pick view (database) +test_begin_subtest Untag message in notmuch tree view (database) output=$(notmuch search --output=messages 'tag:test_thread_tag') test_expect_equal $output @@ -119,7 +119,7 @@ test_emacs '(notmuch-hello) (delete-other-windows)' test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox -test_begin_subtest Pick of a single thread (from search) +test_begin_subtest Tree view of a single thread (from search) test_emacs '(notmuch-hello) (goto-char (point-min)) (re-search-forward inbox) @@ -131,7 +131,7 @@ test_emacs '(notmuch-hello) (delete-other-windows)' test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-single-thread -test_begin_subtest Pick of a single thread (from show) +test_begin_subtest Tree view of a single thread (from show) test_emacs
[PATCH 0/4] rename pick to tree
This is a non-screwed up (I hope) version of id:1382822481-26659-1-git-send-email-markwalters1...@gmail.com It renames pick to tree (usually called tree view in documentation). See the previous cover letter for comments and how I have split it. This time all tests pass at each stage on a fresh clone, and the actual move of the notmuch-pick.el file itself to notmuch-tree.el is also included. 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 | 951 contrib/notmuch-pick/notmuch-tree.el | 951 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 ++ 15 files changed, 1368 insertions(+), 1368 deletions(-) delete mode 100644 contrib/notmuch-pick/notmuch-pick.el create mode 100644 contrib/notmuch-pick/notmuch-tree.el 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 -- 1.7.9.1 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH 4/4] pick: rename test emacs-pick to emacs-tree
Also fixup run-tests.sh --- contrib/notmuch-pick/run-tests.sh|2 +- contrib/notmuch-pick/test/emacs-pick | 210 -- contrib/notmuch-pick/test/emacs-tree | 210 ++ 3 files changed, 211 insertions(+), 211 deletions(-) delete mode 100755 contrib/notmuch-pick/test/emacs-pick create mode 100755 contrib/notmuch-pick/test/emacs-tree diff --git a/contrib/notmuch-pick/run-tests.sh b/contrib/notmuch-pick/run-tests.sh index 4832d72..1767949 100755 --- a/contrib/notmuch-pick/run-tests.sh +++ b/contrib/notmuch-pick/run-tests.sh @@ -7,7 +7,7 @@ fail() { exit 1 } -TESTS=emacs-pick +TESTS=emacs-tree TESTFILES=$TESTS tree.expected-output export PICK_DIR=`cd \`dirname $0\` pwd` diff --git a/contrib/notmuch-pick/test/emacs-pick b/contrib/notmuch-pick/test/emacs-pick deleted file mode 100755 index 05ce85d..000 --- a/contrib/notmuch-pick/test/emacs-pick +++ /dev/null @@ -1,210 +0,0 @@ -#!/usr/bin/env bash - -test_description=emacs tree view interface -. test-lib.sh - -EXPECTED=$TEST_DIRECTORY/tree.expected-output - -add_email_corpus -test_begin_subtest Do we have emacs -test_emacs '(insert hello\n) - (test-output)' -cat EOF EXPECTED -hello -EOF -test_expect_equal_file OUTPUT EXPECTED - -test_begin_subtest Basic notmuch-tree view in emacs -test_emacs '(add-to-list (quote load-path) '$PICK_DIR') - (require (quote notmuch-tree)) - (notmuch-tree tag:inbox) - (notmuch-test-wait) - (test-output) - (delete-other-windows)' -test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox - -test_begin_subtest Refreshed notmuch-tree view in emacs -test_emacs '(add-to-list (quote load-path) '$PICK_DIR') - (require (quote notmuch-tree)) - (notmuch-tree tag:inbox) - (notmuch-test-wait) - (notmuch-tree-refresh-view) - (notmuch-test-wait) - (test-output) - (delete-other-windows)' -test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox - -# In the following tag tests we make sure the display is updated -# correctly and, in a separate test, that the database is updated -# correctly. - -test_begin_subtest Tag message in notmuch tree view (display) -test_emacs '(add-to-list (quote load-path) '$PICK_DIR') - (require (quote notmuch-tree)) - (notmuch-tree tag:inbox) - (notmuch-test-wait) - (forward-line) - (notmuch-tree-tag (list +test_tag)) - (test-output) - (delete-other-windows)' -test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox-tagged - -test_begin_subtest Tag message in notmuch tree view (database) -output=$(notmuch search --output=messages 'tag:test_tag') -test_expect_equal $output id:877h1wv7mg@inf-8657.int-evry.fr - -test_begin_subtest Untag message in notmuch tree view -test_emacs '(add-to-list (quote load-path) '$PICK_DIR') - (require (quote notmuch-tree)) - (notmuch-tree tag:inbox) - (notmuch-test-wait) - (forward-line) - (notmuch-tree-tag (list -test_tag)) - (test-output) - (delete-other-windows)' -test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox - -test_begin_subtest Untag message in notmuch tree view (database) -output=$(notmuch search --output=messages 'tag:test_tag') -test_expect_equal $output - -test_begin_subtest Tag thread in notmuch tree view -test_emacs '(add-to-list (quote load-path) '$PICK_DIR') - (require (quote notmuch-tree)) - (notmuch-tree tag:inbox) - (notmuch-test-wait) - ;; move to a sizable thread - (forward-line 26) - (notmuch-tree-tag-thread (list +test_thread_tag)) - (test-output) - (delete-other-windows)' -test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox-thread-tagged - -test_begin_subtest Tag message in notmuch tree view (database) -output=$(notmuch search --output=messages 'tag:test_thread_tag') -test_expect_equal $output \ -id:87ocn0qh6d@yoom.home.cworth.org -id:20091118005040.ga25...@dottiness.seas.harvard.edu -id:yunaayketfm@aiko.keithp.com -id:87fx8can9z.fsf@vertex.dottedmag -id:20091117203301.gv3...@dottiness.seas.harvard.edu -id:87iqd9rn3l.fsf@vertex.dottedmag -id:20091117190054.gu3...@dottiness.seas.harvard.edu - -test_begin_subtest Untag thread in notmuch tree view -test_emacs '(add-to-list (quote load-path) '$PICK_DIR') - (require (quote notmuch-tree)) - (notmuch-tree tag:inbox) - (notmuch-test-wait) - ;; move to the same sizable thread as above - (forward-line 26) - (notmuch-tree-tag-thread (list -test_thread_tag)) - (test-output) - (delete-other-windows)' -test_expect_equal_file OUTPUT $EXPECTED/notmuch-tree-tag-inbox - -test_begin_subtest Untag message in notmuch tree view (database) -output=$(notmuch search