unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Recommended method to pair Notmuch with Neovim?
@ 2023-04-17  2:57 Ralph Seichter
  2023-04-17 12:41 ` Felipe Contreras
  2023-04-23 23:45 ` Ralph Seichter
  0 siblings, 2 replies; 18+ messages in thread
From: Ralph Seichter @ 2023-04-17  2:57 UTC (permalink / raw)
  To: notmuch

Based on the Notmuch documentation [1] and Internet search results,
Felipe Contreras' notmuch-vim plugin [2] used to be a popular method of
combining Notmuch with Vim (at least classic Vim). However, there have
not been any Git repository updates for this plugin for two years, while
Neovim development has been very active during that time. Also, this
particular plugin requires Ruby support in Vim, which I'd rather avoid,
if possible.

  [1] https://git.notmuchmail.org/git/notmuch/blob/HEAD:/vim/README
  [2] https://github.com/felipec/notmuch-vim

My questions are:

1. Do any of you fellow mailing list members use notmuch-vim with
   Neovim?

2. Can you recommend an alternative Notmuch/Neovim plugin?

I am currently using Notmuch with Emacs, but I'd like to find a way to
integrate Notmuch with Neovim instead.

Your feedback is appreciated.

-Ralph

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Recommended method to pair Notmuch with Neovim?
  2023-04-17  2:57 Recommended method to pair Notmuch with Neovim? Ralph Seichter
@ 2023-04-17 12:41 ` Felipe Contreras
  2023-04-17 13:34   ` inwit
  2023-04-17 19:35   ` Ralph Seichter
  2023-04-23 23:45 ` Ralph Seichter
  1 sibling, 2 replies; 18+ messages in thread
From: Felipe Contreras @ 2023-04-17 12:41 UTC (permalink / raw)
  To: Ralph Seichter, notmuch

Ralph Seichter wrote:
> Based on the Notmuch documentation [1] and Internet search results,
> Felipe Contreras' notmuch-vim plugin [2] used to be a popular method of
> combining Notmuch with Vim (at least classic Vim). However, there have
> not been any Git repository updates for this plugin for two years, while
> Neovim development has been very active during that time.

There hasn't been any development because to be frank it just works.

It does everything I need, there's only one patch that I've added that I'm
still not sure how to merge.

I've also started to rewrite it from scratch because a lot of it I think can be
done in a much simpler way, but that doesn't really affect the users, it's just
the maintenance of the code.

> Also, this particular plugin requires Ruby support in Vim, which I'd rather
> avoid, if possible.
> 
>   [1] https://git.notmuchmail.org/git/notmuch/blob/HEAD:/vim/README
>   [2] https://github.com/felipec/notmuch-vim
> 
> My questions are:
> 
> 1. Do any of you fellow mailing list members use notmuch-vim with
>    Neovim?

I still use vim, but I've started to move to neovim (although it still has many
issues for me).

I tried notmuch-vim on neovim with ruby support some time ago and it worked
fine. I think there was some issue with slowness, but they fixed it. I don't
really remember.

> 2. Can you recommend an alternative Notmuch/Neovim plugin?
> 
> I am currently using Notmuch with Emacs, but I'd like to find a way to
> integrate Notmuch with Neovim instead.
> 
> Your feedback is appreciated.

One alternative that I considered is to rewrite notmuch-vim in lua, but that
would probably require some libnotmuch bindings for lua, which would take
considerable amount of time to write. And that would only work for neovim, not
vim.

It might be better to just keep using ruby. It's a fantastic language, there's
already pretty good bindings for libnotmuch, and it works for both vim and
neovim.

I think you should just give it a try.

Cheers.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Recommended method to pair Notmuch with Neovim?
  2023-04-17 12:41 ` Felipe Contreras
@ 2023-04-17 13:34   ` inwit
  2023-04-17 22:22     ` Ralph Seichter
  2023-04-17 19:35   ` Ralph Seichter
  1 sibling, 1 reply; 18+ messages in thread
From: inwit @ 2023-04-17 13:34 UTC (permalink / raw)
  To: Felipe Contreras, Ralph Seichter, notmuch

A different kind of alternative is to use aerc with nvim as an editor. Although
the notmuch interface still has some quirks, I use it daily (and I am quite
happy with it).

