I’m using aerc as my email client, for the moment. And I’m an Emacs user, of course. so, how is that going to work?
First, I need completion of some email addresses. I’ve decided to use a text file called `~/.addresses` – the format is simple: each line consists of an email address, a tab character, and a name. The reason for the format is that `aerc` allows me to specificy a program that provides possible expansions for a something I’ve typed in just that format. Thus, I can use `grep`!
In `~/.config/aerc/aerc.conf` I have this:
address-book-cmd=grep "%s" /home/alex/.addresses
When composing an email, I want to use Emacs. But there’s a problem: it’s easy to edit the header fields before you’re done editing. Once you’re done editing, you’re “reviewing” your mail. And there’s the problem: if I specify `emacsclient` as my editor, the terminal with `aerc` in it is hidden by Emacs, where I write my email. Then I call `server-edit` to tell Emacs I’m done and switch back to the terminal. Here, `emacsclient` has terminated and thus `aerc` thinks I’m done. I’m now “reviewing” my mail. In order to edit the headers I have to use commands such as `:header To kensanata@gmail.com` and that won’t do.
So, next option: `emacsclient -t` to get Emacs in the terminal!
editor=emacsclient -t
This works well enough until you try to use any of the following keys: `C-x`, `C-k`, `C-j`, `C-p`, `C-n`. That’s because they’re used by `aerc` to enter command mode, prev-field, next-field, prev-tab and next-tab. My solution to that is to comment all the bindings except for `C-j` because that’s the one I hardly ever use in Emacs.
I also need to bind $ex to something. If I don’t, I can’t type the colon in Emacs, and that won’t do: it’s essential! 😀
In `~/.config/aerc/binds.conf` I have this:
[compose::editor] $noinherit = true $ex = <C-^> <C-j> = :next-field<Enter>
Do you have a better idea?
(Please contact me if you want to remove your comment.)
⁂
In ~/.config/aerc/binds.conf I have this:
[compose::editor]
$noinherit = true
$ex = <C-^>
<C-j> = :next-field<Enter>
Do you have a better idea?
[compose::editor] $noinherit = true $ex = <C-^> <C-j> = :next-field<Enter>
Does this let you use `<C-^>` to enter aerc commands?
Both my reading of man aerc-config and my own testing indicate that `<C-^>` isn’t a valid binding, but I would love to learn that I’m mistaken and am just doing something wrong in setting the binding.
– codesections 2020-11-02 17:40 UTC
---
I used it because I had to use something I didn’t actually want to use. But the `aerc-config` man page makes me think it’s legal:
├──────────┼─────────────┤ │c-y │ Ctrl+y │ ├──────────┼─────────────┤ │c-z │ Ctrl+z │ ├──────────┼─────────────┤ │c-] │ Ctrl+] │ ├──────────┼─────────────┤ │c-[ │ Ctrl+[ │ ├──────────┼─────────────┤ │c-^ │ Ctrl+^ │ ├──────────┼─────────────┤ │c- │ Ctrl+ │ └──────────┴─────────────┘
Whether it’s possible to enter this control code at a terminal I don’t know. (This is aerc 4.0.0)
– Alex 2020-11-02 23:18 UTC
---
Thanks – you’re absolutely correct that the man page does indicate that it should work. I don’t know how I missed that.
Nevertheless, as I detailed in the bug I ended up filing, it doesn’t seem to work. And that’s not because I can’t enter `<C-^>`; I can enter that key combo fine in terminal emacs and, as I later figured out, aerc doesn’t seem to work with other `<C-…>` combos either.
If I’m reading your reply correctly, you don’t really value being able to open an aerc command line. Is that correct? If so, I suppose that makes sense – with the correct bindings, I shouldn’t ever need the command line.
Still, something just rubs me the wrong way about not having a keybinding to the command line. It’s like a emacs setup with no way to invoke `M-x`!
– codesections 2020-11-02 23:35 UTC
---
I switched to *aerc* a few weeks ago. Despite a few rough edges, I’m loving it! The last edge I had to smooth-over was handling address autocomplete, and for that, this was a helpful post. Thank you!
I just point aerc to my maildir folder and let it rip, so I needed a script to create an aerc-friendly `.addresses` file from maildir contents. Couldn’t find a ready-made script, so I wrote one. It’s on github if that helps anyone out:
https://github.com/BourgeoisBear/maildir2addr
– Jason Stewart 2022-08-05 03:56 UTC
---
Nice! Perhaps I should give it another try. I did get used to Rmail in the mean time, however. Must think about this. 🤔
– Alex 2022-08-05 09:35 UTC
---
Since *aerc* is mostly a nerd toy (*it’s not like my grandma’s ever going to use it*), it would have made more sense to do things sendmail-style, and scrape headers from the top of the message. Then *aerc* could just shell-out to the editor--altogether bypassing any hotkey conflicts.
That they built a new-ish side-project like *aerc* around terminal-wrapping was asking for trouble. I mean, tmux/screen/vim/emacs obviously work, but it was a long road for all of them, and even then, caveats remain.
All that being said, *aerc* has good bones.
– Jason Stewart 2022-08-05 18:34 UTC
---
Yeah, I just didn’t have the tools to compile it myself (but now I do) and version 0.4.0 crashed whenever I got encrypted mail so effectively it had some serious issues. I compiled the latest from source yesterday and it was still a smooth mail client. All I need now is for somebody to send me encrypted mail for the real test. 😄
– Alex 2022-08-05 18:44 UTC
---
I’m on 0.11.0. I don’t think I’ve encountered any crashes yet, but I have a growing list of functionality bugs, missing features, mis-features--and haven’t even touched mail encryption yet! That, and the current maintainer isn’t particularly responsive. I’d hate to fork it and divide the development effort, but that will probably have to happen. Bugs & all, I’m not going back to webmail, & mutt’s defaults are intolerable.
– Jason Stewart 2022-08-05 18:52 UTC
---
How strange. I thought I had built the latest and have aerc 0.5.2.r51.g8d37356. Now I’m wondering whether I have the right repo. Do you get yours from `https://git.sr.ht/~sircmpwn/aerc`?
– Alex 2022-08-05 19:12 UTC
---
Drew passed the torch to Robin:
https://git.sr.ht/~rjarry/aerc
– Jason Stewart 2022-08-05 19:21 UTC
---
Ah! Thanks.
– Alex 2022-08-05 19:49 UTC
---
Gah. Can no longer install using `sudo make install PREFIX=/usr/local/stow/aerc` in order to use `stow` to manage my `/usr/local`. It remembers the command line used and wants to rebuild it when I use the PREFIX. And if I use `sudo` to `make install` then it can’t find `go` any more since I installed it for my user only. I can see that this is going to be a bit more involved than I initially thought.
`make` as normal. Then `make -n install`, copy the output into a text editor, change all the directory references from `/usr/local` to `/usr/local/stow/aerc`, and add `sudo` to all the install lines, and run that instead. Then proceed as usual: `cd /usr/local/stow && sudo stow aerc`.
And now I have `aerc 0.11.0-85-g6b1afc3ae3d8`. 👍
– Alex 2022-08-05 19:58 UTC