Re: contact instead of (to or from)

2022-06-09 Thread 杨令
> Coming from mu4e I loved the query "contact" which includes "to" or
> "from" the contact in the results.
> Is there something equivalent in notmuch?
⮩ Hi, Erik, I don't think notmuch has a built-in `contact` query, but I
think it's easy to build a saved search.

  (add-to-list 'notmuch-saved-searches '(:name "query" :query "to:... or 
from:..." :key "r"))

`:key` part is optional.

--
L.Yang

On Fri 2022-06-10 00:35:12, erik colson wrote:
> Date: Fri, 10 Jun 2022 00:35:12 +0200
> From: erik colson 
> To: notmuch@notmuchmail.org
> Subject: contact instead of (to or from)
> 
> Hi,
> 
> Coming from mu4e I loved the query "contact" which includes "to" or
> "from" the contact in the results.
> Is there something equivalent in notmuch?
> 
> thx
> -- 
> erik colson
> ___
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-le...@notmuchmail.org
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


contact instead of (to or from)

2022-06-09 Thread erik colson
Hi,

Coming from mu4e I loved the query "contact" which includes "to" or
"from" the contact in the results.
Is there something equivalent in notmuch?

thx
-- 
erik colson
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


[PATCH v4] emacs: Make notmuch-show-next-thread return nil on failure

2022-06-09 Thread Leo Okawa Ericson
Having notmuch-show-next-thread return non-nil on success and nil on
failure makes it easier for users to interact with notmuch via elisp.

This commit changes notmuch-search-show-thread too since the return
value of notmuch-show-next-thread depends on notmuch-search-show-thread.
---

Whitespace issues should have been fixed.

I think I was generally confused over how tests work.  It was probably
that I was missing a call to (notmuch-test-wait).  These revised tests
hopefully makes more sense now.

Previous patch: id:8baa58c3-7ab9-ec03-1bbd-28aa5be83...@kleine-koenig.org

 emacs/notmuch-show.el   |  4 +++-
 emacs/notmuch.el|  7 +--
 test/T450-emacs-show.sh | 11 +++
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 203ca7f0..aded1ee7 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -2227,7 +2227,9 @@ (defun notmuch-show-next-thread ( show previous)
 If SHOW is non-nil, open the next item in a show
 buffer. Otherwise just highlight the next item in the search
 buffer. If PREVIOUS is non-nil, move to the previous item in the
-search results instead."
+search results instead.
+
+Return non-nil on success."
   (interactive "P")
   (let ((parent-buffer notmuch-show-parent-buffer))
 (notmuch-bury-or-kill-this-buffer)
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index c9cf80dc..01a92997 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -520,7 +520,9 @@ (defun notmuch-search-show-thread ( elide-toggle)
 
 With a prefix argument, invert the default value of
 `notmuch-show-only-matching-messages' when displaying the
-thread."
+thread.
+
+Return non-nil on success."
   (interactive "P")
   (let ((thread-id (notmuch-search-find-thread-id)))
 (if thread-id
@@ -532,7 +534,8 @@ (defun notmuch-search-show-thread ( elide-toggle)
  (format "*%s*" (truncate-string-to-width
  (notmuch-search-find-subject)
  30 nil nil t)))
-  (message "End of search results."
+  (message "End of search results.")
+  nil)))
 
 (defun notmuch-tree-from-search-current-query ()
   "Tree view of current query."
diff --git a/test/T450-emacs-show.sh b/test/T450-emacs-show.sh
index 678efd8b..9e92cb98 100755
--- a/test/T450-emacs-show.sh
+++ b/test/T450-emacs-show.sh
@@ -62,6 +62,17 @@ test_emacs '(let ((notmuch-crypto-process-mime nil))
(test-visible-output))'
 test_expect_equal_file $EXPECTED/notmuch-show-process-crypto-mime-parts-on 
OUTPUT
 
+test_begin_subtest "notmuch-search-show-thread returns non-nil on success"
+test_emacs_expect_t  '(notmuch-search 
"id:20091117203301.gv3...@dottiness.seas.harvard.edu")
+ (notmuch-test-wait)
+ (and (notmuch-search-show-thread)
+  (not (notmuch-show-next-thread)))'
+
+test_begin_subtest "notmuch-search-show-thread returns nil when there are no 
messages"
+test_emacs_expect_t  '(notmuch-search "id:non-existing-id")
+ (notmuch-test-wait)
+ (not (notmuch-search-show-thread))'
+
 test_begin_subtest "notmuch-show: don't elide non-matching messages"
 test_emacs '(let ((notmuch-show-only-matching-messages nil))
(notmuch-search "from:l...@seas.harvard.edu and subject:\"Maildir 
storage\"")

base-commit: 3a6b479a7360fbdbc1c6def4c1e1581bfd63e8a2
-- 
2.36.1

___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Ignoring unknown messages for git.safe_fraction

2022-06-09 Thread Sean Whitton
Hello,

On one machine I have only some of my mail, and so 'notmuch git status'
will always have a lot of lines starting with "U".  But then
git.safe_fraction will always be exceeded.  How about ignoring
status['missing'] in check_safe_fraction, by default?

-- 
Sean Whitton
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org