all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* mail-mode: colors in multiply-quoted lines
@ 2011-01-31 14:03 Jesse Sheidlower
  2011-01-31 17:45 ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Jesse Sheidlower @ 2011-01-31 14:03 UTC (permalink / raw)
  To: help-gnu-emacs

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.

mail-mode seems only to colorize all quoted text, i.e. it doesn't color
text differently depending on the level of quoting. Is there any way to
get this functionality? 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.

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?

Thanks.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: mail-mode: colors in multiply-quoted lines
  2011-01-31 14:03 mail-mode: colors in multiply-quoted lines Jesse Sheidlower
@ 2011-01-31 17:45 ` Stefan Monnier
  2011-02-03 11:35   ` Jesse Sheidlower
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Stefan Monnier @ 2011-01-31 17:45 UTC (permalink / raw)
  To: help-gnu-emacs

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

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.

> mail-mode seems only to colorize all quoted text, i.e. it doesn't color
> text differently depending on the level of quoting. Is there any way to
> get this functionality?

Not currently, no.

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

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


        Stefan


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: mail-mode: colors in multiply-quoted lines
  2011-01-31 17:45 ` Stefan Monnier
@ 2011-02-03 11:35   ` Jesse Sheidlower
  2011-02-04 15:30     ` Stefan Monnier
  2011-02-12 18:49   ` Reiner Steib
  2011-02-24 15:28   ` E.
  2 siblings, 1 reply; 8+ messages in thread
From: Jesse Sheidlower @ 2011-02-03 11:35 UTC (permalink / raw)
  To: help-gnu-emacs

In article <jwvlj217z3a.fsf-monnier+gnu.emacs.help@gnu.org>,
Stefan Monnier  <monnier@iro.umontreal.ca> 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.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: mail-mode: colors in multiply-quoted lines
  2011-02-03 11:35   ` Jesse Sheidlower
@ 2011-02-04 15:30     ` Stefan Monnier
  2011-02-07 19:32       ` Jesse Sheidlower
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2011-02-04 15:30 UTC (permalink / raw)
  To: help-gnu-emacs

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

Hmm... I just tried it and indeed the refill doesn't make any sense.
Seems like a plain bug, please report it via M-x report-emacs-bug.

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

Not sure what other problems you're thinking of here.  Or are you
talking about message-mode problems?  If so, just replace mail-mode-hook
for message-mode-hook and that should work for mail-mode.


        Stefan


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: mail-mode: colors in multiply-quoted lines
  2011-02-04 15:30     ` Stefan Monnier
@ 2011-02-07 19:32       ` Jesse Sheidlower
  2011-02-08  4:09         ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Jesse Sheidlower @ 2011-02-07 19:32 UTC (permalink / raw)
  To: help-gnu-emacs

In article <jwv62szyg5c.fsf-monnier+gnu.emacs.help@gnu.org>,
Stefan Monnier  <monnier@iro.umontreal.ca> wrote:
>> 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.
>
>Hmm... I just tried it and indeed the refill doesn't make any sense.
>Seems like a plain bug, please report it via M-x report-emacs-bug.

Done: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7987

Doesn't seem as if there's that much interest in fixing this; or at
least, no one has replied....

>>> 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.
>
>Not sure what other problems you're thinking of here.  Or are you
>talking about message-mode problems?  If so, just replace mail-mode-hook
>for message-mode-hook and that should work for mail-mode.

Well, yes--I meant that if those refill problems in message-mode were
fixed, adding hooks would be an acceptable way of dealing with the
multiple-quoting highlighting. For the moment post-mode is solving this
problem more or less satisfactorily, but I might switch to mail-mode
(with hooks for the quoting) just to stay with something that's core
Emacs.

Thank you.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: mail-mode: colors in multiply-quoted lines
  2011-02-07 19:32       ` Jesse Sheidlower
@ 2011-02-08  4:09         ` Stefan Monnier
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2011-02-08  4:09 UTC (permalink / raw)
  To: help-gnu-emacs

> Doesn't seem as if there's that much interest in fixing this; or at
> least, no one has replied....

Give it time.


        Stefan


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: mail-mode: colors in multiply-quoted lines
  2011-01-31 17:45 ` Stefan Monnier
  2011-02-03 11:35   ` Jesse Sheidlower
@ 2011-02-12 18:49   ` Reiner Steib
  2011-02-24 15:28   ` E.
  2 siblings, 0 replies; 8+ messages in thread
From: Reiner Steib @ 2011-02-12 18:49 UTC (permalink / raw)
  To: help-gnu-emacs

On Mon, Jan 31 2011, Stefan Monnier wrote:

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

,----[ <f1> v gnus-message-highlight-citation RET ]
| gnus-message-highlight-citation is a variable defined in `gnus-msg.el'.
| Its value is t
| 
| Documentation:
| Enable highlighting of different citation levels in message-mode.
| 
| You can customize this variable.
`----

... but because we don't want (more) Gnus dependencies in Message
mode, it is not enabled by default.

After M-: (require 'gnus-msg) RET, M-x gnus-message-citation-mode RET
gives you different colors for each citation level.

See also...

,----[ message.el - `message-yank-original' ]
|       ;; Add `gnus-article-highlight-citation' here?
`----

,----[ gnus-msg.el - `gnus-setup-message' ]
| 	 ;; Enable highlighting of different citation levels
| 	 (when gnus-message-highlight-citation
| 	   (gnus-message-citation-mode 1))
| 	 (gnus-run-hooks 'gnus-message-setup-hook)
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: mail-mode: colors in multiply-quoted lines
  2011-01-31 17:45 ` Stefan Monnier
  2011-02-03 11:35   ` Jesse Sheidlower
  2011-02-12 18:49   ` Reiner Steib
@ 2011-02-24 15:28   ` E.
  2 siblings, 0 replies; 8+ messages in thread
From: E. @ 2011-02-24 15:28 UTC (permalink / raw)
  To: help-gnu-emacs

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

Works perfectly for mail-mode, I added the code to mail-mode-hook
in .emacs (using emacs as an alternate editor for alpine). Thank you!


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-02-24 15:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-31 14:03 mail-mode: colors in multiply-quoted lines Jesse Sheidlower
2011-01-31 17:45 ` Stefan Monnier
2011-02-03 11:35   ` Jesse Sheidlower
2011-02-04 15:30     ` Stefan Monnier
2011-02-07 19:32       ` Jesse Sheidlower
2011-02-08  4:09         ` Stefan Monnier
2011-02-12 18:49   ` Reiner Steib
2011-02-24 15:28   ` E.

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.