From cd89065dc36e36b22a2a53832d2cac9b06fba41c Mon Sep 17 00:00:00 2001 From: Mohsin Kaleem Date: Sun, 10 Mar 2024 18:57:41 +0000 Subject: [PATCH 1/9] emacs: Add new option notmuch-search-hide-excluded The new notmuch-search-hide-excluded option allows users to configure whether to show or hide excluded messages (as determined by search.exclude_tags in the local notmuch config file). It defaults to true for now to maintain backwards-compatibility with how notmuch-{search,tree} already worked. New commands notmuch-search-toggle-hide-excluded and notmuch-tree-toggle-exclude have also been added. They toggle the value of notmuch-search-hide-excluded for the search in the current search or tree buffer. It's bound to "i" in the respective keymaps for these modes. Lastly I've amended some calls to notmuch-tree and notmuch-unthreaded which didn't pass through the buffer local value of notmuch-search-oldest-first (and now notmuch-search-exclude). Examples of where I've done this include: + notmuch-jump-search + notmuch-tree-from-search-current-query + notmuch-unthreaded-from-search-current-query + notmuch-tree-from-search-thread A new test file for Emacs has been added which covers the usage of the new `notmuch-search-hide-excluded' option and interactively hiding or showing mail with excluded tags. These test cover the basic usage of the `notmuch-search-toggle-hide-excluded' command in notmuch-search, notmuch-tree and notmuch-unthreaded searches. These tests also cover the persistence of the current value of the hide-excluded mail option as a user switches from between these different search commands. [1]: id:87ilxlxsng.fsf@kisara.moe Amended-by: db, fix indentation in T461-emacs-search-exclude.sh --- devel/emacs-keybindings.org | 2 +- doc/notmuch-emacs.rst | 7 + emacs/notmuch-hello.el | 40 ++-- emacs/notmuch-jump.el | 14 +- emacs/notmuch-lib.el | 10 + emacs/notmuch-tree.el | 60 ++++-- emacs/notmuch.el | 52 +++-- test/T310-emacs.sh | 2 +- test/T460-emacs-tree.sh | 2 +- test/T461-emacs-search-exclude.sh | 185 ++++++++++++++++++ .../notmuch-search-tag-inbox-with-excluded | 25 +++ .../notmuch-search-tag-inbox-without-excluded | 21 ++ .../notmuch-tree-tag-inbox-with-excluded | 53 +++++ .../notmuch-tree-tag-inbox-without-excluded | 49 +++++ ...notmuch-unthreaded-tag-inbox-with-excluded | 53 +++++ ...much-unthreaded-tag-inbox-without-excluded | 49 +++++ .../notmuch-tree-tag-inbox-oldest-first | 53 +++++ 17 files changed, 632 insertions(+), 45 deletions(-) create mode 100755 test/T461-emacs-search-exclude.sh create mode 100644 test/emacs-exclude.expected-output/notmuch-search-tag-inbox-with-excluded create mode 100644 test/emacs-exclude.expected-output/notmuch-search-tag-inbox-without-excluded create mode 100644 test/emacs-exclude.expected-output/notmuch-tree-tag-inbox-with-excluded create mode 100644 test/emacs-exclude.expected-output/notmuch-tree-tag-inbox-without-excluded create mode 100644 test/emacs-exclude.expected-output/notmuch-unthreaded-tag-inbox-with-excluded create mode 100644 test/emacs-exclude.expected-output/notmuch-unthreaded-tag-inbox-without-excluded create mode 100644 test/emacs-tree.expected-output/notmuch-tree-tag-inbox-oldest-first diff --git a/devel/emacs-keybindings.org b/devel/emacs-keybindings.org index ad7f72ef..218677c2 100644 --- a/devel/emacs-keybindings.org +++ b/devel/emacs-keybindings.org @@ -9,7 +9,7 @@ | f | | notmuch-show-forward-message | notmuch-show-forward-message | | g | | | | | h | | notmuch-show-toggle-visibility-headers | | -| i | | | | +| i | notmuch-search-toggle-hide-excluded | | notmuch-tree-toggle-hide-excluded | | j | notmuch-jump-search | notmuch-jump-search | notmuch-jump-search | | k | notmuch-tag-jump | notmuch-tag-jump | notmuch-tag-jump | | l | notmuch-search-filter | notmuch-show-filter-thread | notmuch-tree-filter | diff --git a/doc/notmuch-emacs.rst b/doc/notmuch-emacs.rst index 7dff7d64..91af6d14 100644 --- a/doc/notmuch-emacs.rst +++ b/doc/notmuch-emacs.rst @@ -232,6 +232,10 @@ menu of results that the user can explore further by pressing Refresh the buffer +.. el:define-key:: i + + Toggle whether to show messages with excluded tags in search results. + .. el:define-key:: ? Display full set of key bindings @@ -559,6 +563,9 @@ tags. Filter the current search results based on an additional tag +.. el:define-key:: i + + Toggle whether to show messages with excluded tags in search results. .. el:define-key:: g = diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 47ece536..b6d1e2ae 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -33,10 +33,11 @@ (declare-function notmuch-poll "notmuch-lib" ()) (declare-function notmuch-tree "notmuch-tree" (&optional query query-context target buffer-name - open-target unthreaded parent-buffer oldest-first)) + open-target unthreaded parent-buffer + oldest-first hide-excluded)) (declare-function notmuch-unthreaded "notmuch-tree" (&optional query query-context target buffer-name - open-target)) + open-target oldest-first hide-excluded)) ;;; Options @@ -143,6 +144,10 @@ a plist. Supported properties are :sort-order Specify the sort order to be used for the search. Possible values are `oldest-first', `newest-first' or nil. Nil means use the default sort order. + :excluded Whether to show mail with excluded tags in the + search. Possible values are `hide', `show', + or nil. Nil means use the default value of + `notmuch-search-hide-excluded'. :search-type Specify whether to run the search in search-mode, tree mode or unthreaded mode. Set to `tree' to specify tree mode, \\='unthreaded to specify @@ -484,19 +489,19 @@ diagonal." append (notmuch-hello-reflect-generate-row ncols nrows row list)))) (defun notmuch-hello-widget-search (widget &rest _ignore) - (cl-case (widget-get widget :notmuch-search-type) - (tree - (let ((n (notmuch-search-format-buffer-name (widget-value widget) "tree" t))) - (notmuch-tree (widget-get widget :notmuch-search-terms) - nil nil n nil nil nil - (widget-get widget :notmuch-search-oldest-first)))) - (unthreaded - (let ((n (notmuch-search-format-buffer-name (widget-value widget) - "unthreaded" t))) - (notmuch-unthreaded (widget-get widget :notmuch-search-terms) nil nil n))) - (t - (notmuch-search (widget-get widget :notmuch-search-terms) - (widget-get widget :notmuch-search-oldest-first))))) + (let ((search-terms (widget-get widget :notmuch-search-terms)) + (oldest-first (widget-get widget :notmuch-search-oldest-first)) + (exclude (widget-get widget :notmuch-search-hide-excluded))) + (cl-case (widget-get widget :notmuch-search-type) + (tree + (let ((n (notmuch-search-format-buffer-name (widget-value widget) "tree" t))) + (notmuch-tree search-terms nil nil n nil nil nil oldest-first exclude))) + (unthreaded + (let ((n (notmuch-search-format-buffer-name (widget-value widget) + "unthreaded" t))) + (notmuch-unthreaded search-terms nil nil n nil oldest-first exclude))) + (t + (notmuch-search search-terms oldest-first exclude))))) (defun notmuch-saved-search-count (search) (car (notmuch--process-lines notmuch-command "count" search))) @@ -643,6 +648,10 @@ with `notmuch-hello-query-counts'." (newest-first nil) (oldest-first t) (otherwise notmuch-search-oldest-first))) + (exclude (cl-case (plist-get elem :excluded) + (hide t) + (show nil) + (otherwise notmuch-search-hide-excluded))) (search-type (plist-get elem :search-type)) (msg-count (plist-get elem :count))) (widget-insert (format "%8s " @@ -652,6 +661,7 @@ with `notmuch-hello-query-counts'." :notmuch-search-terms query :notmuch-search-oldest-first oldest-first :notmuch-search-type search-type + :notmuch-search-hide-excluded exclude name) (setq column-indent (1+ (max 0 (- column-width (length name))))))) diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el index 6a276928..3161ed95 100644 --- a/emacs/notmuch-jump.el +++ b/emacs/notmuch-jump.el @@ -50,15 +50,21 @@ fast way to jump to a saved search from anywhere in Notmuch." (cl-case (plist-get saved-search :sort-order) (newest-first nil) (oldest-first t) - (otherwise (default-value 'notmuch-search-oldest-first))))) + (otherwise (default-value 'notmuch-search-oldest-first)))) + (exclude (cl-case (plist-get saved-search :excluded) + (hide t) + (show nil) + (otherwise notmuch-search-hide-excluded)))) (push (list key name (cond ((eq (plist-get saved-search :search-type) 'tree) - (lambda () (notmuch-tree query))) + (lambda () (notmuch-tree query nil nil nil nil nil nil + oldest-first exclude))) ((eq (plist-get saved-search :search-type) 'unthreaded) - (lambda () (notmuch-unthreaded query))) + (lambda () (notmuch-unthreaded query nil nil nil nil + oldest-first exclude))) (t - (lambda () (notmuch-search query oldest-first))))) + (lambda () (notmuch-search query oldest-first exclude))))) action-map))))) (setq action-map (nreverse action-map)) (if action-map diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 14469a90..bf9c4a53 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -105,6 +105,16 @@ search." :group 'notmuch-search) (make-variable-buffer-local 'notmuch-search-oldest-first) +(defcustom notmuch-search-hide-excluded t + "Hide mail tagged with a excluded tag. + +Excluded tags are defined in the users configuration file under +the search section. When this variable is true, any mail with +such a tag will not be shown in the search output." + :type 'boolean + :group 'notmuch-search) +(make-variable-buffer-local 'notmuch-search-hide-excluded) + (defcustom notmuch-poll-script nil "[Deprecated] Command to run to incorporate new mail into the notmuch database. diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el index 718a3879..faec89c4 100644 --- a/emacs/notmuch-tree.el +++ b/emacs/notmuch-tree.el @@ -374,6 +374,7 @@ then NAME behaves like CMD." (define-key map [remap notmuch-jump-search] 'notmuch-tree-jump-search) (define-key map "o" 'notmuch-tree-toggle-order) + (define-key map "i" 'notmuch-tree-toggle-hide-excluded) (define-key map "S" 'notmuch-search-from-tree-current-query) (define-key map "U" 'notmuch-unthreaded-from-tree-current-query) (define-key map "Z" 'notmuch-tree-from-unthreaded-current-query) @@ -590,7 +591,9 @@ NOT change the database." "Call notmuch search with the current query." (interactive) (notmuch-tree-close-message-window) - (notmuch-search (notmuch-tree-get-query))) + (notmuch-search (notmuch-tree-get-query) + notmuch-search-oldest-first + notmuch-search-hide-excluded)) (defun notmuch-tree-message-window-kill-hook () "Close the message pane when exiting the show buffer." @@ -803,7 +806,8 @@ nil otherwise." target nil unthreaded - notmuch-search-oldest-first))) + notmuch-search-oldest-first + notmuch-search-hide-excluded))) (defun notmuch-tree-thread-top () (when (notmuch-tree-get-message-properties) @@ -1133,7 +1137,8 @@ object, and with the tree results buffer as the current buffer.") results-buf))))) (defun notmuch-tree-worker (basic-query &optional query-context target - open-target unthreaded oldest-first) + open-target unthreaded oldest-first + exclude) "Insert the tree view of the search in the current buffer. This is is a helper function for notmuch-tree. The arguments are @@ -1142,6 +1147,7 @@ the same as for the function notmuch-tree." (notmuch-tree-mode) (add-hook 'post-command-hook #'notmuch-tree-command-hook t t) (setq notmuch-search-oldest-first oldest-first) + (setq notmuch-search-hide-excluded exclude) (setq notmuch-tree-unthreaded unthreaded) (setq notmuch-tree-basic-query basic-query) (setq notmuch-tree-query-context (if (or (string= query-context "") @@ -1161,14 +1167,15 @@ the same as for the function notmuch-tree." (and query-context (concat " and (" query-context ")")))) (sort-arg (if oldest-first "--sort=oldest-first" "--sort=newest-first")) - (message-arg (if unthreaded "--unthreaded" "--entire-thread"))) + (message-arg (if unthreaded "--unthreaded" "--entire-thread")) + (exclude-arg (if exclude "--exclude=true" "--exclude=false"))) (when (equal (car (notmuch--process-lines notmuch-command "count" search-args)) "0") (setq search-args basic-query)) (notmuch-tag-clear-cache) (let ((proc (notmuch-start-notmuch "notmuch-tree" (current-buffer) #'notmuch-tree-process-sentinel "show" "--body=false" "--format=sexp" "--format-version=5" - sort-arg message-arg search-args)) + sort-arg message-arg exclude-arg search-args)) ;; Use a scratch buffer to accumulate partial output. ;; This buffer will be killed by the sentinel, which ;; should be called no matter how the process dies. @@ -1195,9 +1202,19 @@ default sort order is defined by `notmuch-search-oldest-first'." (setq notmuch-search-oldest-first (not notmuch-search-oldest-first)) (notmuch-tree-refresh-view)) +(defun notmuch-tree-toggle-hide-excluded () + "Toggle whether to hide excluded messages. + +This command toggles whether to hide excluded messages for the current +search. The default value for this is defined by `notmuch-search-hide-excluded'." + (interactive) + (setq notmuch-search-hide-excluded (not notmuch-search-hide-excluded)) + (notmuch-tree-refresh-view)) + ;;;###autoload (defun notmuch-tree (&optional query query-context target buffer-name - open-target unthreaded parent-buffer oldest-first) + open-target unthreaded parent-buffer + oldest-first hide-excluded) "Display threads matching QUERY in tree view. The arguments are: @@ -1212,7 +1229,15 @@ The arguments are: it is nil \"*notmuch-tree\" followed by QUERY is used. OPEN-TARGET: If TRUE open the target message in the message pane. UNTHREADED: If TRUE only show matching messages in an unthreaded view." - (interactive) + (interactive + (list + ;; Prompt for a query + nil + ;; Fill other args with nil. + nil nil nil nil nil nil + ;; Populate these from the default value of these options. + (default-value 'notmuch-search-oldest-first) + (default-value 'notmuch-search-hide-excluded))) (unless query (setq query (notmuch-read-query (concat "Notmuch " (if unthreaded "unthreaded " "tree ") @@ -1226,17 +1251,27 @@ The arguments are: (pop-to-buffer-same-window buffer)) ;; Don't track undo information for this buffer (setq buffer-undo-list t) - (notmuch-tree-worker query query-context target open-target unthreaded oldest-first) + (notmuch-tree-worker query query-context target open-target + unthreaded oldest-first hide-excluded) (setq notmuch-tree-parent-buffer parent-buffer) (setq truncate-lines t)) (defun notmuch-unthreaded (&optional query query-context target buffer-name - open-target) + open-target oldest-first hide-excluded) "Display threads matching QUERY in unthreaded view. See function NOTMUCH-TREE for documentation of the arguments" - (interactive) - (notmuch-tree query query-context target buffer-name open-target t)) + (interactive + (list + ;; Prompt for a query + nil + ;; Fill other args with nil. + nil nil nil nil + ;; Populate these from the default value of these options. + (default-value 'notmuch-search-oldest-first) + (default-value 'notmuch-search-hide-excluded))) + (notmuch-tree query query-context target buffer-name open-target + t nil oldest-first hide-excluded)) (defun notmuch-tree-filter (query) "Filter or LIMIT the current search results based on an additional query string. @@ -1270,7 +1305,8 @@ search results and that are also tagged with the given TAG." nil notmuch-tree-unthreaded nil - notmuch-search-oldest-first))) + notmuch-search-oldest-first + notmuch-search-hide-excluded))) (defun notmuch-tree-edit-search (query) "Edit the current search" diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 6eef4af1..2a73ffa5 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -187,6 +187,7 @@ there will be called at other points of notmuch execution." (define-key map "r" 'notmuch-search-reply-to-thread-sender) (define-key map "R" 'notmuch-search-reply-to-thread) (define-key map "o" 'notmuch-search-toggle-order) + (define-key map "i" 'notmuch-search-toggle-hide-excluded) (define-key map "c" 'notmuch-search-stash-map) (define-key map "t" 'notmuch-search-filter-by-tag) (define-key map "l" 'notmuch-search-filter) @@ -550,12 +551,18 @@ Return non-nil on success." (defun notmuch-tree-from-search-current-query () "Tree view of current query." (interactive) - (notmuch-tree notmuch-search-query-string)) + (notmuch-tree notmuch-search-query-string + nil nil nil nil nil nil + notmuch-search-oldest-first + notmuch-search-hide-excluded)) (defun notmuch-unthreaded-from-search-current-query () "Unthreaded view of current query." (interactive) - (notmuch-unthreaded notmuch-search-query-string)) + (notmuch-unthreaded notmuch-search-query-string + nil nil nil nil + notmuch-search-oldest-first + notmuch-search-hide-excluded)) (defun notmuch-tree-from-search-thread () "Show the selected thread with notmuch-tree." @@ -564,7 +571,9 @@ Return non-nil on success." notmuch-search-query-string nil (notmuch-prettify-subject (notmuch-search-find-subject)) - t nil (current-buffer))) + t nil (current-buffer) + notmuch-search-oldest-first + notmuch-search-hide-excluded)) (defun notmuch-search-reply-to-thread (&optional prompt-for-sender) "Begin composing a reply-all to the entire current thread in a new buffer." @@ -1035,14 +1044,16 @@ PROMPT is the string to prompt with." (put 'notmuch-search 'notmuch-doc "Search for messages.") ;;;###autoload -(defun notmuch-search (&optional query oldest-first target-thread target-line - no-display) +(defun notmuch-search (&optional query oldest-first hide-excluded target-thread + target-line no-display) "Display threads matching QUERY in a notmuch-search buffer. If QUERY is nil, it is read interactively from the minibuffer. Other optional parameters are used as follows: OLDEST-FIRST: A Boolean controlling the sort order of returned threads + HIDE-EXCLUDED: A boolean controlling whether to omit threads with excluded + tags. TARGET-THREAD: A thread ID (without the thread: prefix) that will be made current if it appears in the search results. TARGET-LINE: The line number to move to if the target thread does not @@ -1057,9 +1068,10 @@ the configured default sort order." (list ;; Prompt for a query nil - ;; Use the default search order (if we're doing a search from a - ;; search buffer, ignore any buffer-local overrides) - (default-value 'notmuch-search-oldest-first))) + ;; Use the default search order and exclude value (if we're doing a + ;; search from a search buffer, ignore any buffer-local overrides) + (default-value 'notmuch-search-oldest-first) + (default-value 'notmuch-search-hide-excluded))) (let* ((query (or query (notmuch-read-query "Notmuch search: "))) (buffer (get-buffer-create (notmuch-search-buffer-title query)))) @@ -1073,6 +1085,7 @@ the configured default sort order." (setq notmuch-search-oldest-first oldest-first) (setq notmuch-search-target-thread target-thread) (setq notmuch-search-target-line target-line) + (setq notmuch-search-hide-excluded hide-excluded) (notmuch-tag-clear-cache) (when (get-buffer-process buffer) (error "notmuch search process already running for query `%s'" query)) @@ -1086,6 +1099,9 @@ the configured default sort order." (if oldest-first "--sort=oldest-first" "--sort=newest-first") + (if hide-excluded + "--exclude=true" + "--exclude=false") query))) ;; Use a scratch buffer to accumulate partial output. ;; This buffer will be killed by the sentinel, which @@ -1106,11 +1122,21 @@ same relative position within the new buffer." (interactive) (notmuch-search notmuch-search-query-string notmuch-search-oldest-first + notmuch-search-hide-excluded (notmuch-search-find-thread-id 'bare) (line-number-at-pos) t) (goto-char (point-min))) +(defun notmuch-search-toggle-hide-excluded () + "Toggle whether to hide excluded messages. + +This command toggles whether to hide excluded messages for the current +search. The default value for this is defined by `notmuch-search-hide-excluded'." + (interactive) + (setq notmuch-search-hide-excluded (not notmuch-search-hide-excluded)) + (notmuch-search-refresh-view)) + (defun notmuch-search-toggle-order () "Toggle the current search order. @@ -1139,7 +1165,8 @@ current search results AND the additional query string provided." (notmuch-search (if (string= grouped-original-query "*") grouped-query (concat grouped-original-query " and " grouped-query)) - notmuch-search-oldest-first))) + notmuch-search-oldest-first + notmuch-search-hide-excluded))) (defun notmuch-search-filter-by-tag (tag) "Filter the current search results based on a single TAG. @@ -1150,13 +1177,16 @@ search results and that are also tagged with the given TAG." (list (notmuch-select-tag-with-completion "Filter by tag: " notmuch-search-query-string))) (notmuch-search (concat notmuch-search-query-string " and tag:" tag) - notmuch-search-oldest-first)) + notmuch-search-oldest-first + notmuch-search-hide-excluded)) (defun notmuch-search-by-tag (tag) "Display threads matching TAG in a notmuch-search buffer." (interactive (list (notmuch-select-tag-with-completion "Notmuch search tag: "))) - (notmuch-search (concat "tag:" tag))) + (notmuch-search (concat "tag:" tag) + (default-value 'notmuch-search-oldest-first) + (default-value 'notmuch-search-hide-excluded))) (defun notmuch-search-edit-search (query) "Edit the current search" diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh index d3aa2e7d..e96c1601 100755 --- a/test/T310-emacs.sh +++ b/test/T310-emacs.sh @@ -1032,7 +1032,7 @@ End of search results. YYY/notmuch_fail exited with status 1 (see *Notmuch errors* for more details) === ERROR === YYY/notmuch_fail exited with status 1 -command: YYY/notmuch_fail search --format\=sexp --format-version\=5 --sort\=newest-first tag\:inbox +command: YYY/notmuch_fail search --format\=sexp --format-version\=5 --sort\=newest-first --exclude\=false tag\:inbox exit status: 1" test_begin_subtest "Search handles subprocess warnings" diff --git a/test/T460-emacs-tree.sh b/test/T460-emacs-tree.sh index 8e071443..6ef5c54a 100755 --- a/test/T460-emacs-tree.sh +++ b/test/T460-emacs-tree.sh @@ -100,7 +100,7 @@ test_emacs '(notmuch-hello) (notmuch-test-wait) (test-output) (delete-other-windows)' -test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox OUTPUT +test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox-oldest-first OUTPUT test_begin_subtest "Tree view of a single thread (from search)" test_emacs '(notmuch-hello) diff --git a/test/T461-emacs-search-exclude.sh b/test/T461-emacs-search-exclude.sh new file mode 100755 index 00000000..47f74682 --- /dev/null +++ b/test/T461-emacs-search-exclude.sh @@ -0,0 +1,185 @@ +#!/usr/bin/env bash + +test_description="exclude options persist between Emacs search and tree modes" +. $(dirname "$0")/test-lib.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 + +EXPECTED=$NOTMUCH_SRCDIR/test/emacs-exclude.expected-output + +test_require_emacs +add_email_corpus +notmuch config set search.exclude_tags deleted +notmuch tag +deleted -- 'from:"Stewart Smith"' or 'from:"Chris Wilson"' + +# Basic test cases just asserting exclude option is working and consistent. + +test_begin_subtest "Search doesn't contain excluded mail by default" +test_emacs '(notmuch-hello) + (goto-char (point-min)) + (re-search-forward "inbox") + (widget-button-press (1- (point))) + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-search-tag-inbox-without-excluded OUTPUT + +test_begin_subtest "Toggling exclude in search will show excluded mail" +test_emacs '(notmuch-hello) + (goto-char (point-min)) + (re-search-forward "inbox") + (widget-button-press (1- (point))) + (notmuch-test-wait) + (notmuch-search-toggle-hide-excluded) + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-search-tag-inbox-with-excluded OUTPUT + +test_begin_subtest "Tree search doesn't contain excluded mail by default" +test_emacs '(notmuch-hello) + (goto-char (point-min)) + (re-search-forward "inbox") + (widget-button-press (1- (point))) + (notmuch-test-wait) + (notmuch-tree-from-search-current-query) + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox-without-excluded OUTPUT + +test_begin_subtest "Toggling exclude in tree search will show excluded mail" +test_emacs '(notmuch-hello) + (goto-char (point-min)) + (re-search-forward "inbox") + (widget-button-press (1- (point))) + (notmuch-test-wait) + (notmuch-tree-from-search-current-query) + (notmuch-test-wait) + (notmuch-tree-toggle-hide-excluded) + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox-with-excluded OUTPUT + +test_begin_subtest "Unthreaded search doesn't contain excluded mail by default" +test_emacs '(notmuch-hello) + (goto-char (point-min)) + (re-search-forward "inbox") + (widget-button-press (1- (point))) + (notmuch-test-wait) + (notmuch-unthreaded-from-search-current-query) + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-unthreaded-tag-inbox-without-excluded OUTPUT + +test_begin_subtest "Toggling exclude in unthreaded will show excluded mail" +test_emacs '(notmuch-hello) + (goto-char (point-min)) + (re-search-forward "inbox") + (widget-button-press (1- (point))) + (notmuch-test-wait) + (notmuch-unthreaded-from-search-current-query) + (notmuch-test-wait) + (notmuch-tree-toggle-hide-excluded) + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-unthreaded-tag-inbox-with-excluded OUTPUT + +# Cycling from search to tree to unthreaded and vice versa will persist the current +# value of notmuch-search-hide-excluded. + +test_begin_subtest "Value of hide-excluded from search persists into tree search" +test_emacs '(notmuch-hello) + (goto-char (point-min)) + (re-search-forward "inbox") + (widget-button-press (1- (point))) + (notmuch-test-wait) + (notmuch-search-toggle-hide-excluded) + (notmuch-test-wait) + (notmuch-tree-from-search-current-query) + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox-with-excluded OUTPUT + +test_begin_subtest "Value of hide-excluded from search persists into unthreaded" +test_emacs '(notmuch-hello) + (goto-char (point-min)) + (re-search-forward "inbox") + (widget-button-press (1- (point))) + (notmuch-test-wait) + (notmuch-search-toggle-hide-excluded) + (notmuch-test-wait) + (notmuch-unthreaded-from-search-current-query) + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-unthreaded-tag-inbox-with-excluded OUTPUT + +test_begin_subtest "Value of hide-excluded from tree persists into search" +test_emacs '(notmuch-hello) + (goto-char (point-min)) + (re-search-forward "inbox") + (widget-button-press (1- (point))) + (notmuch-test-wait) + (notmuch-tree-from-search-current-query) + (notmuch-test-wait) + (notmuch-tree-toggle-hide-excluded) + (notmuch-test-wait) + (notmuch-search-from-tree-current-query) + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-search-tag-inbox-with-excluded OUTPUT + +test_begin_subtest "Value of hide-excluded from tree persists into unthreaded" +test_emacs '(notmuch-hello) + (goto-char (point-min)) + (re-search-forward "inbox") + (widget-button-press (1- (point))) + (notmuch-test-wait) + (notmuch-tree-from-search-current-query) + (notmuch-test-wait) + (notmuch-tree-toggle-hide-excluded) + (notmuch-test-wait) + (notmuch-unthreaded-from-tree-current-query) + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-unthreaded-tag-inbox-with-excluded OUTPUT + +test_begin_subtest "Value of hide-excluded from unthreaded persists into tree" +test_emacs '(notmuch-hello) + (goto-char (point-min)) + (re-search-forward "inbox") + (widget-button-press (1- (point))) + (notmuch-test-wait) + (notmuch-unthreaded-from-search-current-query) + (notmuch-test-wait) + (notmuch-tree-toggle-hide-excluded) + (notmuch-test-wait) + (notmuch-tree-from-unthreaded-current-query) + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox-with-excluded OUTPUT + +test_begin_subtest "Value of hide-excluded from unthreaded persists into search" +test_emacs '(notmuch-hello) + (goto-char (point-min)) + (re-search-forward "inbox") + (widget-button-press (1- (point))) + (notmuch-test-wait) + (notmuch-unthreaded-from-search-current-query) + (notmuch-test-wait) + (notmuch-tree-toggle-hide-excluded) + (notmuch-test-wait) + (notmuch-search-from-tree-current-query) + (notmuch-test-wait) + (test-output) + (delete-other-windows)' +test_expect_equal_file $EXPECTED/notmuch-search-tag-inbox-with-excluded OUTPUT + +test_done diff --git a/test/emacs-exclude.expected-output/notmuch-search-tag-inbox-with-excluded b/test/emacs-exclude.expected-output/notmuch-search-tag-inbox-with-excluded new file mode 100644 index 00000000..ce1d7118 --- /dev/null +++ b/test/emacs-exclude.expected-output/notmuch-search-tag-inbox-with-excluded @@ -0,0 +1,25 @@ + 2009-11-17 [5/5] Mikhail Gusarov, Carl Worth, Keith Packard [notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 [7/7] Lars Kellogg-Stedman, Mikhail Gusarov, Keith Packard, Carl Worth [notmuch] Working with Maildir storage? (inbox signed unread) + 2009-11-17 [2/2] Alex Botero-Lowry, Carl Worth [notmuch] preliminary FreeBSD support (attachment inbox unread) + 2009-11-17 [1/1] Mikhail Gusarov [notmuch] [PATCH] Handle rename of message file (inbox unread) + 2009-11-17 [2/2] Keith Packard, Carl Worth [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-17 [2/2] Jan Janak, Carl Worth [notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) + 2009-11-17 [3/3] Jan Janak, Carl Worth [notmuch] What a great idea! (inbox unread) + 2009-11-17 [3/3] Israel Herraiz, Keith Packard, Carl Worth [notmuch] New to the list (inbox unread) + 2009-11-17 [3/3] Adrian Perez de Castro, Keith Packard, Carl Worth [notmuch] Introducing myself (inbox signed unread) + 2009-11-17 [3/3] Aron Griffis, Keith Packard, Carl Worth [notmuch] archive (inbox unread) + 2009-11-17 [2/2] Ingmar Vanhassel, Carl Worth [notmuch] [PATCH] Typsos (inbox unread) + 2009-11-18 [2/2] Alex Botero-Lowry, Carl Worth [notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread) + 2009-11-18 [2/2] Lars Kellogg-Stedman [notmuch] "notmuch help" outputs to stderr? (attachment inbox signed unread) + 2009-11-18 [1/1] Stewart Smith [notmuch] [PATCH] Fix linking with gcc to use g++ to link in C++ libs. (deleted inbox unread) + 2009-11-18 [1/1] Stewart Smith [notmuch] [PATCH 2/2] Read mail directory in inode number order (deleted inbox unread) + 2009-11-18 [1/1] Stewart Smith [notmuch] [PATCH] count_files: sort directory in inode order before statting (deleted inbox unread) + 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry [notmuch] Mac OS X/Darwin compatibility issues (inbox unread) + 2009-11-18 [1/1] Jan Janak [notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags (inbox unread) + 2009-11-18 [1/1] Rolland Santimano [notmuch] Link to mailing list archives ? (inbox unread) + 2009-11-18 [1/1] Alexander Botero-Lowry [notmuch] request for pull (inbox unread) + 2009-11-18 [2/2] Keith Packard, Alexander Botero-Lowry [notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2009-11-18 [1/1] Chris Wilson [notmuch] [PATCH 1/2] Makefile: evaluate pkg-config once (deleted inbox unread) + 2010-12-16 [1/1] Olivier Berger Essai accentué (inbox unread) + 2010-12-29 [1/1] François Boulogne [aur-general] Guidelines: cp, mkdir vs install (inbox unread) +End of search results. diff --git a/test/emacs-exclude.expected-output/notmuch-search-tag-inbox-without-excluded b/test/emacs-exclude.expected-output/notmuch-search-tag-inbox-without-excluded new file mode 100644 index 00000000..8a874320 --- /dev/null +++ b/test/emacs-exclude.expected-output/notmuch-search-tag-inbox-without-excluded @@ -0,0 +1,21 @@ + 2009-11-17 [5/5] Mikhail Gusarov, Carl Worth, Keith Packard [notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 [7/7] Lars Kellogg-Stedman, Mikhail Gusarov, Keith Packard, Carl Worth [notmuch] Working with Maildir storage? (inbox signed unread) + 2009-11-17 [2/2] Alex Botero-Lowry, Carl Worth [notmuch] preliminary FreeBSD support (attachment inbox unread) + 2009-11-17 [1/1] Mikhail Gusarov [notmuch] [PATCH] Handle rename of message file (inbox unread) + 2009-11-17 [2/2] Keith Packard, Carl Worth [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-17 [2/2] Jan Janak, Carl Worth [notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) + 2009-11-17 [3/3] Jan Janak, Carl Worth [notmuch] What a great idea! (inbox unread) + 2009-11-17 [3/3] Israel Herraiz, Keith Packard, Carl Worth [notmuch] New to the list (inbox unread) + 2009-11-17 [3/3] Adrian Perez de Castro, Keith Packard, Carl Worth [notmuch] Introducing myself (inbox signed unread) + 2009-11-17 [3/3] Aron Griffis, Keith Packard, Carl Worth [notmuch] archive (inbox unread) + 2009-11-17 [2/2] Ingmar Vanhassel, Carl Worth [notmuch] [PATCH] Typsos (inbox unread) + 2009-11-18 [2/2] Alex Botero-Lowry, Carl Worth [notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread) + 2009-11-18 [2/2] Lars Kellogg-Stedman [notmuch] "notmuch help" outputs to stderr? (attachment inbox signed unread) + 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry [notmuch] Mac OS X/Darwin compatibility issues (inbox unread) + 2009-11-18 [1/1] Jan Janak [notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags (inbox unread) + 2009-11-18 [1/1] Rolland Santimano [notmuch] Link to mailing list archives ? (inbox unread) + 2009-11-18 [1/1] Alexander Botero-Lowry [notmuch] request for pull (inbox unread) + 2009-11-18 [2/2] Keith Packard, Alexander Botero-Lowry [notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2010-12-16 [1/1] Olivier Berger Essai accentué (inbox unread) + 2010-12-29 [1/1] François Boulogne [aur-general] Guidelines: cp, mkdir vs install (inbox unread) +End of search results. diff --git a/test/emacs-exclude.expected-output/notmuch-tree-tag-inbox-with-excluded b/test/emacs-exclude.expected-output/notmuch-tree-tag-inbox-with-excluded new file mode 100644 index 00000000..5c6b2d7a --- /dev/null +++ b/test/emacs-exclude.expected-output/notmuch-tree-tag-inbox-with-excluded @@ -0,0 +1,53 @@ + 2009-11-17 Mikhail Gusarov ┬►[notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Mikhail Gusarov ├─►[notmuch] [PATCH 2/2] Include to get uint32_t in C++ file with gcc 4.4 (inbox unread) + 2009-11-17 Carl Worth ╰┬►[notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Keith Packard ╰┬► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Lars Kellogg-Stedman ┬►[notmuch] Working with Maildir storage? (inbox signed unread) + 2009-11-17 Mikhail Gusarov ├┬► ... (inbox signed unread) + 2009-11-17 Lars Kellogg-Stedman │╰┬► ... (inbox signed unread) + 2009-11-17 Mikhail Gusarov │ ├─► ... (inbox unread) + 2009-11-17 Keith Packard │ ╰┬► ... (inbox unread) + 2009-11-18 Lars Kellogg-Stedman │ ╰─► ... (inbox signed unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Alex Botero-Lowry ┬►[notmuch] preliminary FreeBSD support (attachment inbox unread) + 2009-11-17 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Mikhail Gusarov ─►[notmuch] [PATCH] Handle rename of message file (inbox unread) + 2009-11-17 Keith Packard ┬►[notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-18 Carl Worth ╰─►[notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-17 Jan Janak ┬►[notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Jan Janak ┬►[notmuch] What a great idea! (inbox unread) + 2009-11-17 Jan Janak ├─► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Israel Herraiz ┬►[notmuch] New to the list (inbox unread) + 2009-11-18 Keith Packard ├─► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Adrian Perez de Cast ┬►[notmuch] Introducing myself (inbox signed unread) + 2009-11-18 Keith Packard ├─► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Aron Griffis ┬►[notmuch] archive (inbox unread) + 2009-11-18 Keith Packard ╰┬► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Ingmar Vanhassel ┬►[notmuch] [PATCH] Typsos (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-18 Alex Botero-Lowry ┬►[notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread) + 2009-11-18 Carl Worth ╰─►[notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (inbox unread) + 2009-11-18 Lars Kellogg-Stedman ┬►[notmuch] "notmuch help" outputs to stderr? (attachment inbox signed unread) + 2009-11-18 Lars Kellogg-Stedman ╰─► ... (attachment inbox signed unread) + 2009-11-18 Stewart Smith ─►[notmuch] [PATCH] Fix linking with gcc to use g++ to link in C++ libs. (deleted inbox unread) + 2009-11-18 Stewart Smith ─►[notmuch] [PATCH 2/2] Read mail directory in inode number order (deleted inbox unread) + 2009-11-18 Stewart Smith ─►[notmuch] [PATCH] count_files: sort directory in inode order before statting (deleted inbox unread) + 2009-11-18 Jjgod Jiang ┬►[notmuch] Mac OS X/Darwin compatibility issues (inbox unread) + 2009-11-18 Alexander Botero-Low ╰┬► ... (inbox unread) + 2009-11-18 Jjgod Jiang ╰┬► ... (inbox unread) + 2009-11-18 Alexander Botero-Low ╰─► ... (inbox unread) + 2009-11-18 Jan Janak ─►[notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags (inbox unread) + 2009-11-18 Rolland Santimano ─►[notmuch] Link to mailing list archives ? (inbox unread) + 2009-11-18 Alexander Botero-Low ─►[notmuch] request for pull (inbox unread) + 2009-11-18 Keith Packard ┬►[notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2009-11-18 Alexander Botero-Low ╰─►[notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2009-11-18 Chris Wilson ─►[notmuch] [PATCH 1/2] Makefile: evaluate pkg-config once (deleted inbox unread) + 2010-12-16 Olivier Berger ─►Essai accentué (inbox unread) + 2010-12-29 François Boulogne ─►[aur-general] Guidelines: cp, mkdir vs install (inbox unread) +End of search results. diff --git a/test/emacs-exclude.expected-output/notmuch-tree-tag-inbox-without-excluded b/test/emacs-exclude.expected-output/notmuch-tree-tag-inbox-without-excluded new file mode 100644 index 00000000..55806d18 --- /dev/null +++ b/test/emacs-exclude.expected-output/notmuch-tree-tag-inbox-without-excluded @@ -0,0 +1,49 @@ + 2009-11-17 Mikhail Gusarov ┬►[notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Mikhail Gusarov ├─►[notmuch] [PATCH 2/2] Include to get uint32_t in C++ file with gcc 4.4 (inbox unread) + 2009-11-17 Carl Worth ╰┬►[notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Keith Packard ╰┬► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Lars Kellogg-Stedman ┬►[notmuch] Working with Maildir storage? (inbox signed unread) + 2009-11-17 Mikhail Gusarov ├┬► ... (inbox signed unread) + 2009-11-17 Lars Kellogg-Stedman │╰┬► ... (inbox signed unread) + 2009-11-17 Mikhail Gusarov │ ├─► ... (inbox unread) + 2009-11-17 Keith Packard │ ╰┬► ... (inbox unread) + 2009-11-18 Lars Kellogg-Stedman │ ╰─► ... (inbox signed unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Alex Botero-Lowry ┬►[notmuch] preliminary FreeBSD support (attachment inbox unread) + 2009-11-17 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Mikhail Gusarov ─►[notmuch] [PATCH] Handle rename of message file (inbox unread) + 2009-11-17 Keith Packard ┬►[notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-18 Carl Worth ╰─►[notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-17 Jan Janak ┬►[notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Jan Janak ┬►[notmuch] What a great idea! (inbox unread) + 2009-11-17 Jan Janak ├─► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Israel Herraiz ┬►[notmuch] New to the list (inbox unread) + 2009-11-18 Keith Packard ├─► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Adrian Perez de Cast ┬►[notmuch] Introducing myself (inbox signed unread) + 2009-11-18 Keith Packard ├─► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Aron Griffis ┬►[notmuch] archive (inbox unread) + 2009-11-18 Keith Packard ╰┬► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Ingmar Vanhassel ┬►[notmuch] [PATCH] Typsos (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-18 Alex Botero-Lowry ┬►[notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread) + 2009-11-18 Carl Worth ╰─►[notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (inbox unread) + 2009-11-18 Lars Kellogg-Stedman ┬►[notmuch] "notmuch help" outputs to stderr? (attachment inbox signed unread) + 2009-11-18 Lars Kellogg-Stedman ╰─► ... (attachment inbox signed unread) + 2009-11-18 Jjgod Jiang ┬►[notmuch] Mac OS X/Darwin compatibility issues (inbox unread) + 2009-11-18 Alexander Botero-Low ╰┬► ... (inbox unread) + 2009-11-18 Jjgod Jiang ╰┬► ... (inbox unread) + 2009-11-18 Alexander Botero-Low ╰─► ... (inbox unread) + 2009-11-18 Jan Janak ─►[notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags (inbox unread) + 2009-11-18 Rolland Santimano ─►[notmuch] Link to mailing list archives ? (inbox unread) + 2009-11-18 Alexander Botero-Low ─►[notmuch] request for pull (inbox unread) + 2009-11-18 Keith Packard ┬►[notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2009-11-18 Alexander Botero-Low ╰─►[notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2010-12-16 Olivier Berger ─►Essai accentué (inbox unread) + 2010-12-29 François Boulogne ─►[aur-general] Guidelines: cp, mkdir vs install (inbox unread) +End of search results. diff --git a/test/emacs-exclude.expected-output/notmuch-unthreaded-tag-inbox-with-excluded b/test/emacs-exclude.expected-output/notmuch-unthreaded-tag-inbox-with-excluded new file mode 100644 index 00000000..d55818e8 --- /dev/null +++ b/test/emacs-exclude.expected-output/notmuch-unthreaded-tag-inbox-with-excluded @@ -0,0 +1,53 @@ + 2009-11-17 Mikhail Gusarov [notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Mikhail Gusarov [notmuch] [PATCH 2/2] Include to get uint32_t in C++ file with gcc 4.4 (inbox unread) + 2009-11-17 Carl Worth [notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Lars Kellogg-Stedman [notmuch] Working with Maildir storage? (inbox signed unread) + 2009-11-17 Mikhail Gusarov [notmuch] Working with Maildir storage? (inbox signed unread) + 2009-11-17 Alex Botero-Lowry [notmuch] preliminary FreeBSD support (attachment inbox unread) + 2009-11-17 Carl Worth [notmuch] preliminary FreeBSD support (inbox unread) + 2009-11-17 Lars Kellogg-Stedman [notmuch] Working with Maildir storage? (inbox signed unread) + 2009-11-17 Mikhail Gusarov [notmuch] Working with Maildir storage? (inbox unread) + 2009-11-17 Mikhail Gusarov [notmuch] [PATCH] Handle rename of message file (inbox unread) + 2009-11-17 Keith Packard [notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Keith Packard [notmuch] Working with Maildir storage? (inbox unread) + 2009-11-17 Keith Packard [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-17 Jan Janak [notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) + 2009-11-17 Jan Janak [notmuch] What a great idea! (inbox unread) + 2009-11-17 Jan Janak [notmuch] What a great idea! (inbox unread) + 2009-11-17 Israel Herraiz [notmuch] New to the list (inbox unread) + 2009-11-17 Adrian Perez de Cast [notmuch] Introducing myself (inbox signed unread) + 2009-11-17 Aron Griffis [notmuch] archive (inbox unread) + 2009-11-17 Ingmar Vanhassel [notmuch] [PATCH] Typsos (inbox unread) + 2009-11-18 Alex Botero-Lowry [notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread) + 2009-11-18 Lars Kellogg-Stedman [notmuch] Working with Maildir storage? (inbox signed unread) + 2009-11-18 Lars Kellogg-Stedman [notmuch] "notmuch help" outputs to stderr? (attachment inbox signed unread) + 2009-11-18 Lars Kellogg-Stedman [notmuch] "notmuch help" outputs to stderr? (attachment inbox signed unread) + 2009-11-18 Stewart Smith [notmuch] [PATCH] Fix linking with gcc to use g++ to link in C++ libs. (deleted inbox unread) + 2009-11-18 Stewart Smith [notmuch] [PATCH 2/2] Read mail directory in inode number order (deleted inbox unread) + 2009-11-18 Keith Packard [notmuch] New to the list (inbox unread) + 2009-11-18 Keith Packard [notmuch] Introducing myself (inbox unread) + 2009-11-18 Keith Packard [notmuch] archive (inbox unread) + 2009-11-18 Stewart Smith [notmuch] [PATCH] count_files: sort directory in inode order before statting (deleted inbox unread) + 2009-11-18 Jjgod Jiang [notmuch] Mac OS X/Darwin compatibility issues (inbox unread) + 2009-11-18 Jan Janak [notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags (inbox unread) + 2009-11-18 Rolland Santimano [notmuch] Link to mailing list archives ? (inbox unread) + 2009-11-18 Alexander Botero-Low [notmuch] Mac OS X/Darwin compatibility issues (inbox unread) + 2009-11-18 Jjgod Jiang [notmuch] Mac OS X/Darwin compatibility issues (inbox unread) + 2009-11-18 Alexander Botero-Low [notmuch] Mac OS X/Darwin compatibility issues (inbox unread) + 2009-11-18 Alexander Botero-Low [notmuch] request for pull (inbox unread) + 2009-11-18 Keith Packard [notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2009-11-18 Alexander Botero-Low [notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2009-11-18 Carl Worth [notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-18 Carl Worth [notmuch] Working with Maildir storage? (inbox unread) + 2009-11-18 Carl Worth [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-18 Carl Worth [notmuch] archive (inbox unread) + 2009-11-18 Carl Worth [notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) + 2009-11-18 Carl Worth [notmuch] What a great idea! (inbox unread) + 2009-11-18 Carl Worth [notmuch] New to the list (inbox unread) + 2009-11-18 Carl Worth [notmuch] Introducing myself (inbox unread) + 2009-11-18 Carl Worth [notmuch] [PATCH] Typsos (inbox unread) + 2009-11-18 Carl Worth [notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (inbox unread) + 2009-11-18 Chris Wilson [notmuch] [PATCH 1/2] Makefile: evaluate pkg-config once (deleted inbox unread) + 2010-12-16 Olivier Berger Essai accentué (inbox unread) + 2010-12-29 François Boulogne [aur-general] Guidelines: cp, mkdir vs install (inbox unread) +End of search results. diff --git a/test/emacs-exclude.expected-output/notmuch-unthreaded-tag-inbox-without-excluded b/test/emacs-exclude.expected-output/notmuch-unthreaded-tag-inbox-without-excluded new file mode 100644 index 00000000..80c67d07 --- /dev/null +++ b/test/emacs-exclude.expected-output/notmuch-unthreaded-tag-inbox-without-excluded @@ -0,0 +1,49 @@ + 2009-11-17 Mikhail Gusarov [notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Mikhail Gusarov [notmuch] [PATCH 2/2] Include to get uint32_t in C++ file with gcc 4.4 (inbox unread) + 2009-11-17 Carl Worth [notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Lars Kellogg-Stedman [notmuch] Working with Maildir storage? (inbox signed unread) + 2009-11-17 Mikhail Gusarov [notmuch] Working with Maildir storage? (inbox signed unread) + 2009-11-17 Alex Botero-Lowry [notmuch] preliminary FreeBSD support (attachment inbox unread) + 2009-11-17 Carl Worth [notmuch] preliminary FreeBSD support (inbox unread) + 2009-11-17 Lars Kellogg-Stedman [notmuch] Working with Maildir storage? (inbox signed unread) + 2009-11-17 Mikhail Gusarov [notmuch] Working with Maildir storage? (inbox unread) + 2009-11-17 Mikhail Gusarov [notmuch] [PATCH] Handle rename of message file (inbox unread) + 2009-11-17 Keith Packard [notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Keith Packard [notmuch] Working with Maildir storage? (inbox unread) + 2009-11-17 Keith Packard [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-17 Jan Janak [notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) + 2009-11-17 Jan Janak [notmuch] What a great idea! (inbox unread) + 2009-11-17 Jan Janak [notmuch] What a great idea! (inbox unread) + 2009-11-17 Israel Herraiz [notmuch] New to the list (inbox unread) + 2009-11-17 Adrian Perez de Cast [notmuch] Introducing myself (inbox signed unread) + 2009-11-17 Aron Griffis [notmuch] archive (inbox unread) + 2009-11-17 Ingmar Vanhassel [notmuch] [PATCH] Typsos (inbox unread) + 2009-11-18 Alex Botero-Lowry [notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread) + 2009-11-18 Lars Kellogg-Stedman [notmuch] Working with Maildir storage? (inbox signed unread) + 2009-11-18 Lars Kellogg-Stedman [notmuch] "notmuch help" outputs to stderr? (attachment inbox signed unread) + 2009-11-18 Lars Kellogg-Stedman [notmuch] "notmuch help" outputs to stderr? (attachment inbox signed unread) + 2009-11-18 Keith Packard [notmuch] New to the list (inbox unread) + 2009-11-18 Keith Packard [notmuch] Introducing myself (inbox unread) + 2009-11-18 Keith Packard [notmuch] archive (inbox unread) + 2009-11-18 Jjgod Jiang [notmuch] Mac OS X/Darwin compatibility issues (inbox unread) + 2009-11-18 Jan Janak [notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags (inbox unread) + 2009-11-18 Rolland Santimano [notmuch] Link to mailing list archives ? (inbox unread) + 2009-11-18 Alexander Botero-Low [notmuch] Mac OS X/Darwin compatibility issues (inbox unread) + 2009-11-18 Jjgod Jiang [notmuch] Mac OS X/Darwin compatibility issues (inbox unread) + 2009-11-18 Alexander Botero-Low [notmuch] Mac OS X/Darwin compatibility issues (inbox unread) + 2009-11-18 Alexander Botero-Low [notmuch] request for pull (inbox unread) + 2009-11-18 Keith Packard [notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2009-11-18 Alexander Botero-Low [notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2009-11-18 Carl Worth [notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-18 Carl Worth [notmuch] Working with Maildir storage? (inbox unread) + 2009-11-18 Carl Worth [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-18 Carl Worth [notmuch] archive (inbox unread) + 2009-11-18 Carl Worth [notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) + 2009-11-18 Carl Worth [notmuch] What a great idea! (inbox unread) + 2009-11-18 Carl Worth [notmuch] New to the list (inbox unread) + 2009-11-18 Carl Worth [notmuch] Introducing myself (inbox unread) + 2009-11-18 Carl Worth [notmuch] [PATCH] Typsos (inbox unread) + 2009-11-18 Carl Worth [notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (inbox unread) + 2010-12-16 Olivier Berger Essai accentué (inbox unread) + 2010-12-29 François Boulogne [aur-general] Guidelines: cp, mkdir vs install (inbox unread) +End of search results. diff --git a/test/emacs-tree.expected-output/notmuch-tree-tag-inbox-oldest-first b/test/emacs-tree.expected-output/notmuch-tree-tag-inbox-oldest-first new file mode 100644 index 00000000..588fc583 --- /dev/null +++ b/test/emacs-tree.expected-output/notmuch-tree-tag-inbox-oldest-first @@ -0,0 +1,53 @@ + 2009-11-17 Mikhail Gusarov ┬►[notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Mikhail Gusarov ├─►[notmuch] [PATCH 2/2] Include to get uint32_t in C++ file with gcc 4.4 (inbox unread) + 2009-11-17 Carl Worth ╰┬►[notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread) + 2009-11-17 Keith Packard ╰┬► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Lars Kellogg-Stedman ┬►[notmuch] Working with Maildir storage? (inbox signed unread) + 2009-11-17 Mikhail Gusarov ├┬► ... (inbox signed unread) + 2009-11-17 Lars Kellogg-Stedman │╰┬► ... (inbox signed unread) + 2009-11-17 Mikhail Gusarov │ ├─► ... (inbox unread) + 2009-11-17 Keith Packard │ ╰┬► ... (inbox unread) + 2009-11-18 Lars Kellogg-Stedman │ ╰─► ... (inbox signed unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Alex Botero-Lowry ┬►[notmuch] preliminary FreeBSD support (attachment inbox unread) + 2009-11-17 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Mikhail Gusarov ─►[notmuch] [PATCH] Handle rename of message file (inbox unread) + 2009-11-17 Keith Packard ┬►[notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-18 Carl Worth ╰─►[notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread) + 2009-11-17 Jan Janak ┬►[notmuch] [PATCH] Older versions of install do not support -C. (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Jan Janak ┬►[notmuch] What a great idea! (inbox unread) + 2009-11-17 Jan Janak ├─► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Israel Herraiz ┬►[notmuch] New to the list (inbox unread) + 2009-11-18 Keith Packard ├─► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Adrian Perez de Cast ┬►[notmuch] Introducing myself (inbox signed unread) + 2009-11-18 Keith Packard ├─► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Aron Griffis ┬►[notmuch] archive (inbox unread) + 2009-11-18 Keith Packard ╰┬► ... (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-17 Ingmar Vanhassel ┬►[notmuch] [PATCH] Typsos (inbox unread) + 2009-11-18 Carl Worth ╰─► ... (inbox unread) + 2009-11-18 Alex Botero-Lowry ┬►[notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread) + 2009-11-18 Carl Worth ╰─►[notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (inbox unread) + 2009-11-18 Lars Kellogg-Stedman ┬►[notmuch] "notmuch help" outputs to stderr? (attachment inbox signed unread) + 2009-11-18 Lars Kellogg-Stedman ╰─► ... (attachment inbox signed unread) + 2009-11-18 Stewart Smith ─►[notmuch] [PATCH] Fix linking with gcc to use g++ to link in C++ libs. (inbox unread) + 2009-11-18 Stewart Smith ─►[notmuch] [PATCH 2/2] Read mail directory in inode number order (inbox unread) + 2009-11-18 Stewart Smith ─►[notmuch] [PATCH] count_files: sort directory in inode order before statting (inbox unread) + 2009-11-18 Jjgod Jiang ┬►[notmuch] Mac OS X/Darwin compatibility issues (inbox unread) + 2009-11-18 Alexander Botero-Low ╰┬► ... (inbox unread) + 2009-11-18 Jjgod Jiang ╰┬► ... (inbox unread) + 2009-11-18 Alexander Botero-Low ╰─► ... (inbox unread) + 2009-11-18 Jan Janak ─►[notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags (inbox unread) + 2009-11-18 Rolland Santimano ─►[notmuch] Link to mailing list archives ? (inbox unread) + 2009-11-18 Alexander Botero-Low ─►[notmuch] request for pull (inbox unread) + 2009-11-18 Keith Packard ┬►[notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2009-11-18 Alexander Botero-Low ╰─►[notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread) + 2009-11-18 Chris Wilson ─►[notmuch] [PATCH 1/2] Makefile: evaluate pkg-config once (inbox unread) + 2010-12-16 Olivier Berger ─►Essai accentué (inbox unread) + 2010-12-29 François Boulogne ─►[aur-general] Guidelines: cp, mkdir vs install (inbox unread) +End of search results. -- 2.43.0 From c6bbb670700efb8d9119a1e2c2b4d432300233b6 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Mon, 20 May 2024 08:58:55 -0300 Subject: [PATCH 2/9] test: re-enable duplicate UI tests in T460-emacs-tree These were disabled (accidentally?) in f63d14a8c12a. --- test/T460-emacs-tree.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/T460-emacs-tree.sh b/test/T460-emacs-tree.sh index 6ef5c54a..9388a8ed 100755 --- a/test/T460-emacs-tree.sh +++ b/test/T460-emacs-tree.sh @@ -222,8 +222,6 @@ test_emacs '(let ((notmuch-tree-outline-enabled t)) # folding all messages by height or depth should look the same test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox OUTPUT -test_done - add_email_corpus duplicate ID3=87r2ecrr6x.fsf@zephyr.silentflame.com -- 2.43.0 From e8e2d5247e44d9b402cbcc491b859cd9398f045d Mon Sep 17 00:00:00 2001 From: Mohsin Kaleem Date: Fri, 19 Apr 2024 19:25:06 +0100 Subject: [PATCH 3/9] emacs: Allow customizing :excluded in notmuch-saved-searches Provide customize support for the new feature introduced in cd89065d. Commit message expanded by: db --- emacs/notmuch-hello.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index b6d1e2ae..b3228d43 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -116,6 +116,12 @@ searches so they still work in customize." (const :tag "Default" nil) (const :tag "Oldest-first" oldest-first) (const :tag "Newest-first" newest-first))) + (group :format "%v" :inline t + (const :format "" :excluded) + (choice :tag " Hide Excluded" + (const :tag "Default" nil) + (const :tag "Hide" hide) + (const :tag "Show" show))) (group :format "%v" :inline t (const :format "" :search-type) (choice :tag " Search Type" -- 2.43.0 From 55d259a1143000658a97d300d6c4514ea54be36e Mon Sep 17 00:00:00 2001 From: David Bremner Date: Wed, 29 May 2024 07:15:23 -0300 Subject: [PATCH 4/9] test/corpora: add example with text/calendar attachment Initially for testing rendering in Emacs. --- test/corpora/attachment/text-calendar.eml | 55 +++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 test/corpora/attachment/text-calendar.eml diff --git a/test/corpora/attachment/text-calendar.eml b/test/corpora/attachment/text-calendar.eml new file mode 100644 index 00000000..8e064f9b --- /dev/null +++ b/test/corpora/attachment/text-calendar.eml @@ -0,0 +1,55 @@ +From: David Bremner +To: "david@tethera.net" +Subject: test +Date: Thu Jan 01 00:00:10 +0000 +Message-ID: + +Accept-Language: en-CA, en-US +Content-Language: en-CA +Content-Type: multipart/alternative; + boundary="_000_YT3PR01MB10572EFC9F7C81F9446214768CEF72YT3PR01MB10572CA_" +MIME-Version: 1.0 + +--_000_YT3PR01MB10572EFC9F7C81F9446214768CEF72YT3PR01MB10572CA_ +Content-Type: text/plain; charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + +This meeting will could have been an email + + +--_000_YT3PR01MB10572EFC9F7C81F9446214768CEF72YT3PR01MB10572CA_ +Content-Type: text/calendar; charset="utf-8"; method=REQUEST +Content-Transfer-Encoding: base64 + +QkVHSU46VkNBTEVOREFSDQpNRVRIT0Q6UkVRVUVTVA0KUFJPRElEOk1pY3Jvc29mdCBFeGNoYW5n +ZSBTZXJ2ZXIgMjAxMA0KVkVSU0lPTjoyLjANCkJFR0lOOlZUSU1FWk9ORQ0KVFpJRDpBdGxhbnRp +YyBTdGFuZGFyZCBUaW1lDQpCRUdJTjpTVEFOREFSRA0KRFRTVEFSVDoxNjAxMDEwMVQwMjAwMDAN +ClRaT0ZGU0VURlJPTTotMDMwMA0KVFpPRkZTRVRUTzotMDQwMA0KUlJVTEU6RlJFUT1ZRUFSTFk7 +SU5URVJWQUw9MTtCWURBWT0xU1U7QllNT05USD0xMQ0KRU5EOlNUQU5EQVJEDQpCRUdJTjpEQVlM +SUdIVA0KRFRTVEFSVDoxNjAxMDEwMVQwMjAwMDANClRaT0ZGU0VURlJPTTotMDQwMA0KVFpPRkZT +RVRUTzotMDMwMA0KUlJVTEU6RlJFUT1ZRUFSTFk7SU5URVJWQUw9MTtCWURBWT0yU1U7QllNT05U +SD0zDQpFTkQ6REFZTElHSFQNCkVORDpWVElNRVpPTkUNCkJFR0lOOlZFVkVOVA0KT1JHQU5JWkVS +O0NOPURhdmlkIEJyZW1uZXI6bWFpbHRvOmJyZW1uZXJAZXhhbXBsZS5jb20NCkFUVEVOREVFO1JP +TEU9UkVRLVBBUlRJQ0lQQU5UO1BBUlRTVEFUPU5FRURTLUFDVElPTjtSU1ZQPVRSVUU7Q049ZGF2 +aWRAdGV0aA0KIGVyYS5uZXQ6bWFpbHRvOmRhdmlkQHRldGhlcmEubmV0DQpERVNDUklQVElPTjtM +QU5HVUFHRT1lbi1DQTpUaGlzIG1lZXRpbmcgd2lsbCBjb3VsZCBoYXZlIGJlZW4gYW4gZW1haWxc +blxuDQpSUlVMRTpGUkVRPURBSUxZO1VOVElMPTIwMjQwODI3VDE3MDAwMFo7SU5URVJWQUw9MQ0K +VUlEOjA0MDAwMDAwODIwMEUwMDA3NEM1QjcxMDFBODJFMDA4MDAwMDAwMDAwRUE4NDFFNzk5QUZE +QTAxMDAwMDAwMDAwMDAwMDAwDQogMDEwMDAwMDAwNjkyRkRFNzQzMzNGQ0I0N0JFNEY0REU5MDk0 +OThDQkUNClNVTU1BUlk7TEFOR1VBR0U9ZW4tQ0E6dGVzdCBbSW4tcGVyc29uXQ0KRFRTVEFSVDtU +WklEPUF0bGFudGljIFN0YW5kYXJkIFRpbWU6MjAyNDA1MjdUMTQwMDAwDQpEVEVORDtUWklEPUF0 +bGFudGljIFN0YW5kYXJkIFRpbWU6MjAyNDA1MjdUMTQzMDAwDQpDTEFTUzpQVUJMSUMNClBSSU9S +SVRZOjUNCkRUU1RBTVA6MjAyNDA1MjZUMTgyNDEwWg0KVFJBTlNQOk9QQVFVRQ0KU1RBVFVTOkNP +TkZJUk1FRA0KU0VRVUVOQ0U6MA0KTE9DQVRJT047TEFOR1VBR0U9ZW4tQ0E6DQpYLU1JQ1JPU09G +VC1DRE8tQVBQVC1TRVFVRU5DRTowDQpYLU1JQ1JPU09GVC1DRE8tT1dORVJBUFBUSUQ6MjEyMjcw +MDA0Ng0KWC1NSUNST1NPRlQtQ0RPLUJVU1lTVEFUVVM6VEVOVEFUSVZFDQpYLU1JQ1JPU09GVC1D +RE8tSU5URU5ERURTVEFUVVM6QlVTWQ0KWC1NSUNST1NPRlQtQ0RPLUFMTERBWUVWRU5UOkZBTFNF +DQpYLU1JQ1JPU09GVC1DRE8tSU1QT1JUQU5DRToxDQpYLU1JQ1JPU09GVC1DRE8tSU5TVFRZUEU6 +MQ0KWC1NSUNST1NPRlQtRE9OT1RGT1JXQVJETUVFVElORzpGQUxTRQ0KWC1NSUNST1NPRlQtRElT +QUxMT1ctQ09VTlRFUjpGQUxTRQ0KWC1NSUNST1NPRlQtUkVRVUVTVEVEQVRURU5EQU5DRU1PREU6 +SU5QRVJTT05SRVFVSVJFRA0KWC1NSUNST1NPRlQtSVNSRVNQT05TRVJFUVVFU1RFRDpUUlVFDQpY +LU1JQ1JPU09GVC1MT0NBVElPTlM6W10NCkJFR0lOOlZBTEFSTQ0KREVTQ1JJUFRJT046UkVNSU5E +RVINClRSSUdHRVI7UkVMQVRFRD1TVEFSVDotUFQxNU0NCkFDVElPTjpESVNQTEFZDQpFTkQ6VkFM +QVJNDQpFTkQ6VkVWRU5UDQpFTkQ6VkNBTEVOREFSDQo= + +--_000_YT3PR01MB10572EFC9F7C81F9446214768CEF72YT3PR01MB10572CA_-- -- 2.43.0 From 4b5be817a745b54bb2051811ea02c2a389e56284 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Wed, 29 May 2024 07:15:24 -0300 Subject: [PATCH 5/9] test/emacs: add regression test for display of calendar parts. This will hopefully catch breakage due to either changes in Emacs (especially Gnus) or changes to the notmuch-show code. --- test/T450-emacs-show.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/T450-emacs-show.sh b/test/T450-emacs-show.sh index 559df8aa..438a7b9b 100755 --- a/test/T450-emacs-show.sh +++ b/test/T450-emacs-show.sh @@ -318,6 +318,28 @@ test_expect_equal "$(cat MESSAGES)" "COMPLETE" add_email_corpus attachment +test_begin_subtest "display of text/calendar" +test_emacs '(let ((notmuch-show-all-multipart/alternative-parts t)) + (notmuch-show "id:YT3PR01MB10572EFC9F7C81F9446214768CEF72@YT3PR01MB10572.CANPRD01.PROD.OUTLOOK.COM")) + (test-visible-output "OUTPUT")' +cat < EXPECTED +David Bremner (1970-01-01) (inbox) +Subject: test +To: "david@tethera.net" +Date: Thu, 01 Jan 1970 00:00:00 +0000 + +[ multipart/alternative ] +[ text/plain ] +This meeting will could have been an email +[ text/calendar ] +%%(and (diary-cyclic 1 5 27 2024) (diary-block 5 27 2024 8 27 2024)) 17:00-17:30 test [In-person] + Desc: This meeting will could have been an email + + + Organizer: mailto:bremner@example.com +EOF +test_expect_equal_file EXPECTED OUTPUT + test_begin_subtest "tar not inlined by default" test_emacs '(notmuch-show "id:874llc2bkp.fsf@curie.anarc.at") (test-visible-output "OUTPUT")' -- 2.43.0 From cccee9009598f3aa6472ceb9aceedb9c32997691 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Wed, 29 May 2024 07:15:25 -0300 Subject: [PATCH 6/9] test/emacs: add tests for rendering text/calendar parts The first test is just a general regression test, while the second duplicates the problem discussed in the thread starting at [1]. [1]: id:m2leo2u0uo.fsf@gmail.com --- test/T450-emacs-show.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/T450-emacs-show.sh b/test/T450-emacs-show.sh index 438a7b9b..027062cd 100755 --- a/test/T450-emacs-show.sh +++ b/test/T450-emacs-show.sh @@ -340,6 +340,33 @@ This meeting will could have been an email EOF test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "display of text/calendar, symlinked tmpdir" +test_subtest_known_broken +mkdir real-tmp +ln -s real-tmp tmp +test_emacs "(let ((notmuch-show-all-multipart/alternative-parts t) + (temporary-file-directory \"tmp\") + (find-file-visit-truename t)) + (notmuch-show \"id:YT3PR01MB10572EFC9F7C81F9446214768CEF72@YT3PR01MB10572.CANPRD01.PROD.OUTLOOK.COM\")) + (test-visible-output \"OUTPUT\")" +cat < EXPECTED +David Bremner (1970-01-01) (inbox) +Subject: test +To: "david@tethera.net" +Date: Thu, 01 Jan 1970 00:00:00 +0000 + +[ multipart/alternative ] +[ text/plain ] +This meeting will could have been an email +[ text/calendar ] +%%(and (diary-cyclic 1 5 27 2024) (diary-block 5 27 2024 8 27 2024)) 17:00-17:30 test [In-person] + Desc: This meeting will could have been an email + + + Organizer: mailto:bremner@example.com +EOF +test_expect_equal_file EXPECTED OUTPUT + test_begin_subtest "tar not inlined by default" test_emacs '(notmuch-show "id:874llc2bkp.fsf@curie.anarc.at") (test-visible-output "OUTPUT")' -- 2.43.0 From b02a53a5cc9b5c0c397fec9f8289fcec834f9992 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Wed, 29 May 2024 07:15:26 -0300 Subject: [PATCH 7/9] emacs/show: fix for text/calendar display In certain scenarios involving symlinks and setting find-file-visit-truename, text/calendar parts were not displayed properly. Following a suggestion of Al Haji-Ali [1], replace the use of get-file-buffer with find-buffer-visiting. [1]: id:m2wmneguh8.fsf@gmail.com --- emacs/notmuch-show.el | 2 +- test/T450-emacs-show.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 4c0ad74d..14e3c698 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -864,7 +864,7 @@ will return nil if the CID is unknown or cannot be retrieved." (unless (icalendar-import-buffer file t) (error "Icalendar import error. %s" "See *icalendar-errors* for more information")) - (set-buffer (get-file-buffer file)) + (set-buffer (find-buffer-visiting file)) (setq result (buffer-substring (point-min) (point-max))) (set-buffer-modified-p nil) (kill-buffer (current-buffer))) diff --git a/test/T450-emacs-show.sh b/test/T450-emacs-show.sh index 027062cd..7c6a946a 100755 --- a/test/T450-emacs-show.sh +++ b/test/T450-emacs-show.sh @@ -341,7 +341,6 @@ EOF test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "display of text/calendar, symlinked tmpdir" -test_subtest_known_broken mkdir real-tmp ln -s real-tmp tmp test_emacs "(let ((notmuch-show-all-multipart/alternative-parts t) -- 2.43.0 From 0d2a964ea3d0c466d6284dd0b693285941c28440 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 26 May 2024 09:52:32 -0300 Subject: [PATCH 8/9] test/cli: Add known broken test for (missing) quoting in From In [1], Jakub Wilk observes that the current behaviour is confusing since it looks like there are two mailboxes in From, while in fact there is only one. It seems to me that notmuch should at least quote the display-name part of a mailbox if it has "funny" characters in it, and perhaps always quote it. Either way will require changing the indexing code, since the structure is lost when writing the headers to the database. [1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021614 --- test/T520-show.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/T520-show.sh b/test/T520-show.sh index 6bcf109c..8121c3db 100755 --- a/test/T520-show.sh +++ b/test/T520-show.sh @@ -45,6 +45,12 @@ if [ "${NOTMUCH_HAVE_SFSEXP-0}" = "1" ]; then fi +test_begin_subtest "quoting in From" +test_subtest_known_broken +add_message '[from]="=?UTF-8?Q?=3Cfoo=40example.org=3E=2C?= "' +output=$(notmuch show id:${gen_msg_id}|grep From:) +test_expect_equal "${output}" 'From: "," ' + add_email_corpus duplicate ID1=debian/2.6.1.dfsg-4-1-g87ea161@87ea161e851dfb1ea324af00e4ecfccc18875e15 -- 2.43.0 From 37c022aea000ab586ba2a7ea7bbac4292dda0dd3 Mon Sep 17 00:00:00 2001 From: Marc Fargas Date: Thu, 14 Mar 2024 15:56:49 +0100 Subject: [PATCH 9/9] Use `without-restriction` in `with-temporary-notmuch-message-buffer` This ensures that the temporary copy of the current message-mode buffer is whole and not limited by a current restriction. An example of such restriction is the default one established by message-mode when composing a reply, that hides the References, In-Reply-To and similar headers. --- emacs/notmuch-maildir-fcc.el | 17 +++++++++-------- test/T630-emacs-draft.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el index 51020788..cf50e855 100644 --- a/emacs/notmuch-maildir-fcc.el +++ b/emacs/notmuch-maildir-fcc.el @@ -145,14 +145,15 @@ Otherwise set it according to `notmuch-fcc-dirs'." (defmacro with-temporary-notmuch-message-buffer (&rest body) "Set-up a temporary copy of the current message-mode buffer." - `(let ((case-fold-search t) - (buf (current-buffer)) - (mml-externalize-attachments message-fcc-externalize-attachments)) - (with-current-buffer (get-buffer-create " *message temp*") - (message-clone-locals buf) ;; for message-encoded-mail-cache - (erase-buffer) - (insert-buffer-substring buf) - ,@body))) + `(without-restriction + (let ((case-fold-search t) + (buf (current-buffer)) + (mml-externalize-attachments message-fcc-externalize-attachments)) + (with-current-buffer (get-buffer-create " *message temp*") + (message-clone-locals buf) ;; for message-encoded-mail-cache + (erase-buffer) + (insert-buffer-substring buf) + ,@body)))) (defun notmuch-maildir-setup-message-for-saving () "Setup message for saving. diff --git a/test/T630-emacs-draft.sh b/test/T630-emacs-draft.sh index c443f417..1fad58a8 100755 --- a/test/T630-emacs-draft.sh +++ b/test/T630-emacs-draft.sh @@ -71,4 +71,36 @@ Fcc: MAIL_DIR/sent <#secure method=pgpmime mode=sign> EOF test_expect_equal_file EXPECTED OUTPUT.clean + +add_email_corpus attachment +test_begin_subtest "Saving a draft keeps hidden headers" +test_emacs '(notmuch-mua-new-reply "id:874llc2bkp.fsf@curie.anarc.at") + (message-goto-subject) + (delete-line) + (insert "Subject: draft-test-reply\n") + (test-output "DRAFT") + (notmuch-draft-postpone) + (notmuch-show "subject:draft-test-reply") + (notmuch-show-resume-message) + (test-output)' +notmuch_dir_sanitize OUTPUT > OUTPUT.clean + +cat < EXPECTED +References: <87d10042pu.fsf@curie.anarc.at> <87woy8vx7i.fsf@tesseract.cs.unb.ca> <87a7v42bv9.fsf@curie.anarc.at> <874llc2bkp.fsf@curie.anarc.at> +From: Notmuch Test Suite +To: Antoine Beaupré +Subject: draft-test-reply +In-Reply-To: <874llc2bkp.fsf@curie.anarc.at> +Fcc: MAIL_DIR/sent +--text follows this line-- +Antoine Beaupré writes: + +> And obviously I forget the frigging attachment. +> +> +> PS: don't we have a "you forgot to actually attach the damn file" plugin +> when we detect the word "attachment" and there's no attach? :p +EOF +test_expect_equal_file EXPECTED OUTPUT.clean + test_done -- 2.43.0