help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: mail-mode: colors in multiply-quoted lines


From: Jesse Sheidlower
Subject: Re: mail-mode: colors in multiply-quoted lines
Date: Thu, 3 Feb 2011 11:35:05 +0000 (UTC)

In article <address@hidden>,
Stefan Monnier  <address@hidden> wrote:
>> I'm using mail-mode to compose messages, using Mutt for the actual
>> mailing. That is, I'm only interested in the composition features (good
>> handling of reformatting quoted paragraphs, signatures, etc.), I don't
>> care about the actual sending of messages, so message-mode isn't
>> relevant to me if the only real difference is in the ability to add MIME
>> attachments and so forth.
>
>I recommend you try and use message-mode rather than mail-mode (the
>differences should be minor, other than the new features like MIME
>handling).
>But I don't think that will make a difference to your problem.

I did play around with both modes, and there's a difference in the
paragraph filling that's annoying in message-mode. If I have an indented
section, as for blockquoting:

  Something like this, where I might go on for a while with material
  from some other source that I want to set off

In mail-mode, filling this is fine, it will keep the spaces
between the paragraphs, keep the indentation and
reflow to my fill-column length. But in message-mode, it removes
the spaces between the paragraphs and indents the _second_ line
much farther, giving a complete mess.

I realize that this is probably a minor point compared to the other
differences, and all things being equal I'd rather use the currently
favored main mode for something, but since I'm using this mode _just_
for highlighting/filling purposes, and not for any other mail-sending
reasons, this is a big problem.

>To get this kind of multiple-quoting highlighting, you could do
>something like:
>
>  (add-hook 'message-mode-hook
>            (lambda ()
>              (font-lock-add-keywords nil
>                '(("^[ \t]*>[ \t\f]*>.*$" (0 'foo-face)))))
>
>where `foo-face' is the face you'd like to use for such quoting.

Thanks. If the other problems could be addressed, adding hooks would be
a perfectly acceptable way to deal with this.

>> In the Mutt pager, for example you can specify four different colors
>> for different levels of quoting; it would be nice to get this when
>> I go into the message in Emacs too.
>
>Gnus does it when displaying messages, but not when editing them.
>Bringing the two closer to each other would be good.

The source for message-mode is far too complex for me to be able to work
through it and think about adding this.

>> I've had a look at post-mode, which does do this, but it seems to be not
>> widely used or supported. Is it considered a well-done mode?
>
>I have no idea.

I've played around with this a bit, and in fact it does a very good job
on most of the quoting and reflowing and highlighting issues I care
about. And the source is simple enough that I can probably tweak it
(there are a few problems with the highlighting--spacing issues in the
regexps). If no one uses it, I'd rather stick to a more supported mode,
but for now it does what I want.

Thanks.




reply via email to

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