[PATCH] emacs: target notmuch-one.el[c] -- emacs client in one .el[c] file
Added Makefile recipes to create notmuch emacs client in just one .el[c] file. This is an experimental feature and not built by default. This is useful for example when one wants to build the latest emacs client and then distribute the elisp file to many machines. This is also useful for (initial) testing: make emacs/notmuch-one.elc emacs -q -l emacs/notmuch-one.elc -f notmuch can be used to quickly experiment with new development. --- I've used one-file notmuch.elc since Fri Nov 4 11:03:33 2011 +0200 when I created perl script to combine all .el files together and had only minor problems (if any, cannot be sure). I build notmuch.elc in one machine and then distribute it to 2 others. Now with the .eldeps target Austin created the same can be done by utilizing the dependency information it provied. Now I build notmuch using something like the following sequence: ./configure --without-emacs make make install make emacs/notmuch-one.elc cp emacs/notmuch-one.elc ~/local/elisp-ext/notmuch.elc ... but most often I do last 2 of the above and then continue with: scp ~/local/elisp-ext/notmuch.elc host2:local/elisp-ext scp ~/local/elisp-ext/notmuch.elc host3:local/elisp-ext emacs/Makefile.local | 14 ++ 1 file changed, 14 insertions(+) diff --git a/emacs/Makefile.local b/emacs/Makefile.local index a910aff..9e3d409 100644 --- a/emacs/Makefile.local +++ b/emacs/Makefile.local @@ -46,6 +46,20 @@ endif install: install-emacs endif +# Unsupported hack to provide notmuch emacs client in one *.elc file. +# It probably works -- or then it fails mysteriously. YMMV. +# Enter `make emacs/notmuch-one.elc' in top level directory to build it. +ifeq ($(HAVE_EMACS),1) +$(dir)/notmuch-one.el: $(emacs_sources) + rm -f $(emacs_bytecode) # XXX + make -n all WITH_EMACS=1 | sed -n '/printf.*EMACS/ s/.* //p' | \ + xargs grep -vh '(declare-function.*"notmuch' > '$@' || : + { echo ';; Local Variables:'; \ + echo ';; byte-compile-warnings: (not cl-functions)'; \ + echo ';; End:'; } >> '$@' +endif +CLEAN+=$(dir)/notmuch-one.el $(dir)/notmuch-one.elc + .PHONY: install-emacs install-emacs: mkdir -p "$(DESTDIR)$(emacslispdir)" -- 1.8.0
[PATCH] test: update insert tests for new maildir synchronization rules
From: David BremnerAs of id:1355952747-27350-4-git-send-email-sojkam1 at fel.cvut.cz we are more conservative about moving messages from ./new to ./cur. This updates the insert tests to match --- Hopefully this makes sense, and is not just papering over a real problem that should be fixed. test/insert | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/insert b/test/insert index 021edb6..1718120 100755 --- a/test/insert +++ b/test/insert @@ -82,7 +82,7 @@ gen_insert_msg notmuch insert --folder=Drafts < "$gen_msg_filename" output=$(notmuch search --output=files folder:Drafts) dirname=$(dirname "$output") -test_expect_equal "$dirname" "$MAIL_DIR/Drafts/cur" +test_expect_equal "$dirname" "$MAIL_DIR/Drafts/new" test_begin_subtest "Insert message into folder, add/remove tags" gen_insert_msg @@ -99,14 +99,14 @@ gen_insert_msg notmuch insert --folder=F --create-folder +folder < "$gen_msg_filename" output=$(notmuch search --output=files folder:F tag:folder) basename=$(basename "$output") -test_expect_equal_file "$gen_msg_filename" "$MAIL_DIR/F/cur/${basename}" +test_expect_equal_file "$gen_msg_filename" "$MAIL_DIR/F/new/${basename}" test_begin_subtest "Insert message, create subfolder" gen_insert_msg notmuch insert --folder=F/G/H/I/J --create-folder +folder < "$gen_msg_filename" output=$(notmuch search --output=files folder:F/G/H/I/J tag:folder) basename=$(basename "$output") -test_expect_equal_file "$gen_msg_filename" "${MAIL_DIR}/F/G/H/I/J/cur/${basename}" +test_expect_equal_file "$gen_msg_filename" "${MAIL_DIR}/F/G/H/I/J/new/${basename}" test_begin_subtest "Insert message, create existing subfolder" gen_insert_msg -- 1.8.3.2
[Patch v3 3/3] contrib: pick: test: refresh view
A recent proposed patch was buggy when refreshing the view. Add a test for refresh so that this does not reoccur. --- contrib/notmuch-pick/test/emacs-pick | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/contrib/notmuch-pick/test/emacs-pick b/contrib/notmuch-pick/test/emacs-pick index eed5f02..37f974a 100755 --- a/contrib/notmuch-pick/test/emacs-pick +++ b/contrib/notmuch-pick/test/emacs-pick @@ -23,6 +23,17 @@ test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'") (delete-other-windows)' test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox +test_begin_subtest "Refreshed notmuch-pick view in emacs" +test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'") + (require (quote notmuch-pick)) + (notmuch-pick "tag:inbox") + (notmuch-test-wait) + (notmuch-pick-refresh-view) + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox + test_begin_subtest "Navigation of notmuch-hello to search results" test_emacs '(notmuch-hello) (goto-char (point-min)) -- 1.7.9.1
[Patch v3 2/3] contrib: pick: add docstring for notmuch-pick-worker
--- contrib/notmuch-pick/notmuch-pick.el |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index 32bd6b5..5dcc942 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -854,6 +854,10 @@ Complete list of currently available key bindings: results-buf) (defun notmuch-pick-worker (basic-query query-context target open-target) + "Insert the actual pick search in the current buffer. + +This is is a helper function for notmuch-pick. The arguments are +the same as for the function notmuch-pick." (interactive) (notmuch-pick-mode) (setq notmuch-pick-basic-query basic-query) -- 1.7.9.1
[Patch v3 1/3] contrib: pick: remove unneeded variable notmuch-pick-buffer-name
This variable is essentially unused: it was only used for making sure it itself got reset after a refresh of the buffer. It did this by passing an unnecessary argument to notmuch-pick-worker so remove that too. --- contrib/notmuch-pick/notmuch-pick.el | 25 + 1 files changed, 9 insertions(+), 16 deletions(-) diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index f7caaa8..32bd6b5 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -161,10 +161,6 @@ "A buffer local copy of argument open-target to the function notmuch-pick") (make-variable-buffer-local 'notmuch-pick-open-target) -(defvar notmuch-pick-buffer-name nil - "A buffer local copy of argument buffer-name to the function notmuch-pick") -(make-variable-buffer-local 'notmuch-pick-buffer-name) - (defvar notmuch-pick-message-window nil "The window of the message pane. @@ -590,13 +586,11 @@ message will be \"unarchived\", i.e. the tag changes in (let ((inhibit-read-only t) (basic-query notmuch-pick-basic-query) (query-context notmuch-pick-query-context) - (target (notmuch-pick-get-message-id)) - (buffer-name notmuch-pick-buffer-name)) + (target (notmuch-pick-get-message-id))) (erase-buffer) (notmuch-pick-worker basic-query query-context -target -(get-buffer buffer-name +target))) (defun notmuch-pick-thread-top () (when (notmuch-pick-get-message-properties) @@ -859,12 +853,11 @@ Complete list of currently available key bindings: (notmuch-sexp-parse-partial-list 'notmuch-pick-insert-forest-thread results-buf) -(defun notmuch-pick-worker (basic-query query-context target buffer open-target) +(defun notmuch-pick-worker (basic-query query-context target open-target) (interactive) (notmuch-pick-mode) (setq notmuch-pick-basic-query basic-query) (setq notmuch-pick-query-context query-context) - (setq notmuch-pick-buffer-name (buffer-name buffer)) (setq notmuch-pick-target-msg target) (setq notmuch-pick-open-target open-target) @@ -877,7 +870,7 @@ Complete list of currently available key bindings: (if (equal (car (process-lines notmuch-command "count" search-args)) "0") (setq search-args basic-query)) (let ((proc (notmuch-start-notmuch -"notmuch-pick" buffer #'notmuch-pick-process-sentinel +"notmuch-pick" (current-buffer) #'notmuch-pick-process-sentinel "show" "--body=false" "--format=sexp" message-arg search-args)) ;; Use a scratch buffer to accumulate partial output. @@ -910,13 +903,13 @@ The arguments are: (concat "*notmuch-pick-" query "*") (inhibit-read-only t)) -(switch-to-buffer buffer) -;; Don't track undo information for this buffer -(set 'buffer-undo-list t) +(switch-to-buffer buffer)) + ;; Don't track undo information for this buffer + (set 'buffer-undo-list t) -(notmuch-pick-worker query query-context target buffer open-target) + (notmuch-pick-worker query query-context target open-target) -(setq truncate-lines t))) + (setq truncate-lines t)) ;; Set up key bindings from the rest of notmuch. -- 1.7.9.1
[Patch v3 0/3] contrib: pick: remove an unused variable
v2 of this is at id:1377551345-27147-1-git-send-email-markwalters1009 at gmail.com This is unchanged except it is rebased on top of the series id:1377460534-6022-1-git-send-email-markwalters1009 at gmail.com so that should be applied first. The only difference is in the context of patch 1 of this series (and slight line number changes). The diff of the patches is below I will mark this as ready based on Tomi's review of v2. Best wishes Mark 1c1 < From 8d989eca9bc9bc2e65d24a10d5ce6bc04b14 Mon Sep 17 00:00:00 2001 --- > From ba60dbf7f8f3f1f92839a03400c54d769a33c724 Mon Sep 17 00:00:00 2001 17c17 < index f7caaa8..32bd6b5 100644 --- > index 8c499b0..5943ac2 100644 31c31 < @@ -590,13 +586,11 @@ message will be \"unarchived\", i.e. the tag changes in --- > @@ -586,13 +582,11 @@ message will be \"unarchived\", i.e. the tag changes in 45,47c45,47 < (defun notmuch-pick-thread-top () <(when (notmuch-pick-get-message-properties) < @@ -859,12 +853,11 @@ Complete list of currently available key bindings: --- > (defun notmuch-pick-clean-address (address) >"Try to clean a single email ADDRESS for display. Return > @@ -795,12 +789,11 @@ Complete list of currently available key bindings: 61c61 < @@ -877,7 +870,7 @@ Complete list of currently available key bindings: --- > @@ -813,7 +806,7 @@ Complete list of currently available key bindings: 70c70 < @@ -910,13 +903,13 @@ The arguments are: --- > @@ -846,13 +839,13 @@ The arguments are: Mark Walters (3): contrib: pick: remove unneeded variable notmuch-pick-buffer-name contrib: pick: add docstring for notmuch-pick-worker contrib: pick: test: refresh view contrib/notmuch-pick/notmuch-pick.el | 29 + contrib/notmuch-pick/test/emacs-pick | 11 +++ 2 files changed, 24 insertions(+), 16 deletions(-) -- 1.7.9.1
[PATCH 0/3] Adding non-maildir tags does not move message from new to cur
On Wed, 19 Dec 2012, Michal Sojka wrote: > patches in this series should supersede the patches in > id:1316039001-32602-5-git-send-email-l.rilling at av7.net. They address > the comments from Jani Nikula and add tests for the behavior that was > unintentionally changed by the previous version of the patch. Michal, sorry about not following through with the series in a timely manner. We want the feature and it looks good to me. BR, Jani.
[Patch v2 0/3] contrib: pick: remove an unused variable
On Tue, Aug 27 2013, Mark Walters wrote: > v2 of this series is at > id:1377460214-4795-1-git-send-email-markwalters1009 at gmail.com > > v2 had a bug on refresh view (which I should have tested more). The > main pick view only worked by fluke as the initial call to pick-worker > was inside a let binding. > > This version fixes the bug, moves the call to pick-worker outside the > let binding (so the bug would have shown up sooner) and also adds a > test for refresh view. > > It is also rebased on top of > id:1377547043-17584-1-git-send-email-markwalters1009 at gmail.com so that > series should be applied first. Looks Good, tests pass. +1 > > Best wishes > > Mark Tomi > > > Mark Walters (3): > contrib: pick: remove unneeded variable notmuch-pick-buffer-name > contrib: pick: add docstring for notmuch-pick-worker > contrib: pick: test: refresh view > > contrib/notmuch-pick/notmuch-pick.el | 29 + > contrib/notmuch-pick/test/emacs-pick | 11 +++ > 2 files changed, 24 insertions(+), 16 deletions(-) > > -- > 1.7.9.1 > > ___ > notmuch mailing list > notmuch at notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch > -- uussigu
[PATCH 0/4] contrib: pick: allow more general format lines
On Mon, 02 Sep 2013, Mark Walters wrote: > Currently pick makes the tree box graphics part of the "subject". This > is rather unsatisfactory: the tree graphics should be a field in their > own right. > > However, there is no mechanism in the current setup for allowing 2 > fields to have fixed combined width but variable individual > width. Thus making the tree graphics a seperate field means that we > cannot keep the current display which is > > date (12 characters) authors (20 characters) tree+subject (54 characters) tags > > We solve this by extending the format specifier. Previously this was a > list of cons cells (field-name . format-string) We now allow the > left-side (the field-name) itself to be a list of cons cells in which case we > apply the formatting recursively. > > This means we can separate the tree box graphics into their own field > while maintaining the current format. > > Note that this will mean that people who have customised the > result-format will need to update their customisation. > > The patch is larger but relatively simple. > > Patch 1/4 is unrelated except I found it while doing this update: we > consistency we should print () for messages with no tags. > > Patch 2/4 is large but trivial: it moves the insertion up a level in > preparation for the recursive formatting. > > Patch 3/4 is also simple: it just allows the recursive formatting. > > Patch 4/4 separates out the tree field. This patch is large as > it allows separate tree faces (matching and non-matching). The > "genuine code" part of the patch is relatively small. I should have added that everything works at each intermediate stage (and I think each patch makes sense incrementally): so the patches do not need to be reviewed as a batch. Best wishes Mark > > Finally, this is the last series (apart from some extra tests and > keeping up with mainline progress) that I think pick needs before it's > ready for consideration in non-contrib mainline. > > Best wishes > > Mark > > > > Mark Walters (4): > contrib: pick: print () for a message with no tags > contrib: pick: move the insertion of fields up a level > contrib: pick: allow recursive message field formats > contrib: pick: make the tree graphics a proper part of the format > > contrib/notmuch-pick/notmuch-pick.el | 93 - > 1 files changed, 67 insertions(+), 26 deletions(-) > > -- > 1.7.9.1
[PATCH 4/4] contrib: pick: make the tree graphics a proper part of the format
Previously the box graphics in the pick view were always attached to the subject. Make them a field in their own right. We use the recursive insert to change the default notmuch-pick-result-format so that the user view does not change. (The subject touches the tree box graphics but the next column (tags) is still vertically aligned.) --- contrib/notmuch-pick/notmuch-pick.el | 49 + 1 files changed, 37 insertions(+), 12 deletions(-) diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index 5dfcef3..b6f7362 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -65,13 +65,18 @@ (defcustom notmuch-pick-result-format `(("date" . "%12s ") ("authors" . "%-20s") -("subject" . " %-54s ") +((("tree" . "%s")("subject" . "%s")) ." %-54s ") ("tags" . "(%s)")) "Result formatting for Pick. Supported fields are: date, -authors, subject, tags Note: subject includes the tree -structure graphics, and the author string should not -contain whitespace (put it in the neighbouring fields -instead). For example: +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 +output of all the fields in the list is inserted +according to format-string. + +Note the author string should not contain +whitespace (put it in the neighbouring fields instead). +For example: (setq notmuch-pick-result-format \(\(\"authors\" . \"%-40s\"\) \(\"subject\" . \"%s\"\)\)\)" :type '(alist :key-type (string) :value-type (string)) @@ -108,6 +113,12 @@ :group 'notmuch-pick :group 'notmuch-faces) +(defface notmuch-pick-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 + :group 'notmuch-faces) + (defface notmuch-pick-match-tag-face 'class color) (background dark)) @@ -134,6 +145,12 @@ :group 'notmuch-pick :group 'notmuch-faces) +(defface notmuch-pick-no-match-tree-face + '((t (:foreground "gray"))) + "Face used in pick mode for the thread tree block graphics in messages matching the query." + :group 'notmuch-pick + :group 'notmuch-faces) + (defface notmuch-pick-no-match-author-face '((t (:foreground "gray"))) "Face used in pick mode for the date in messages matching the query." @@ -628,19 +645,27 @@ unchanged ADDRESS if parsing fails." (propertize (format format-string (plist-get msg :date_relative)) 'face face - ((string-equal field "subject") + ((string-equal field "tree") (let ((tree-status (plist-get msg :tree-status)) - (bare-subject (notmuch-show-strip-re (plist-get headers :Subject))) + (face (if match + 'notmuch-pick-match-tree-face + 'notmuch-pick-no-match-tree-face))) + + (setq formatted-field + (propertize (format format-string + (mapconcat #'identity (reverse tree-status) "")) + 'face face + + ((string-equal field "subject") + (let ((bare-subject (notmuch-show-strip-re (plist-get headers :Subject))) (face (if match 'notmuch-pick-match-subject-face 'notmuch-pick-no-match-subject-face))) (setq formatted-field (propertize (format format-string - (concat - (mapconcat #'identity (reverse tree-status) "") - (if (string= notmuch-pick-previous-subject bare-subject) - " ..." -bare-subject))) + (if (string= notmuch-pick-previous-subject bare-subject) + " ..." + bare-subject)) 'face face)) (setq notmuch-pick-previous-subject bare-subject))) -- 1.7.9.1
[PATCH 3/4] contrib: pick: allow recursive message field formats
Previously, the message format was fixed: each part had to be a certain width and either left or right justified. This allows the user to specify that two parts can be variable width but that combined they should be some fixed width. We do this by allowing the user to set as a "field" a list of the normal result-format form which is formatted and then itself inserted according to the format string specified. This means all existing formats work but allows more general things too. This will be used in the next patch to allow the user to specify where the tree box graphics are drawn but allow, e.g., the total width of the tree box graphics and subject to be specified. --- contrib/notmuch-pick/notmuch-pick.el | 14 -- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index f01be94..5dfcef3 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -616,6 +616,10 @@ unchanged ADDRESS if parsing fails." (match (plist-get msg :match)) formatted-field) (cond + ((listp field) + (setq formatted-field + (format format-string (notmuch-pick-format-field-list field msg + ((string-equal field "date") (let ((face (if match 'notmuch-pick-match-date-face @@ -663,13 +667,19 @@ unchanged ADDRESS if parsing fails." 'face face) formatted-field)) +(defun notmuch-pick-format-field-list (field-list msg) + "Format fields of MSG according to FIELD-LIST and return string" + (let (result-string) +(dolist (spec field-list result-string) + (let ((field-string (notmuch-pick-format-field (car spec) (cdr spec) msg))) + (setq result-string (concat result-string field-string)) + (defun notmuch-pick-insert-msg (msg) "Insert the message MSG according to notmuch-pick-result-format" ;; We need to save the previous subject as it will get overwritten ;; by the insert-field calls. (let ((previous-subject notmuch-pick-previous-subject)) -(dolist (spec notmuch-pick-result-format) - (insert (notmuch-pick-format-field (car spec) (cdr spec) msg))) +(insert (notmuch-pick-format-field-list notmuch-pick-result-format msg)) (notmuch-pick-set-message-properties msg) (notmuch-pick-set-prop :previous-subject previous-subject) (insert "\n"))) -- 1.7.9.1
[PATCH 2/4] contrib: pick: move the insertion of fields up a level
This moves the actual insertion of message fields up from the field formatting function into the message insertion function. This will be useful in the next patch as we can apply further formatting to the insertion string before inserting. --- contrib/notmuch-pick/notmuch-pick.el | 41 +++-- 1 files changed, 24 insertions(+), 17 deletions(-) diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index 063d660..f01be94 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -610,16 +610,19 @@ unchanged ADDRESS if parsing fails." ;; If we have a name return that otherwise return the address. (or p-name p-address))) -(defun notmuch-pick-insert-field (field format-string msg) +(defun notmuch-pick-format-field (field format-string msg) + "Format a FIELD of MSG according to FORMAT-STRING and return string" (let* ((headers (plist-get msg :headers)) - (match (plist-get msg :match))) + (match (plist-get msg :match)) + formatted-field) (cond ((string-equal field "date") (let ((face (if match 'notmuch-pick-match-date-face 'notmuch-pick-no-match-date-face))) - (insert (propertize (format format-string (plist-get msg :date_relative)) - 'face face + (setq formatted-field + (propertize (format format-string (plist-get msg :date_relative)) + 'face face ((string-equal field "subject") (let ((tree-status (plist-get msg :tree-status)) @@ -627,13 +630,14 @@ unchanged ADDRESS if parsing fails." (face (if match 'notmuch-pick-match-subject-face 'notmuch-pick-no-match-subject-face))) - (insert (propertize (format format-string - (concat -(mapconcat #'identity (reverse tree-status) "") -(if (string= notmuch-pick-previous-subject bare-subject) -" ..." - bare-subject))) - 'face face)) + (setq formatted-field + (propertize (format format-string + (concat + (mapconcat #'identity (reverse tree-status) "") + (if (string= notmuch-pick-previous-subject bare-subject) + " ..." +bare-subject))) + 'face face)) (setq notmuch-pick-previous-subject bare-subject))) ((string-equal field "authors") @@ -644,17 +648,20 @@ unchanged ADDRESS if parsing fails." 'notmuch-pick-no-match-author-face))) (when (> (length author) len) (setq author (substring author 0 len))) - (insert (propertize (format format-string author) - 'face face + (setq formatted-field + (propertize (format format-string author) + 'face face ((string-equal field "tags") (let ((tags (plist-get msg :tags)) (face (if match 'notmuch-pick-match-tag-face 'notmuch-pick-no-match-tag-face))) - (insert (propertize (format format-string - (mapconcat #'identity tags ", ")) - 'face face))) + (setq formatted-field + (propertize (format format-string + (mapconcat #'identity tags ", ")) + 'face face) +formatted-field)) (defun notmuch-pick-insert-msg (msg) "Insert the message MSG according to notmuch-pick-result-format" @@ -662,7 +669,7 @@ unchanged ADDRESS if parsing fails." ;; by the insert-field calls. (let ((previous-subject notmuch-pick-previous-subject)) (dolist (spec notmuch-pick-result-format) - (notmuch-pick-insert-field (car spec) (cdr spec) msg)) + (insert (notmuch-pick-format-field (car spec) (cdr spec) msg))) (notmuch-pick-set-message-properties msg) (notmuch-pick-set-prop :previous-subject previous-subject) (insert "\n"))) -- 1.7.9.1
[PATCH 1/4] contrib: pick: print () for a message with no tags
Dating back to the earliest notmuch-pick we have not printed anything for the tag field for a message with no tags. This is inconsistent with search and show both of which print "()". Change pick to be consistent. --- contrib/notmuch-pick/notmuch-pick.el |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index 37dc161..063d660 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -652,10 +652,9 @@ unchanged ADDRESS if parsing fails." (face (if match 'notmuch-pick-match-tag-face 'notmuch-pick-no-match-tag-face))) - (when tags - (insert (propertize (format format-string - (mapconcat #'identity tags ", ")) - 'face face + (insert (propertize (format format-string + (mapconcat #'identity tags ", ")) + 'face face))) (defun notmuch-pick-insert-msg (msg) "Insert the message MSG according to notmuch-pick-result-format" -- 1.7.9.1
[PATCH 0/4] contrib: pick: allow more general format lines
Currently pick makes the tree box graphics part of the "subject". This is rather unsatisfactory: the tree graphics should be a field in their own right. However, there is no mechanism in the current setup for allowing 2 fields to have fixed combined width but variable individual width. Thus making the tree graphics a seperate field means that we cannot keep the current display which is date (12 characters) authors (20 characters) tree+subject (54 characters) tags We solve this by extending the format specifier. Previously this was a list of cons cells (field-name . format-string) We now allow the left-side (the field-name) itself to be a list of cons cells in which case we apply the formatting recursively. This means we can separate the tree box graphics into their own field while maintaining the current format. Note that this will mean that people who have customised the result-format will need to update their customisation. The patch is larger but relatively simple. Patch 1/4 is unrelated except I found it while doing this update: we consistency we should print () for messages with no tags. Patch 2/4 is large but trivial: it moves the insertion up a level in preparation for the recursive formatting. Patch 3/4 is also simple: it just allows the recursive formatting. Patch 4/4 separates out the tree field. This patch is large as it allows separate tree faces (matching and non-matching). The "genuine code" part of the patch is relatively small. Finally, this is the last series (apart from some extra tests and keeping up with mainline progress) that I think pick needs before it's ready for consideration in non-contrib mainline. Best wishes Mark Mark Walters (4): contrib: pick: print () for a message with no tags contrib: pick: move the insertion of fields up a level contrib: pick: allow recursive message field formats contrib: pick: make the tree graphics a proper part of the format contrib/notmuch-pick/notmuch-pick.el | 93 - 1 files changed, 67 insertions(+), 26 deletions(-) -- 1.7.9.1
Re: [Patch v2 0/3] contrib: pick: remove an unused variable
I should have included a diff from v2: see below (obviously the test in patch 3 is also new). Best wishes Mark diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index f6710e9..5d46d42 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -812,7 +812,7 @@ Complete list of currently available key bindings: (setq search-args basic-query)) (if notmuch-pick-asynchronous-parser (let ((proc (notmuch-start-notmuch -notmuch-pick buffer #'notmuch-pick-process-sentinel +notmuch-pick (current-buffer) #'notmuch-pick-process-sentinel show --body=false --format=sexp message-arg search-args)) ;; Use a scratch buffer to accumulate partial output. @@ -853,13 +853,13 @@ The arguments are: (concat *notmuch-pick- query *) (inhibit-read-only t)) -(switch-to-buffer buffer) -;; Don't track undo information for this buffer -(set 'buffer-undo-list t) +(switch-to-buffer buffer)) + ;; Don't track undo information for this buffer + (set 'buffer-undo-list t) -(notmuch-pick-worker query query-context target open-target) + (notmuch-pick-worker query query-context target open-target) -(setq truncate-lines t))) + (setq truncate-lines t)) ;; Set up key bindings from the rest of notmuch. ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH 0/3] Adding non-maildir tags does not move message from new to cur
On Wed, 19 Dec 2012, Michal Sojka sojk...@fel.cvut.cz wrote: patches in this series should supersede the patches in id:1316039001-32602-5-git-send-email-l.rill...@av7.net. They address the comments from Jani Nikula and add tests for the behavior that was unintentionally changed by the previous version of the patch. Michal, sorry about not following through with the series in a timely manner. We want the feature and it looks good to me. BR, Jani. ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[Patch v3 1/3] contrib: pick: remove unneeded variable notmuch-pick-buffer-name
This variable is essentially unused: it was only used for making sure it itself got reset after a refresh of the buffer. It did this by passing an unnecessary argument to notmuch-pick-worker so remove that too. --- contrib/notmuch-pick/notmuch-pick.el | 25 + 1 files changed, 9 insertions(+), 16 deletions(-) diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index f7caaa8..32bd6b5 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -161,10 +161,6 @@ A buffer local copy of argument open-target to the function notmuch-pick) (make-variable-buffer-local 'notmuch-pick-open-target) -(defvar notmuch-pick-buffer-name nil - A buffer local copy of argument buffer-name to the function notmuch-pick) -(make-variable-buffer-local 'notmuch-pick-buffer-name) - (defvar notmuch-pick-message-window nil The window of the message pane. @@ -590,13 +586,11 @@ message will be \unarchived\, i.e. the tag changes in (let ((inhibit-read-only t) (basic-query notmuch-pick-basic-query) (query-context notmuch-pick-query-context) - (target (notmuch-pick-get-message-id)) - (buffer-name notmuch-pick-buffer-name)) + (target (notmuch-pick-get-message-id))) (erase-buffer) (notmuch-pick-worker basic-query query-context -target -(get-buffer buffer-name +target))) (defun notmuch-pick-thread-top () (when (notmuch-pick-get-message-properties) @@ -859,12 +853,11 @@ Complete list of currently available key bindings: (notmuch-sexp-parse-partial-list 'notmuch-pick-insert-forest-thread results-buf) -(defun notmuch-pick-worker (basic-query optional query-context target buffer open-target) +(defun notmuch-pick-worker (basic-query optional query-context target open-target) (interactive) (notmuch-pick-mode) (setq notmuch-pick-basic-query basic-query) (setq notmuch-pick-query-context query-context) - (setq notmuch-pick-buffer-name (buffer-name buffer)) (setq notmuch-pick-target-msg target) (setq notmuch-pick-open-target open-target) @@ -877,7 +870,7 @@ Complete list of currently available key bindings: (if (equal (car (process-lines notmuch-command count search-args)) 0) (setq search-args basic-query)) (let ((proc (notmuch-start-notmuch -notmuch-pick buffer #'notmuch-pick-process-sentinel +notmuch-pick (current-buffer) #'notmuch-pick-process-sentinel show --body=false --format=sexp message-arg search-args)) ;; Use a scratch buffer to accumulate partial output. @@ -910,13 +903,13 @@ The arguments are: (concat *notmuch-pick- query *) (inhibit-read-only t)) -(switch-to-buffer buffer) -;; Don't track undo information for this buffer -(set 'buffer-undo-list t) +(switch-to-buffer buffer)) + ;; Don't track undo information for this buffer + (set 'buffer-undo-list t) -(notmuch-pick-worker query query-context target buffer open-target) + (notmuch-pick-worker query query-context target open-target) -(setq truncate-lines t))) + (setq truncate-lines t)) ;; Set up key bindings from the rest of notmuch. -- 1.7.9.1 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[Patch v3 2/3] contrib: pick: add docstring for notmuch-pick-worker
--- contrib/notmuch-pick/notmuch-pick.el |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index 32bd6b5..5dcc942 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -854,6 +854,10 @@ Complete list of currently available key bindings: results-buf) (defun notmuch-pick-worker (basic-query optional query-context target open-target) + Insert the actual pick search in the current buffer. + +This is is a helper function for notmuch-pick. The arguments are +the same as for the function notmuch-pick. (interactive) (notmuch-pick-mode) (setq notmuch-pick-basic-query basic-query) -- 1.7.9.1 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[Patch v3 0/3] contrib: pick: remove an unused variable
v2 of this is at id:1377551345-27147-1-git-send-email-markwalters1...@gmail.com This is unchanged except it is rebased on top of the series id:1377460534-6022-1-git-send-email-markwalters1...@gmail.com so that should be applied first. The only difference is in the context of patch 1 of this series (and slight line number changes). The diff of the patches is below I will mark this as ready based on Tomi's review of v2. Best wishes Mark 1c1 From 8d989eca9bc9bc2e65d24a10d5ce6bc04b14 Mon Sep 17 00:00:00 2001 --- From ba60dbf7f8f3f1f92839a03400c54d769a33c724 Mon Sep 17 00:00:00 2001 17c17 index f7caaa8..32bd6b5 100644 --- index 8c499b0..5943ac2 100644 31c31 @@ -590,13 +586,11 @@ message will be \unarchived\, i.e. the tag changes in --- @@ -586,13 +582,11 @@ message will be \unarchived\, i.e. the tag changes in 45,47c45,47 (defun notmuch-pick-thread-top () (when (notmuch-pick-get-message-properties) @@ -859,12 +853,11 @@ Complete list of currently available key bindings: --- (defun notmuch-pick-clean-address (address) Try to clean a single email ADDRESS for display. Return @@ -795,12 +789,11 @@ Complete list of currently available key bindings: 61c61 @@ -877,7 +870,7 @@ Complete list of currently available key bindings: --- @@ -813,7 +806,7 @@ Complete list of currently available key bindings: 70c70 @@ -910,13 +903,13 @@ The arguments are: --- @@ -846,13 +839,13 @@ The arguments are: Mark Walters (3): contrib: pick: remove unneeded variable notmuch-pick-buffer-name contrib: pick: add docstring for notmuch-pick-worker contrib: pick: test: refresh view contrib/notmuch-pick/notmuch-pick.el | 29 + contrib/notmuch-pick/test/emacs-pick | 11 +++ 2 files changed, 24 insertions(+), 16 deletions(-) -- 1.7.9.1 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[Patch v3 3/3] contrib: pick: test: refresh view
A recent proposed patch was buggy when refreshing the view. Add a test for refresh so that this does not reoccur. --- contrib/notmuch-pick/test/emacs-pick | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/contrib/notmuch-pick/test/emacs-pick b/contrib/notmuch-pick/test/emacs-pick index eed5f02..37f974a 100755 --- a/contrib/notmuch-pick/test/emacs-pick +++ b/contrib/notmuch-pick/test/emacs-pick @@ -23,6 +23,17 @@ test_emacs '(add-to-list (quote load-path) '$PICK_DIR') (delete-other-windows)' test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox +test_begin_subtest Refreshed notmuch-pick view in emacs +test_emacs '(add-to-list (quote load-path) '$PICK_DIR') + (require (quote notmuch-pick)) + (notmuch-pick tag:inbox) + (notmuch-test-wait) + (notmuch-pick-refresh-view) + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox + test_begin_subtest Navigation of notmuch-hello to search results test_emacs '(notmuch-hello) (goto-char (point-min)) -- 1.7.9.1 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH] test: update insert tests for new maildir synchronization rules
From: David Bremner brem...@debian.org As of id:1355952747-27350-4-git-send-email-sojk...@fel.cvut.cz we are more conservative about moving messages from ./new to ./cur. This updates the insert tests to match --- Hopefully this makes sense, and is not just papering over a real problem that should be fixed. test/insert | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/insert b/test/insert index 021edb6..1718120 100755 --- a/test/insert +++ b/test/insert @@ -82,7 +82,7 @@ gen_insert_msg notmuch insert --folder=Drafts $gen_msg_filename output=$(notmuch search --output=files folder:Drafts) dirname=$(dirname $output) -test_expect_equal $dirname $MAIL_DIR/Drafts/cur +test_expect_equal $dirname $MAIL_DIR/Drafts/new test_begin_subtest Insert message into folder, add/remove tags gen_insert_msg @@ -99,14 +99,14 @@ gen_insert_msg notmuch insert --folder=F --create-folder +folder $gen_msg_filename output=$(notmuch search --output=files folder:F tag:folder) basename=$(basename $output) -test_expect_equal_file $gen_msg_filename $MAIL_DIR/F/cur/${basename} +test_expect_equal_file $gen_msg_filename $MAIL_DIR/F/new/${basename} test_begin_subtest Insert message, create subfolder gen_insert_msg notmuch insert --folder=F/G/H/I/J --create-folder +folder $gen_msg_filename output=$(notmuch search --output=files folder:F/G/H/I/J tag:folder) basename=$(basename $output) -test_expect_equal_file $gen_msg_filename ${MAIL_DIR}/F/G/H/I/J/cur/${basename} +test_expect_equal_file $gen_msg_filename ${MAIL_DIR}/F/G/H/I/J/new/${basename} test_begin_subtest Insert message, create existing subfolder gen_insert_msg -- 1.8.3.2 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH 2/2] test: improve insert test reliability by checking message-id instead of count
There isn't a reported issue this would fix. Spotted by reading the test. --- test/insert | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/insert b/test/insert index 9b448e5..550b413 100755 --- a/test/insert +++ b/test/insert @@ -68,14 +68,14 @@ test_expect_equal_json $output '[inbox, unread]' test_begin_subtest Insert message, add tag gen_insert_msg notmuch insert +custom $gen_msg_filename -output=$(notmuch count tag:custom) -test_expect_equal $output 1 +output=$(notmuch search --output=messages tag:custom) +test_expect_equal $output id:$gen_msg_id test_begin_subtest Insert message, add/remove tags gen_insert_msg notmuch insert +custom -unread $gen_msg_filename -output=$(notmuch count tag:custom NOT tag:unread) -test_expect_equal $output 1 +output=$(notmuch search --output=messages tag:custom NOT tag:unread) +test_expect_equal $output id:$gen_msg_id test_begin_subtest Insert message with default tags stays in new/ gen_insert_msg @@ -123,8 +123,8 @@ test_expect_equal $dirname $MAIL_DIR/Drafts/new test_begin_subtest Insert message into folder, add/remove tags gen_insert_msg notmuch insert --folder=Drafts +draft -unread $gen_msg_filename -output=$(notmuch count folder:Drafts tag:draft NOT tag:unread) -test_expect_equal $output 1 +output=$(notmuch search --output=messages folder:Drafts tag:draft NOT tag:unread) +test_expect_equal $output id:$gen_msg_id gen_insert_msg test_expect_code 1 Insert message into non-existent folder \ -- 1.8.4.rc3 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH 1/2] test: add more maildir flag syncing related tests to insert
Specifically test maildir flag syncing with insert. --- These are additional tests on top of David's fix. --- test/insert | 36 1 file changed, 36 insertions(+) diff --git a/test/insert b/test/insert index 1718120..9b448e5 100755 --- a/test/insert +++ b/test/insert @@ -77,6 +77,42 @@ notmuch insert +custom -unread $gen_msg_filename output=$(notmuch count tag:custom NOT tag:unread) test_expect_equal $output 1 +test_begin_subtest Insert message with default tags stays in new/ +gen_insert_msg +notmuch insert $gen_msg_filename +output=$(notmuch search --output=files id:$gen_msg_id) +dirname=$(dirname $output) +test_expect_equal $dirname $MAIL_DIR/new + +test_begin_subtest Insert message with non-maildir synced tags stays in new/ +gen_insert_msg +notmuch insert +custom -inbox $gen_msg_filename +output=$(notmuch search --output=files id:$gen_msg_id) +dirname=$(dirname $output) +test_expect_equal $dirname $MAIL_DIR/new + +test_begin_subtest Insert message with custom new.tags goes to cur/ +OLDCONFIG=$(notmuch config get new.tags) +notmuch config set new.tags test +gen_insert_msg +notmuch insert $gen_msg_filename +output=$(notmuch search --output=files id:$gen_msg_id) +dirname=$(dirname $output) +notmuch config set new.tags $OLDCONFIG +test_expect_equal $dirname $MAIL_DIR/cur + +# additional check on the previous message +test_begin_subtest Insert message with custom new.tags actually gets the tags +output=$(notmuch search --output=tags id:$gen_msg_id) +test_expect_equal $output test + +test_begin_subtest Insert message with maildir synced tags goes to cur/ +gen_insert_msg +notmuch insert +flagged $gen_msg_filename +output=$(notmuch search --output=files id:$gen_msg_id) +dirname=$(dirname $output) +test_expect_equal $dirname $MAIL_DIR/cur + test_begin_subtest Insert message into folder gen_insert_msg notmuch insert --folder=Drafts $gen_msg_filename -- 1.8.4.rc3 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH] test: update insert tests for new maildir synchronization rules
On Tue, 03 Sep 2013, da...@tethera.net wrote: From: David Bremner brem...@debian.org As of id:1355952747-27350-4-git-send-email-sojk...@fel.cvut.cz we are more conservative about moving messages from ./new to ./cur. This updates the insert tests to match --- Hopefully this makes sense, and is not just papering over a real problem that should be fixed. LGTM. I sent some additional tests on top. Jani. test/insert | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/insert b/test/insert index 021edb6..1718120 100755 --- a/test/insert +++ b/test/insert @@ -82,7 +82,7 @@ gen_insert_msg notmuch insert --folder=Drafts $gen_msg_filename output=$(notmuch search --output=files folder:Drafts) dirname=$(dirname $output) -test_expect_equal $dirname $MAIL_DIR/Drafts/cur +test_expect_equal $dirname $MAIL_DIR/Drafts/new test_begin_subtest Insert message into folder, add/remove tags gen_insert_msg @@ -99,14 +99,14 @@ gen_insert_msg notmuch insert --folder=F --create-folder +folder $gen_msg_filename output=$(notmuch search --output=files folder:F tag:folder) basename=$(basename $output) -test_expect_equal_file $gen_msg_filename $MAIL_DIR/F/cur/${basename} +test_expect_equal_file $gen_msg_filename $MAIL_DIR/F/new/${basename} test_begin_subtest Insert message, create subfolder gen_insert_msg notmuch insert --folder=F/G/H/I/J --create-folder +folder $gen_msg_filename output=$(notmuch search --output=files folder:F/G/H/I/J tag:folder) basename=$(basename $output) -test_expect_equal_file $gen_msg_filename ${MAIL_DIR}/F/G/H/I/J/cur/${basename} +test_expect_equal_file $gen_msg_filename ${MAIL_DIR}/F/G/H/I/J/new/${basename} test_begin_subtest Insert message, create existing subfolder gen_insert_msg -- 1.8.3.2 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch -- Jani ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch