2020-06-08 aerc config

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?

Tags:

Comments

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?

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


Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. Note: in order to facilitate peer review and fight vandalism, we will store your IP number for a number of days. See Privacy Policy for more information. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.

To save this page you must answer this question:

Just say HELLO