unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Joost Kremers <joostkremers@fastmail.fm>
To: help-gnu-emacs@gnu.org
Subject: Re: emacs or mutt ?
Date: Sun, 10 Mar 2019 17:16:48 +0100	[thread overview]
Message-ID: <87bm2iu2kv.fsf@fastmail.fm> (raw)
In-Reply-To: <20190310102332.GA2029@magellan.machin.org>

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).

HTH

Joost


-- 
Joost Kremers
Life has its moments



  reply	other threads:[~2019-03-10 16:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-10 10:23 emacs or mutt ? Philippe Delavalade
2019-03-10 16:16 ` Joost Kremers [this message]
2019-03-10 22:08   ` Philippe Delavalade
2019-03-11  7:53     ` tomas
2019-03-11  9:39       ` Joost Kremers
2019-03-11  9:49         ` tomas
2019-03-13  1:47           ` 황병희
2019-03-13  8:30             ` tomas
2019-03-11  9:50     ` Joost Kremers
2019-03-13  6:42 ` Bob Proulx

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bm2iu2kv.fsf@fastmail.fm \
    --to=joostkremers@fastmail.fm \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).