El 17/17/2023 a las 2:41, Felipe Contreras dejó escrito:
> Ralph Seichter wrote:
> > Based on the Notmuch documentation [1] and Internet search results,
> > Felipe Contreras' notmuch-vim plugin [2] used to be a popular method of
> > combining Notmuch with Vim (at least classic Vim). However, there have
> > not been any Git repository updates for this plugin for two years, while
> > Neovim development has been very active during that time.
>
> There hasn't been any development because to be frank it just works.
>
> It does everything I need, there's only one patch that I've added that I'm
> still not sure how to merge.
>
> I've also started to rewrite it from scratch because a lot of it I think can be
> done in a much simpler way, but that doesn't really affect the users, it's just
> the maintenance of the code.
>
> > Also, this particular plugin requires Ruby support in Vim, which I'd rather
> > avoid, if possible.
> > 
> >   [1] https://git.notmuchmail.org/git/notmuch/blob/HEAD:/vim/README
> >   [2] https://github.com/felipec/notmuch-vim
> > 
> > My questions are:
> > 
> > 1. Do any of you fellow mailing list members use notmuch-vim with
> >    Neovim?
>
> I still use vim, but I've started to move to neovim (although it still has many
> issues for me).
>
> I tried notmuch-vim on neovim with ruby support some time ago and it worked
> fine. I think there was some issue with slowness, but they fixed it. I don't
> really remember.
>
> > 2. Can you recommend an alternative Notmuch/Neovim plugin?
> > 
> > I am currently using Notmuch with Emacs, but I'd like to find a way to
> > integrate Notmuch with Neovim instead.
> > 
> > Your feedback is appreciated.
>
> One alternative that I considered is to rewrite notmuch-vim in lua, but that
> would probably require some libnotmuch bindings for lua, which would take
> considerable amount of time to write. And that would only work for neovim, not
> vim.
>
> It might be better to just keep using ruby. It's a fantastic language, there's
> already pretty good bindings for libnotmuch, and it works for both vim and
> neovim.
>
> I think you should just give it a try.
>
> Cheers.
>
> -- 
> Felipe Contreras
> _______________________________________________
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-leave@notmuchmail.org
\r

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Recommended method to pair Notmuch with Neovim?
  2023-04-17 12:41 ` Felipe Contreras
  2023-04-17 13:34   ` inwit
@ 2023-04-17 19:35   ` Ralph Seichter
  2023-04-18  0:21     ` Felipe Contreras
  1 sibling, 1 reply; 18+ messages in thread
From: Ralph Seichter @ 2023-04-17 19:35 UTC (permalink / raw)
  To: notmuch

* Felipe Contreras:

> There hasn't been any development because to be frank it just works.

I did not mean to imply that "no repository changes" is necessarily a
bad thing. However, Neovim being quite volatile, I intuitively expected
some form of development for notmuch-vim being necessary to keep things
working.

> I've also started to rewrite it from scratch because a lot of it I
> think can be done in a much simpler way, but that doesn't really
> affect the users, it's just the maintenance of the code.

That tells me you are still invested in the subject, which is a welcome
thing to read.

> I tried notmuch-vim on neovim with ruby support some time ago and it
> worked fine. I think there was some issue with slowness, but they
> fixed it. I don't really remember.

I set up a virtual Ubuntu 22.04 Server with Notmuch for testing, and
managed to get Ruby 3 support for Neovim [1] working. I then used your
plugin via the "Lazy" package manager for Neovim. Some of the basics
work. Navigating and searching look OK, but I have yet to manage to send
email. So far, message bodies are always missing, so it is not usable
yet. Neovim keeps reporting tons of errors when I try to compose and
send email, and I have not yet delved deeper.

[1] https://github.com/neovim/neovim-ruby

> One alternative that I considered is to rewrite notmuch-vim in lua,
> but that would probably require some libnotmuch bindings for lua,
> which would take considerable amount of time to write. And that would
> only work for neovim, not vim.

From what I understand, Vim 9 introduces a new, proprietary scripting
language, while Neovim uses LUA? That seems to foreshadow lots of work
if one wishes to provide plugins that work with both editors.

> It might be better to just keep using ruby. It's a fantastic language,
> there's already pretty good bindings for libnotmuch, and it works for
> both vim and neovim.

Ruby may be a worthwhile language, but in this particular scenario of
Neovim and Notmuch, I see the end user's perspective: I don't need Ruby
to run anything but notmuch-vim, so I don't want to install Ruby on
various systems if it can be avoided. I'll do it if there is no
alternative, but LUA sure sounds better than Ruby to me. Selfish, I
know. ;-)

> I think you should just give it a try.

I began my experiments, but as stated above, I ran into issues that I
have yet to figure out.

Thank you for your response and for your plugin, Felipe.

