neomutt.vim icon indicating copy to clipboard operation
neomutt.vim copied to clipboard

Errors while opening neomuttrc, and trying to compose an email from neomutt inside neovim's terminal

Open poetaman opened this issue 4 years ago • 6 comments

Hi, I get following error while trying to open file ~/.config/neomutt/neomuttrc

Error detected while processing /Users/reportaman/.vim/plugged/neomutt.vim/syntax/neomuttrc.vim:
line  467:
E696: Missing comma in List: 'crypt_autopgp', 'crypt_autosign', 'crypt_autosmime', 'crypt_confirmhook', 'crypt_replyencrypt', 'crypt_replysign',  'crypt_replysignencrypted', 'edit_hdrs', 'envelope_from', 'forw_decode', 'forw_decrypt', 'forw_quote', 'header_cache_compress', 'ignore_linear_white_space', 'imap_servernoise', 'include_onlyfirst', 'pgp_autoencrypt', 'pgp_autoinline', 'pgp_autosign', 'pgp_auto_traditional', 'pgp_create_traditional', 'pgp_replyencrypt', 'pgp_replyinline',  'pgp_replysign', 'pgp_replysignencrypted', 'ssl_usesystemcerts',  'use_8bitmime', 'virtual_spoolfile', 'xterm_set_titles' ], 1)
E116: Invalid arguments for function <SNR>95_boolQuadGen

System information:

                    'c.          [email protected]
                 ,xNMM.          ----------------------------
               .OMMMMo           OS: macOS 11.2 20D64 arm64
               OMMM0,            Host: Macmini9,1
     .;loddo:' loolloddol;.      Kernel: 20.3.0
   cKMMMMMMMMMMNWMMMMMMMMMM0:    Uptime: 49 mins
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.    Packages: 1 (brew)
 XMMMMMMMMMMMMMMMMMMMMMMMX.      Shell: zsh 5.8
;MMMMMMMMMMMMMMMMMMMMMMMM:       Resolution: 2880x1620
:MMMMMMMMMMMMMMMMMMMMMMMM:       DE: Aqua
.MMMMMMMMMMMMMMMMMMMMMMMMX.      WM: Quartz Compositor
 kMMMMMMMMMMMMMMMMMMMMMMMMWd.    WM Theme: Blue (Dark)
 .XMMMMMMMMMMMMMMMMMMMMMMMMMMk   Terminal: WezTerm
  .XMMMMMMMMMMMMMMMMMMMMMMMMK.   CPU: Apple M1
    kMMMMMMMMMMMMMMMMMMMMMMd     GPU: Apple M1
     ;KMMMMMMMWXXWMMMMMMMk.      Memory: 1891MiB / 16384MiB
       .cooc,.    .,coo:.

Also I do not get any syntax coloring while opening files with name <filename>.neomuttrc, though file .neomuttrc (without prefix <filename>) is colored. What extensions does this color theme apply to?

Also while trying to compose email from an instance neomutt running inside terminal inside neovim, I get the following error:

Error detected while processing /opt/homebrew/Cellar/neovim/HEAD-ad98b84/share/nvim/runtime/plugin/rplugin.vim[65]..function <SNR>75_LoadRemotePlugins[1]..<SNR>75_GetManifest[1].
.<SNR>75_GetManifestPath:
line    7:
E117: Unknown function: stdpath
Press ENTER or type command to continue

poetaman avatar Feb 18 '21 02:02 poetaman

Error detected while processing /Users/reportaman/.vim/plugged/neomutt.vim/syntax/neomuttrc.vim: line 467:

Argh! Sorry about that. Fixed. Thanks

flatcap avatar Feb 18 '21 02:02 flatcap

@flatcap Wow, that's fast! :) Btw, I have updated the bug with another problem, don't know if its related... Will test in some time.

poetaman avatar Feb 18 '21 02:02 poetaman

Also I do not get any syntax coloring while opening files with name <filename>.neomuttrc

The syntax is enabled by a condition in ftdetect/neomuttrc.vim. It lists some file names that are likely to be neomutt config: https://github.com/neomutt/neomutt.vim/blob/15b06057a75e5b648b1c1c692c870bc7f052d0c9/ftdetect/neomuttrc.vim#L1

You can always force the issue by adding a vim 'modeline' to the beginning or end of your config file:

# vim: syn=neomuttrc

flatcap avatar Feb 18 '21 02:02 flatcap

Wow, that's fast!

Luck. You just caught me before bed :-)

Error detected while processing /opt/homebrew/Cellar/neovim/HEAD-ad98b84/share/nvim/runtime/plugin/rplugin.vim[65]..function <SNR>75_LoadRemotePlugins[1]..<SNR>75_GetManifest[1]. .<SNR>75_GetManifestPath: line 7: E117: Unknown function: stdpath

Hmm... I don't understand this one -- I don't think it's NeoMutt-related. I see the same file, rplugin.vim, in my NeoVim install and it contains a stdpath call. According to :help stdpath it's a built-in function.

flatcap avatar Feb 18 '21 02:02 flatcap

@flatcap Thanks a lot! Now I see some lines with white on red background, which I guess is for errors?

Screen Shot 2021-02-17 at 8 49 48 PM

Similarly: Screen Shot 2021-02-17 at 9 00 10 PM

for line:

set index_format="     %zs %zc %zt | %-28.28L  %?X?& ? %.46s %?M10?(%1M)&? %> %{!%a %d %h %H:%M}      "

Also, I figured out the reason why I got: E117: Unknown function: stdpath. That's because my default editor is vim. And given I had neomutt instance running inside neovim, it tried to open vim inside neovim. I always get that error when I try to open a vim instance inside neovim. So I changed my .vimrc to make sure that I open neomutt with editor nvim inside nvim, and I no longer get that problem.

poetaman avatar Feb 18 '21 04:02 poetaman

The first block seem to be a limitation of our syntax highlighting (it's fiendishly complicated :-) Quoting the pattern works around that:

color index color142 color234 "~N"

Changing the format of the conditionals, to use the format %<VAR?TRUE&FALSE> works:

set index_format="     %zs %zc %zt | %-28.28L  %<X?& > %.46s %<M10?(%1M)&> %> %{!%a %d %h %H:%M}      "

More details about that here: https://neomutt.org/feature/nested-if (but it's a hard read)

flatcap avatar Feb 18 '21 11:02 flatcap