Re: How to use/integrate "notmuch" with Mutt

2021-02-08 Thread boB Stepp

On 21/02/09 12:23PM, Cameron Simpson wrote:

On 08Feb2021 17:17, boB Stepp  wrote:

My online research into "notmuch" does not seem to be giving my expected
results.  My _expectations_ going into this were that with "notmuch" I
could:

1) Open an email in Mutt.

2) Based on that email and its contents assign relevant tags to the email
via notmuch.  These tags would prove useful in the future when searching
for tagged content.

3) From within Mutt I could initiate a notmuch search across _all_ of my
mail directories.  After notmuch returns the search results I could open
any of these emails from within Mutt.

4) Et cetera.  Meaning similar types of actions initiated from *within*
Mutt.  That seems to be key.


Hmm.  I've installed notmuch and notmuch-mutt, both version 0.29.3 dated
2019-11-27 from my package manager.  I was concerned that they wouldn't
properly work with my more current Mutt 2.0.5, but so far I have not
detected any issues.  I used the macros suggested on the ArchLinux wiki I
mentioned in my earlier response to Cameron.  F8 allows me to search all
mailboxes from within Mutt.  The results show up inside a (I guess)
temporary mailbox.  I can open these and do usual Mutt-like stuff.  F9
supposedly reconstructs threads from emails scattered over multiple
mailboxes.  I haven't tested this one yet.  F6 did not do what I thought it
would do from the description.  Apparently all it does is remove the inbox
tag from all emails is the current search results.  In the man pages for
notmuch-mutt it suggests that the portion of the macro "-inbox" can be
replaced with a different tag.

I don't have a good understanding of this macro.  I will paste it in below:

macro index  \
"set my_old_pipe_decode=\$pipe_decode
my_old_wait_key=\$wait_key nopipe_decode nowait_key\
notmuch-mutt tag -- -inbox\
set pipe_decode=\$my_old_pipe_decode
wait_key=\$my_old_wait_key" \
"notmuch: remove message from inbox"

I have a question:  Can this be modified so that the user is prompted to
enter a tag name which can then be applied to all of the search results?
If yes, then that would be wonderful for what I have in mind.  Even better
would be the ability to enter multiple tags after pressing F6.

To finish up I have modified my crontab entry to run "notmuch new --quiet"
after it runs the "mbsync -a -qq" command at five minute intervals.  So far
things seem to be running well.

A perhaps better way of doing this scheduling would be the recommendations
at the ArchLinux wiki at
https://wiki.archlinux.org/index.php/Isync#Integration_with_notmuch_or_mu4e
However, this would require me to do some research on systemd, configuring
and starting services, etc.  Perhaps I'll investigate this later, but
perhaps someone more knowledgeable than me will find this link useful.

--
Wishing you only the best,

boB Stepp


Re: How to use/integrate "notmuch" with Mutt

2021-02-08 Thread boB Stepp

On 21/02/09 12:23PM, Cameron Simpson wrote:

On 08Feb2021 17:17, boB Stepp  wrote:



I'm not using notmuch's tagging facility; I only use it for search. And
that infrequently.


It is this facility that I especially find intriguing if I can make it do
what I hope.


Notmuch itself lives outside mutt. You set it up with "notmuch setup"
and keep it up to date with the "notmuch new" command. (See "man
notmuch-setup" and "man notmuch-new".)


I have gathered this much so far.  I will probably go ahead and install it
and notmuch-mutt and see what I can easily make it do.  Apparently NeoMutt
has integrated notmuch-mutt into their distribution.  Out of curiosity, do
the Mutt developers have any inclinations in this direction?


I've a script for performing a notmuch search and building a result
Maildir containing the search results, and popping up that Maildir in
mutt:

   https://hg.sr.ht/~cameron-simpson/css/browse/bin/notmuch-search?tip

and I routinely invoke it via a stub script with a shorter name which
includes the -t option (includes threads containing the matching
messages).


Will look at this soon, but I wonder if you have independently have
developed similar functionality to what notmuch-mutt is supposed to supply?


Can someone clarify what I can and cannot do with notmuch from *within*
Mutt?  Provide more informative online articles then perhaps I have found?


You could easily write a mutt macro to invoke such a search from within
mutt itself. I haven't myself. I just issue a search from the command
line via my script.


Are you thinking of something like this on the ArchLinux Wiki:
https://wiki.archlinux.org/index.php/Notmuch#Integrating_with_mutt

--
Wishing you only the best,

boB Stepp


Re: How to use/integrate "notmuch" with Mutt

2021-02-08 Thread Cameron Simpson
On 08Feb2021 17:17, boB Stepp  wrote:
>My online research into "notmuch" does not seem to be giving my expected
>results.  My _expectations_ going into this were that with "notmuch" I
>could:
>
>1) Open an email in Mutt.
>
>2) Based on that email and its contents assign relevant tags to the email
>via notmuch.  These tags would prove useful in the future when searching
>for tagged content.
>
>3) From within Mutt I could initiate a notmuch search across _all_ of my
>mail directories.  After notmuch returns the search results I could open
>any of these emails from within Mutt.
>
>4) Et cetera.  Meaning similar types of actions initiated from *within*
>Mutt.  That seems to be key.

I'm not using notmuch's tagging facility; I only use it for search. And 
that infrequently.

Notmuch itself lives outside mutt. You set it up with "notmuch setup" 
and keep it up to date with the "notmuch new" command. (See "man 
notmuch-setup" and "man notmuch-new".)

I've a script for performing a notmuch search and building a result 
Maildir containing the search results, and popping up that Maildir in 
mutt:

https://hg.sr.ht/~cameron-simpson/css/browse/bin/notmuch-search?tip

and I routinely invoke it via a stub script with a shorter name which 
includes the -t option (includes threads containing the matching 
messages).

>Can someone clarify what I can and cannot do with notmuch from *within*
>Mutt?  Provide more informative online articles then perhaps I have found?

You could easily write a mutt macro to invoke such a search from within 
mutt itself. I haven't myself. I just issue a search from the command 
line via my script.

Cheers,
Cameron Simpson 


How to use/integrate "notmuch" with Mutt

2021-02-08 Thread boB Stepp

My online research into "notmuch" does not seem to be giving my expected
results.  My _expectations_ going into this were that with "notmuch" I
could:

1) Open an email in Mutt.

2) Based on that email and its contents assign relevant tags to the email
via notmuch.  These tags would prove useful in the future when searching
for tagged content.

3) From within Mutt I could initiate a notmuch search across _all_ of my
mail directories.  After notmuch returns the search results I could open
any of these emails from within Mutt.

4) Et cetera.  Meaning similar types of actions initiated from *within*
Mutt.  That seems to be key.

Perhaps I am misunderstanding what I am finding online.  I see that
installing notmuch from my system's package manager should be easy, though
I probably won't get the latest, greatest.  Initial configuration would
seems to be easily done from the command line.  Initial indexing seems to
be easily done from the command line.  It looks like I need to install the
notmuch-mutt package.  But after that it does not appear obvious from what
I am reading that my above expectations are realistic.

Can someone clarify what I can and cannot do with notmuch from *within*
Mutt?  Provide more informative online articles then perhaps I have found?

TIA!

--
Wishing you only the best,

boB Stepp