-Ralph

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Recommended method to pair Notmuch with Neovim?
  2023-04-17 13:34   ` inwit
@ 2023-04-17 22:22     ` Ralph Seichter
  2023-04-17 23:44       ` Jon Fineman
  0 siblings, 1 reply; 18+ messages in thread
From: Ralph Seichter @ 2023-04-17 22:22 UTC (permalink / raw)
  To: notmuch

* inwit@sindominio.net:

> A different kind of alternative is to use aerc with nvim as an editor.

I did not really have a separate mail client in mind, but I experimented
with aerc today. I built aerc from its source code, with Notmuch support
enabled. Alas, I am stuck at launch:

----- 8< ----- snip ----- 8< -----

INFO  2023/04/18 00:09:26.887462 main.go:180: Starting up version 0.14.0-153-g6220711f90d7 +notmuch (go1.19.2 amd64 linux)
INFO  2023/04/18 00:09:26.897506 main.go:132: Terminal does not have status line support
ERROR 2023/04/18 00:09:26.897669 worker.go:83: ProcessAction(*types.Connect) failure: could not connect to notmuch db: Something went wrong trying to read or write a file
ERROR 2023/04/18 00:09:26.899454 account.go:359: [aerc Trial] unexpected error: could not connect to notmuch db: Something went wrong trying to read or write a file
ERROR 2023/04/18 00:09:26.899498 status.go:129: aerc Trial: could not connect to notmuch db: Something went wrong trying to read or write a file

----- 8< ----- snip ----- 8< -----

Not very specific, as error messages go, and searching the Internet did
not lead me to enlightenment. Would you perhaps be willing to share the
contents of your ~/.config/aerc folder (anonymised, of course)?

-Ralph

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Recommended method to pair Notmuch with Neovim?
  2023-04-17 22:22     ` Ralph Seichter
@ 2023-04-17 23:44       ` Jon Fineman
  2023-04-18 19:12         ` Ralph Seichter
  0 siblings, 1 reply; 18+ messages in thread
From: Jon Fineman @ 2023-04-17 23:44 UTC (permalink / raw)
  To: Ralph Seichter, notmuch

Not OP.

Version on Debian:
aerc 0.14.0 +notmuch (go1.19.8 amd64 linux)

accounts.conf:
[jjf-notmuch]
maildir-store   = ~/Maildir
source   = notmuch://~/Maildir
outgoing = /usr/sbin/sendmail
default  = INBOX

Jon


Ralph Seichter <ralph@ml.seichter.de> writes:

> * inwit@sindominio.net:
>
>> A different kind of alternative is to use aerc with nvim as an editor.
>
> I did not really have a separate mail client in mind, but I experimented
> with aerc today. I built aerc from its source code, with Notmuch support
> enabled. Alas, I am stuck at launch:
>
> ----- 8< ----- snip ----- 8< -----
>
> INFO  2023/04/18 00:09:26.887462 main.go:180: Starting up version 0.14.0-153-g6220711f90d7 +notmuch (go1.19.2 amd64 linux)
> INFO  2023/04/18 00:09:26.897506 main.go:132: Terminal does not have status line support
> ERROR 2023/04/18 00:09:26.897669 worker.go:83: ProcessAction(*types.Connect) failure: could not connect to notmuch db: Something went wrong trying to read or write a file
> ERROR 2023/04/18 00:09:26.899454 account.go:359: [aerc Trial] unexpected error: could not connect to notmuch db: Something went wrong trying to read or write a file
> ERROR 2023/04/18 00:09:26.899498 status.go:129: aerc Trial: could not connect to notmuch db: Something went wrong trying to read or write a file
>
> ----- 8< ----- snip ----- 8< -----
>
> Not very specific, as error messages go, and searching the Internet did
> not lead me to enlightenment. Would you perhaps be willing to share the
> contents of your ~/.config/aerc folder (anonymised, of course)?
>
> -Ralph
> _______________________________________________
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-leave@notmuchmail.org

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Recommended method to pair Notmuch with Neovim?
  2023-04-17 19:35   ` Ralph Seichter
@ 2023-04-18  0:21     ` Felipe Contreras
  2023-04-18  6:03       ` Ralph Seichter
  0 siblings, 1 reply; 18+ messages in thread
From: Felipe Contreras @ 2023-04-18  0:21 UTC (permalink / raw)
  To: Ralph Seichter, notmuch

Ralph Seichter wrote:
> * Felipe Contreras:
> 
> > There hasn't been any development because to be frank it just works.
> 
> I did not mean to imply that "no repository changes" is necessarily a
> bad thing. However, Neovim being quite volatile, I intuitively expected
> some form of development for notmuch-vim being necessary to keep things
> working.

I don't see why. neovim aims to support most of what vim does.

And I said: I don't use neovim (yet).

> > I've also started to rewrite it from scratch because a lot of it I
> > think can be done in a much simpler way, but that doesn't really
> > affect the users, it's just the maintenance of the code.
> 
> That tells me you are still invested in the subject, which is a welcome
> thing to read.
> 
> > I tried notmuch-vim on neovim with ruby support some time ago and it
> > worked fine. I think there was some issue with slowness, but they
> > fixed it. I don't really remember.
> 
> I set up a virtual Ubuntu 22.04 Server with Notmuch for testing, and
> managed to get Ruby 3 support for Neovim [1] working. I then used your
> plugin via the "Lazy" package manager for Neovim. Some of the basics
> work. Navigating and searching look OK, but I have yet to manage to send
> email. So far, message bodies are always missing, so it is not usable
> yet. Neovim keeps reporting tons of errors when I try to compose and
> send email, and I have not yet delved deeper.

Did you install the "mail" gem as the installation instructions recommend?

  % gem install mail

It should actually be a requirement, but I haven't updated the instructions to
say that.

> > One alternative that I considered is to rewrite notmuch-vim in lua,
> > but that would probably require some libnotmuch bindings for lua,
> > which would take considerable amount of time to write. And that would
> > only work for neovim, not vim.
> 
> From what I understand, Vim 9 introduces a new, proprietary scripting
> language, while Neovim uses LUA? That seems to foreshadow lots of work
> if one wishes to provide plugins that work with both editors.

But you don't have to use Vim 9. The old language will keep working.

> > It might be better to just keep using ruby. It's a fantastic language,
> > there's already pretty good bindings for libnotmuch, and it works for
> > both vim and neovim.
> 
> Ruby may be a worthwhile language, but in this particular scenario of
> Neovim and Notmuch, I see the end user's perspective: I don't need Ruby
> to run anything but notmuch-vim, so I don't want to install Ruby on
> various systems if it can be avoided.

Ruby is already installed on most systems I use, and it's only like 10 MiB.

I believe one should use the best language for the task, and in this case that
language is clearly Ruby.

> I'll do it if there is no alternative, but LUA sure sounds better than Ruby
> to me. Selfish, I know. ;-)

It sounds better to you as a user.

Just try to program a paginated list of items in Lua and you might change your
mind.

> > I think you should just give it a try.
> 
> I began my experiments, but as stated above, I ran into issues that I
> have yet to figure out.
> 
> Thank you for your response and for your plugin, Felipe.

I would try in vim as well, just so you see how it's supposed to work.

To be frank notmuch-vim is so superior to anything I've used, that even if I
move completey to neovim and it doesn't work there, I would keep using vim just
for this tool.

Cheers.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Recommended method to pair Notmuch with Neovim?
  2023-04-18  0:21     ` Felipe Contreras
