[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs or mutt ?

From: Joost Kremers
Subject: Re: emacs or mutt ?
Date: Sun, 10 Mar 2019 17:16:48 +0100
User-agent: mu4e 1.1.0; emacs 26.1

Hi Philippe,

On Sun, Mar 10 2019, Philippe Delavalade wrote:
I don't know if it is the right place for this question because it truns
around emacs but also around mutt.

I encounter a problem with emacs and mutt under gnu/linux.

In .emacs I have the line :
(add-hook 'text-mode-hook 'turn-on-auto-fill)

In .muttrc I have this line :
set editor="emacs --eval '(text-mode)'"

That looks a bit suspicious to me. I think it's better to put the configuration for the major mode in Emacs' init file. This is what I used to do when I used mutt. First, in .muttrc:

   set editor = emacsclient

(I used emacsclient, which I preferred, but it should work with "set editor = emacs" as well).

Formerly, when writing a message with muut, the buffer was in text-mode
and fill-mode was active.

Today, with emacs 26.1 instead of 25.3 and mutt 1.11.3 instead of
1.10.1, this is no more the case.

When I write a message in mutt, emacs is called but the buffer is in
fundamental mode and I must type M-x auto-fill-mode :-(.

The best way to do this, I think, is to use `auto-mode-alist`. Put this in ~/.emacs.d/init.el:

(add-to-list 'auto-mode-alist '("mutt-[a-z0-9]+-[0-9]+-[0-9]+.*\\'" . message-mode))

In case that wraps badly, that should be a single line, with a space between the dot and `message-mode`.

Note that the regular expression should match the file names that mutt creates. I had this work for me for a long long time, but it's of course possible that the format changes. You'd have to adjust the regexp then.

Note also that this puts mutt messages into `message-mode`, which I prefer, but you can use `text-mode` as well.

That should work, it used to work for me. (I switched to mu4e, but I've been using mutt as a backup until quite recently, so the setup has been tested with Emacs 26).



Joost Kremers
Life has its moments

reply via email to

[Prev in Thread] Current Thread [Next in Thread]