@ 2023-04-18  6:03       ` Ralph Seichter
  2023-04-18  7:22         ` Felipe Contreras
  0 siblings, 1 reply; 18+ messages in thread
From: Ralph Seichter @ 2023-04-18  6:03 UTC (permalink / raw)
  To: notmuch

* Felipe Contreras:

> neovim aims to support most of what vim does.

At the time of me writing this, the Neovim tracker on GitHub lists a
whopping 1380 open issues, so I'd imagine that goal has not yet been
reached. ;-)

> Did you install the "mail" gem as the installation instructions
> recommend?

I did indeed. The message header was sent during each of my tests, but
not the body text.

> It sounds better to you as a user.
>
> Just try to program a paginated list of items in Lua and you might
> change your mind.

I am grateful for you investing time and effort in your plugin, and I
don't want to talk you out of using Ruby, if that is your language of
choice. My choice would be different, but that is off topic. I'd be glad
to get notmuch-vim working with Neovim, even if that means installing
Ruby. Currently the log file looks like this:

INFO  2023/04/18 07:27:20.254544 main.go:180: Starting up version 0.14.0-153-g6220711f90d7 +notmuch (go1.19.2 amd64 linux)
DEBUG 2023/04/18 07:27:20.254639 crypto.go:36: no internal pgp keyring, using system gpg
DEBUG 2023/04/18 07:27:20.263046 receive.go:30: Starting Unix server: /run/user/1000/aerc.sock
DEBUG 2023/04/18 07:27:20.264202 main.go:136: Setting terminal title
INFO  2023/04/18 07:27:20.269082 account.go:250: [Trial] connected.
ERROR 2023/04/18 07:28:07.049184 status.go:129: Cannot perform action. Messages still loading
DEBUG 2023/04/18 07:28:07.049322 status.go:104: Cannot perform action. Messages still loading

aerc displays "(no folders)" and "(no messages)", on startup, so I
thought I'd try the search function with "date:yesterday..", causing the
"Message still loading" error. Running "notmuch search date:yesterday.."
in a shell returns the expected results.

> I would try in vim as well, just so you see how it's supposed to work.

I guess I should do that. Right now, I don't know if my troubles are
caused by me somehow screwing up the notmuch-vim configuration or by
Neovim quirks. Speaking of my configuration:

# Content of /home/trial/.config/aerc/accounts.conf
[Trial]
from = Trial User <trial@example.com>
maildir-store = /home/trial/.mail
source = notmuch:///home/trial
outgoing = /usr/sbin/sendmail

-Ralph

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Recommended method to pair Notmuch with Neovim?
  2023-04-18  6:03       ` Ralph Seichter
@ 2023-04-18  7:22         ` Felipe Contreras
  2023-04-18 18:03           ` Ralph Seichter
  0 siblings, 1 reply; 18+ messages in thread
From: Felipe Contreras @ 2023-04-18  7:22 UTC (permalink / raw)
  To: Ralph Seichter, notmuch

Ralph Seichter wrote:
> * Felipe Contreras:
> 
> > neovim aims to support most of what vim does.
> 
> At the time of me writing this, the Neovim tracker on GitHub lists a
> whopping 1380 open issues, so I'd imagine that goal has not yet been
> reached. ;-)

I imagine many of those issues are not related to vim compatibility.

> > Did you install the "mail" gem as the installation instructions
> > recommend?
> 
> I did indeed. The message header was sent during each of my tests, but
> not the body text.

I just installed neovim-ruby and tried to send an email with
neovim+notmuch-vim: it was sent just fine.

Note that notmuch-vim sends email using the `sendmail` command. Do you have
that properly configured?

How would you send email from the command line?

> > It sounds better to you as a user.
> >
> > Just try to program a paginated list of items in Lua and you might
> > change your mind.
> 
> I am grateful for you investing time and effort in your plugin, and I
> don't want to talk you out of using Ruby, if that is your language of
> choice.

I have no problem using another language, since anyway I'm planning on
rewriting the whole thing.

But it has to be the right language, and right now the right language seems to
be Ruby.

I'd be happy to consider other alternatives, but at this point which are those?

> My choice would be different, but that is off topic. I'd be glad to get
> notmuch-vim working with Neovim, even if that means installing Ruby.
> Currently the log file looks like this:
> 
> INFO  2023/04/18 07:27:20.254544 main.go:180: Starting up version 0.14.0-153-g6220711f90d7 +notmuch (go1.19.2 amd64 linux)
> DEBUG 2023/04/18 07:27:20.254639 crypto.go:36: no internal pgp keyring, using system gpg
> DEBUG 2023/04/18 07:27:20.263046 receive.go:30: Starting Unix server: /run/user/1000/aerc.sock
> DEBUG 2023/04/18 07:27:20.264202 main.go:136: Setting terminal title
> INFO  2023/04/18 07:27:20.269082 account.go:250: [Trial] connected.
> ERROR 2023/04/18 07:28:07.049184 status.go:129: Cannot perform action. Messages still loading
> DEBUG 2023/04/18 07:28:07.049322 status.go:104: Cannot perform action. Messages still loading
> 
> aerc displays "(no folders)" and "(no messages)", on startup, so I
> thought I'd try the search function with "date:yesterday..", causing the
> "Message still loading" error. Running "notmuch search date:yesterday.."
> in a shell returns the expected results.

That's aerc, nothing to do with notmuch-vim.

Are you getting the two confused?

> > I would try in vim as well, just so you see how it's supposed to work.
> 
> I guess I should do that. Right now, I don't know if my troubles are
> caused by me somehow screwing up the notmuch-vim configuration or by
> Neovim quirks. Speaking of my configuration:
> 
> # Content of /home/trial/.config/aerc/accounts.conf
> [Trial]
> from = Trial User <trial@example.com>
> maildir-store = /home/trial/.mail
> source = notmuch:///home/trial
> outgoing = /usr/sbin/sendmail

Again: that's not notmuch-vim.

Cheers.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Recommended method to pair Notmuch with Neovim?
  2023-04-18  7:22         ` Felipe Contreras
@ 2023-04-18 18:03           ` Ralph Seichter
  2023-04-18 23:43             ` Felipe Contreras
  0 siblings, 1 reply; 18+ messages in thread
From: Ralph Seichter @ 2023-04-18 18:03 UTC (permalink / raw)
  To: notmuch

* Felipe Contreras:

> I just installed neovim-ruby and tried to send an email with
> neovim+notmuch-vim: it was sent just fine.

That's good to hear. Hopefully I am just doing something wrong, which
would be easiest to fix (at least if I knew what that "something" was).

Today I have compiled Vim 9 from source code; Ruby support included.
I added the vim-plug plugin manager, installed notmuch-vim via

  Plug 'felipec/notmuch-vim'

et voilà, it works. That includes sending email. Nice. Now I have a
basis to familiarise myself with notmuch-vim. If only I could get it to
work with Neovim, like you did, I'd be all set.

> I'd be happy to consider other alternatives, but at this point which
> are those?

Anything that is fast and can use libnotmuch, probably? Go comes to
mind. Or even Zig.

> That's aerc, nothing to do with notmuch-vim.
>
> Are you getting the two confused?

Yeah, sorry, that part of my response was related to Jon Fineman's
latest message. I was doing too many things at once yesterday.

-Ralph\r

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Recommended method to pair Notmuch with Neovim?
  2023-04-17 23:44       ` Jon Fineman
@ 2023-04-18 19:12         ` Ralph Seichter
  2023-04-18 21:31           ` Jon Fineman
  0 siblings, 1 reply; 18+ messages in thread
From: Ralph Seichter @ 2023-04-18 19:12 UTC (permalink / raw)
  To: notmuch

* Jon Fineman:

> [jjf-notmuch]
> maildir-store = ~/Maildir
> source = notmuch://~/Maildir
> outgoing = /usr/sbin/sendmail
> default = INBOX

Thanks, Jon. Alas, this does not work for me. Does your .notmuch-config
contain something the following:

  [database]
  path=/full/path/to/your/Maildir

and is your Notmuch DB directory /full/path/to/your/Maildir/.notmuch ,
i.e. nested inside your Maildir folder?

-Ralph

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Recommended method to pair Notmuch with Neovim?
  2023-04-18 19:12         ` Ralph Seichter
@ 2023-04-18 21:31           ` Jon Fineman
  2023-04-18 22:47             ` Ralph Seichter
  0 siblings, 1 reply; 18+ messages in thread
From: Jon Fineman @ 2023-04-18 21:31 UTC (permalink / raw)
  To: Ralph Seichter, notmuch


Ralph Seichter <ralph@ml.seichter.de> writes:

> * Jon Fineman:
>
>> [jjf-notmuch]
>> maildir-store = ~/Maildir
>> source = notmuch://~/Maildir
>> outgoing = /usr/sbin/sendmail
>> default = INBOX
>
> Thanks, Jon. Alas, this does not work for me. Does your .notmuch-config
> contain something the following:
>
>   [database]
>   path=/full/path/to/your/Maildir

Yes
[database]
path=/home/jjf/Maildir

>
> and is your Notmuch DB directory /full/path/to/your/Maildir/.notmuch ,
> i.e. nested inside your Maildir folder?
Yes.

>
> -Ralph
> _______________________________________________
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-leave@notmuchmail.org

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Recommended method to pair Notmuch with Neovim?
  2023-04-18 21:31           ` Jon Fineman
@ 2023-04-18 22:47             ` Ralph Seichter
  2023-04-19  2:19               ` James Cook
  0 siblings, 1 reply; 18+ messages in thread
From: Ralph Seichter @ 2023-04-18 22:47 UTC (permalink / raw)
  To: notmuch

Jon Fineman wrote:

> [database]
> path=/home/jjf/Maildir
>
> > and is your Notmuch DB directory /full/path/to/your/Maildir/.notmuch ,
> > i.e. nested inside your Maildir folder?
> Yes.

Then our respective directory paths are similar. aerc still does not
work for me, though. I had suspected that the nested directories might
be causing trouble for me, but that's apparently not the case.

-Ralph

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Recommended method to pair Notmuch with Neovim?
  2023-04-18 18:03           ` Ralph Seichter
@ 2023-04-18 23:43             ` Felipe Contreras
  0 siblings, 0 replies; 18+ messages in thread
From: Felipe Contreras @ 2023-04-18 23:43 UTC (permalink / raw)
  To: Ralph Seichter, notmuch

Ralph Seichter wrote:
> * Felipe Contreras:
> 
> > I just installed neovim-ruby and tried to send an email with
> > neovim+notmuch-vim: it was sent just fine.
> 
> That's good to hear. Hopefully I am just doing something wrong, which
> would be easiest to fix (at least if I knew what that "something" was).
> 
> Today I have compiled Vim 9 from source code; Ruby support included.
> I added the vim-plug plugin manager, installed notmuch-vim via
> 
>   Plug 'felipec/notmuch-vim'
> 
> et voilà, it works. That includes sending email. Nice. Now I have a
> basis to familiarise myself with notmuch-vim. If only I could get it to
> work with Neovim, like you did, I'd be all set.

Maybe you try to add some debugging around s:compose_send() to see what's going
on.

> > I'd be happy to consider other alternatives, but at this point which
> > are those?
> 
> Anything that is fast and can use libnotmuch, probably? Go comes to
> mind. Or even Zig.

I like Zig, but I'm not sure it's ready and I can't imagine how to write a vim
plugin with it.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Recommended method to pair Notmuch with Neovim?
  2023-04-18 22:47             ` Ralph Seichter
@ 2023-04-19  2:19               ` James Cook
  2023-04-19  7:30                 ` Michael J Gruber
  0 siblings, 1 reply; 18+ messages in thread
From: James Cook @ 2023-04-19  2:19 UTC (permalink / raw)
  To: notmuch

On Wed, Apr 19, 2023 at 12:47:24AM +0200, Ralph Seichter wrote:
> Jon Fineman wrote:
> 
> > [database]
> > path=/home/jjf/Maildir
> >
> > > and is your Notmuch DB directory /full/path/to/your/Maildir/.notmuch ,
> > > i.e. nested inside your Maildir folder?
> > Yes.
> 
> Then our respective directory paths are similar. aerc still does not
> work for me, though. I had suspected that the nested directories might
> be causing trouble for me, but that's apparently not the case.
> 
> -Ralph

You could try tracing aerc's systems calls (e.g. ktrace on BSD, strace
on Linux) to see what file it's trying to access.

Incidentally, my current favourite notmuch client is neomutt. It
probably helps that I'm already used to it. I tried notmuch-emacs and
aerc, and they were okay, though aerc seemed a bit buggy (but that was a
while ago). I tried meli but it wasn't ready yet (maybe it is now?). I
haven't tried notmuch-vim.

-- 
James

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Recommended method to pair Notmuch with Neovim?
  2023-04-19  2:19               ` James Cook
@ 2023-04-19  7:30                 ` Michael J Gruber
  2023-04-19 15:57                   ` James Cook
  0 siblings, 1 reply; 18+ messages in thread
From: Michael J Gruber @ 2023-04-19  7:30 UTC (permalink / raw)
  To: James Cook, notmuch

James Cook venit, vidit, dixit 2023-04-19 04:19:25:
> On Wed, Apr 19, 2023 at 12:47:24AM +0200, Ralph Seichter wrote:
> > Jon Fineman wrote:
> > 
> > > [database]
> > > path=/home/jjf/Maildir
> > >
> > > > and is your Notmuch DB directory /full/path/to/your/Maildir/.notmuch ,
> > > > i.e. nested inside your Maildir folder?
> > > Yes.
> > 
> > Then our respective directory paths are similar. aerc still does not
> > work for me, though. I had suspected that the nested directories might
> > be causing trouble for me, but that's apparently not the case.
> > 
> > -Ralph
> 
> You could try tracing aerc's systems calls (e.g. ktrace on BSD, strace
> on Linux) to see what file it's trying to access.
> 
> Incidentally, my current favourite notmuch client is neomutt. It
> probably helps that I'm already used to it. I tried notmuch-emacs and
> aerc, and they were okay, though aerc seemed a bit buggy (but that was a
> while ago). I tried meli but it wasn't ready yet (maybe it is now?). I
> haven't tried notmuch-vim.

Is there any good documentation on neomutt's notmuch support beyond what
is on their website? I currently use alot for its great notmuch support
(in particular tag completion with search and tag inyterfaces, multiple
"tabs"/views) but find myself switching to neomutt for its better mime
support (plus s/mime) and features like thread split & join, so far
mostly maildir backed. neomutt's doc probably tell you everything you
need to know to set up a notmuch-friendly user experience, but ...
I know multiple views will not be a thing in neomutt. Easy tagging and
nm-based search are a must, though. Being able to switch to the "maildir
view" of a message (so that you can rearrange messages within your
maildir folder tree) would be a plus.

Michael

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Recommended method to pair Notmuch with Neovim?
  2023-04-19  7:30                 ` Michael J Gruber
@ 2023-04-19 15:57                   ` James Cook
  0 siblings, 0 replies; 18+ messages in thread
From: James Cook @ 2023-04-19 15:57 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: notmuch

> Is there any good documentation on neomutt's notmuch support beyond what
> is on their website? I currently use alot for its great notmuch support
> (in particular tag completion with search and tag inyterfaces, multiple
> "tabs"/views) but find myself switching to neomutt for its better mime
> support (plus s/mime) and features like thread split & join, so far
> mostly maildir backed. neomutt's doc probably tell you everything you
> need to know to set up a notmuch-friendly user experience, but ...
> I know multiple views will not be a thing in neomutt. Easy tagging and
> nm-based search are a must, though. Being able to switch to the "maildir
> view" of a message (so that you can rearrange messages within your
> maildir folder tree) would be a plus.
> 
> Michael

I referred to this page a lot:

https://neomutt.org/feature/notmuch

There was an 11-month gap between releases (due to lingering bugs) so I
suggest trying to get a version released this year (though the 20220429
version was working pretty well for me too).

Searching:

The vfolder-from-query command lets you type a notmuch search query and
shows the results like a folder. To refresh the folder's content (e.g.
after updating tags) I find it helpful to type "c" to switch folders,
and type "^" as the folder name, which means "the folder I'm already
at". For some reason "$" doesn't cause the folder to reload.

The "entire-thread" command is useful too: if your search pulls in some
emails from a thread and you want to see the reast, simply run the
"entire-thread" command (I bind it to "+") with the cursor on one of
them, and the rest will be added to the current virtual mailbox.

Tagging:

The modify-labels command lets you type e.g. "-inbox +spam" to change
tags. It has tab completion. I've been meaning to add custom shortcuts
for comman changes I make, e.g. -inbox.

Maildir view:

I don't know exactly what you mean by switching to the maildir view of a
message. You can freely switch between real maildirs and notmuch search
results when changing folders (see vfolder-from-query). Maybe you want a
way to automatically go to the real Maildir folder containing the
selected search result; I don't know if that's possible (and there could
be ambiguity if files in different folders have the same message id).
You might have to run "notmuch new" after making maildir changes?

Other / example config:

"%g" in the index_format option shows a message's tags.

I've copied most of my own config below the signature.

-- 
James


##
## Folder configuration
##

set folder=~/var/mbsync/falsifian.org
set spool_file="notmuch inbox"
set postponed=+Drafts
set record=+Sent

##
## Notmuch and mailboxes
##

set nm_db_limit=10000
set nm_exclude_tags="spam"
set nm_record=yes

named-mailboxes "notmuch inbox" "notmuch://?query=tag:inbox and not tag:reading"

##
## Aliases
##

alias a-b agora-business@agoranomic.org
# etc...; instead of aliases, I mostly use my address book stored in khard by
# pressing ctrl-T after typing the beginning of a name; see the "query_command"
# option below.

##
## Key bindings, including macros
##

# Make it (hopefully) really hard to accidentally delete messages.
unbind * d
unbind * "\Cd"

bind index S vfolder-from-query

# From https://neomutt.org/feature/custom-tags
bind index,pager \` modify-labels

# From https://neomutt.org/feature/notmuch
bind index,pager + entire-thread

##
## Miscellaneous
##

set forward_format="Fwd: %s"
set from="James Cook <falsifian@falsifian.org>"
set index_format="%[%g%m%d %H%M] %Z %-15.15L %s%* |%g %?E?%e/%E?"
set pager_index_lines=5
set pager_stop
set query_command="khard email --parsable %s"
set send_charset="utf-8"
# Without this, sending mail from a DragonflyBSD machine via my SMTP server to the Agora mail lists fails because the envelope-from ends up being falsifian@<machine hostname> instead of agora@falsifian.org.
set use_envelope_from=yes

# I don't know if these are relevant to notmuch; I added these lines when I was
# using IMAP with neomutt.
#
# Caching. header_cache_backend is appended later by drist script.
# Use the same directory for both caches. (The manual says this will work.)
set header_cache="~/.cache/neomutt"
set message_cachedir="~/.cache/neomutt"

# Per-recipient settings, and generic default settings. (Without the default
# send-hook, the per-recipient settings would stick, since they last until the
# end of the session.)

send-hook . 'unmy_hdr From: ; set signature="echo James|"'
send-hook '~t ^(agora-.*@agoranomic.org\|agora@listserver.tue.nl)$' 'my_hdr From: Falsifian <agora@falsifian.org> ; set signature="echo Falsifian|"'

# Header weeding and ordering
ignore *
unignore from date subject to cc list-id reply-to
hdr_order subject from date to cc list-id reply-to
set header_cache_backend="kyotocabinet"

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Recommended method to pair Notmuch with Neovim?
  2023-04-17  2:57 Recommended method to pair Notmuch with Neovim? Ralph Seichter
  2023-04-17 12:41 ` Felipe Contreras
@ 2023-04-23 23:45 ` Ralph Seichter
  1 sibling, 0 replies; 18+ messages in thread
From: Ralph Seichter @ 2023-04-23 23:45 UTC (permalink / raw)
  To: notmuch

Side note for the morbidly curious: Getting notmuch-vim operational on
my production servers took some work. Gentoo Linux's net-mail/notmuch
ebuild does not currently create Ruby bindings (only Python).

Given that Gentoo supports packages having multiple versions installed
simultaneously, Ruby for instance, extending the ebuild is not trivial.
I got it working specifically for my own machines, but my ebuild variant
would not yet pass Gentoo's QA checks.

-Ralph

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-04-23 23:45 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-17  2:57 Recommended method to pair Notmuch with Neovim? Ralph Seichter
2023-04-17 12:41 ` Felipe Contreras
2023-04-17 13:34   ` inwit
2023-04-17 22:22     ` Ralph Seichter
2023-04-17 23:44       ` Jon Fineman
2023-04-18 19:12         ` Ralph Seichter
2023-04-18 21:31           ` Jon Fineman
2023-04-18 22:47             ` Ralph Seichter
2023-04-19  2:19               ` James Cook
2023-04-19  7:30                 ` Michael J Gruber
2023-04-19 15:57                   ` James Cook
2023-04-17 19:35   ` Ralph Seichter
2023-04-18  0:21     ` Felipe Contreras
2023-04-18  6:03       ` Ralph Seichter
2023-04-18  7:22         ` Felipe Contreras
2023-04-18 18:03           ` Ralph Seichter
2023-04-18 23:43             ` Felipe Contreras
2023-04-23 23:45 ` Ralph Seichter

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).