GNU bug report logs - #7987
message-mode perhaps to document more that it expects mail-header-separator

Previous Next

Packages: gnus, emacs;

Reported by: Jesse Sheidlower <jester <at> panix.com>

Date: Sat, 5 Feb 2011 03:18:02 UTC

Severity: minor

Tags: notabug, wontfix

Merged with 8594

Found in version 23.2

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 7987 in the body.
You can then email your comments to 7987 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7987; Package emacs. (Sat, 05 Feb 2011 03:18:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jesse Sheidlower <jester <at> panix.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 05 Feb 2011 03:18:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jesse Sheidlower <jester <at> panix.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.2; Refill error in message-mode
Date: Fri, 04 Feb 2011 22:18:14 -0500
In message-mode, there is an error in the fill command when you try to
refill indented (blockquoted) paragraphs. Instead of filling the
indented paragraph in-place, it removes empty lines before and after the
blockquote, indents the first line further, and then indents the second
and subsequent lines further still, leading to a mess.

Recipe: 

$ emacs -Q
M-x message-mode
(type or paste the following text, not including dashes):

---
I read with great interest your text, the "Declaration of Independence,"
and I was particularly taken with the introduction:

  When in the Course of human events it becomes necessary for one people
  to dissolve the 
  political bands which have connected them with another
  and to assume among the powers of the earth, the separate 
  and equal
  station to which the Laws of Nature and of Nature's God entitle them,
  a decent respect to the opinions of mankind requires 
  that they should
  declare the causes which impel them to the separation.

I do think this is one of my favorite passages. Thank you.
---

Position point anywhere in the indented section, and type M-q.  The text
will be refilled such that there's no space before or after the indented
paragraph, the first line of the indented paragraph will be indented
four spaces, and the second and subsequent lines should be indented
eight spaces.

By comparison, doing the same thing in mail-mode yields what I would
consider the expected result: the indentation is the same, there is
still space before and after the paragraph, and the lines are of roughly
equal, filled length. The behavior in message-mode should parallel this.

Thank you.

In GNU Emacs 23.2.1 (i386-unknown-netbsdelf5.0, X toolkit, Xaw3d scroll bars)
 of 2010-07-30 on juggler.panix.com
configured using `configure  '--prefix=/pkg/emacs-23.2-x' '--mandir=/pkg/emacs-23.2-x/man' 'CFLAGS=-fstack-protector -D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: en_US.UTF-8
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
ESC [ > 1 ; 2 4 0 3 ; 0 c ESC x r e p o r t TAB RE
T

Recent messages:
("/usr/local/bin/emacs.new")
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
/pkg/emacs-23.2-x/share/emacs/site-lisp/url hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/url/url
/pkg/emacs-23.2-x/share/emacs/site-lisp/url-vars hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/url/url-vars
/pkg/emacs-23.2-x/share/emacs/site-lisp/url-parse hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/url/url-parse
/pkg/emacs-23.2-x/share/emacs/site-lisp/url-ns hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/url/url-ns
/pkg/emacs-23.2-x/share/emacs/site-lisp/url-nfs hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/url/url-nfs
/pkg/emacs-23.2-x/share/emacs/site-lisp/url-news hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/url/url-news
/pkg/emacs-23.2-x/share/emacs/site-lisp/url-misc hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/url/url-misc
/pkg/emacs-23.2-x/share/emacs/site-lisp/url-ldap hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/url/url-ldap
/pkg/emacs-23.2-x/share/emacs/site-lisp/url-irc hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/url/url-irc
/pkg/emacs-23.2-x/share/emacs/site-lisp/url-http hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/url/url-http
/pkg/emacs-23.2-x/share/emacs/site-lisp/url-gw hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/url/url-gw
/pkg/emacs-23.2-x/share/emacs/site-lisp/url-file hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/url/url-file
/pkg/emacs-23.2-x/share/emacs/site-lisp/url-cookie hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/url/url-cookie
/pkg/emacs-23.2-x/share/emacs/site-lisp/url-cid hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/url/url-cid
/pkg/emacs-23.2-x/share/emacs/site-lisp/url-cache hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/url/url-cache
/pkg/emacs-23.2-x/share/emacs/site-lisp/url-auth hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/url/url-auth
/pkg/emacs-23.2-x/share/emacs/site-lisp/socks hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/net/socks
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-yank hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-yank
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-vec hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-vec
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-units hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-units
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-undo hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-undo
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-trail hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-trail
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-stuff hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-stuff
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-store hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-store
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-stat hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-stat
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-sel hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-sel
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-rules hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-rules
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-rewr hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-rewr
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-prog hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-prog
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-poly hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-poly
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-mode hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-mode
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-misc hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-misc
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-math hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-math
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-map hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-map
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-macs hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-macs
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-lang hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-lang
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-keypd hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-keypd
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-incom hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-incom
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-help hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-help
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-graph hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-graph
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-funcs hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-funcs
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-frac hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-frac
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-forms hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-forms
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-fin hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-fin
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-ext hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-ext
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-embed hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-embed
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-cplx hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-cplx
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-comb hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-comb
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-bin hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-bin
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-arith hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-arith
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-alg hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-alg
/pkg/emacs-23.2-x/share/emacs/site-lisp/calc/calc-aent hides /pkg/emacs-23.2-x/share/emacs/23.2/lisp/calc/calc-aent

Features:
(shadow sort mail-extr message sendmail regexp-opt ecomplete rfc822 mml
easymenu mml-sec password-cache mm-decode mm-bodies mm-encode mailcap
mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader
gnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-edit
mailheader canlock sha1 hex-util hashcash mail-utils emacsbug tooltip
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer
select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu
font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces
cus-face files text-properties overlay md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote
make-network-process x-toolkit x multi-tty emacs)




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7987; Package emacs. (Mon, 07 Feb 2011 20:36:02 GMT) Full text and rfc822 format available.

Message #8 received at 7987 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Jesse Sheidlower <jester <at> panix.com>
Cc: 7987 <at> debbugs.gnu.org
Subject: Re: bug#7987: 23.2; Refill error in message-mode
Date: Mon, 07 Feb 2011 15:43:54 -0500
Jesse Sheidlower wrote:

> $ emacs -Q
> M-x message-mode
> (type or paste the following text, not including dashes):
>
> ---
> I read with great interest your text, the "Declaration of Independence,"
> and I was particularly taken with the introduction:
>
>   When in the Course of human events it becomes necessary for one people
>   to dissolve the 
>   political bands which have connected them with another
>   and to assume among the powers of the earth, the separate 
>   and equal
>   station to which the Laws of Nature and of Nature's God entitle them,
>   a decent respect to the opinions of mankind requires 
>   that they should
>   declare the causes which impel them to the separation.
>
> I do think this is one of my favorite passages. Thank you.
> ---
>
> Position point anywhere in the indented section, and type M-q.  The text
> will be refilled such that there's no space before or after the indented
> paragraph, the first line of the indented paragraph will be indented
> four spaces, and the second and subsequent lines should be indented
> eight spaces.


This is an artificial example because it is not how a mail buffer
normally looks. The message filling code does different things in the
header and in the body of an email. Since your example does not contain
`mail-header-separator', message thinks it is in the header and fills
accordingly. If you insert `mail-header-separator' at the start of your
example buffer, message fills the paragraph correctly.

Do you have an example of an actual mail composition buffer where the
message filling code does the wrong thing?




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7987; Package emacs. (Tue, 08 Feb 2011 15:36:01 GMT) Full text and rfc822 format available.

Message #11 received at 7987 <at> debbugs.gnu.org (full text, mbox):

From: Jesse Sheidlower <jester <at> panix.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 7987 <at> debbugs.gnu.org
Subject: Re: bug#7987: 23.2; Refill error in message-mode
Date: Tue, 8 Feb 2011 10:44:19 -0500
On Mon, Feb 07, 2011 at 03:43:54PM -0500, Glenn Morris wrote:
> Jesse Sheidlower wrote:
> 
> > $ emacs -Q
> > M-x message-mode
> > (type or paste the following text, not including dashes):
> >
> > ---
> > I read with great interest your text, the "Declaration of Independence,"
> > and I was particularly taken with the introduction:
> >
> >   When in the Course of human events it becomes necessary for one people
> >   to dissolve the 
> >   political bands which have connected them with another
> >   and to assume among the powers of the earth, the separate 
> >   and equal
> >   station to which the Laws of Nature and of Nature's God entitle them,
> >   a decent respect to the opinions of mankind requires 
> >   that they should
> >   declare the causes which impel them to the separation.
> >
> > I do think this is one of my favorite passages. Thank you.
> > ---
> >
> > Position point anywhere in the indented section, and type M-q.  The text
> > will be refilled such that there's no space before or after the indented
> > paragraph, the first line of the indented paragraph will be indented
> > four spaces, and the second and subsequent lines should be indented
> > eight spaces.
> 
> This is an artificial example because it is not how a mail buffer
> normally looks. The message filling code does different things in the
> header and in the body of an email. Since your example does not contain
> `mail-header-separator', message thinks it is in the header and fills
> accordingly. If you insert `mail-header-separator' at the start of your
> example buffer, message fills the paragraph correctly.
> 
> Do you have an example of an actual mail composition buffer where the
> message filling code does the wrong thing?

Hmm. I guess you're right, although this behavior doesn't seem to be
mentioned in the Manual. I'm using message-mode with Mutt, so there are
no headers in the buffer. 

The EmacsWiki page on MuttInEmacs does give a code sample (apparently
problematic, as there are various kludgy-looking updates) that 'sets
mail-header-separator to "" for M-q and auto-fill to work correctly', so
the fact that it doesn't normally "work correctly" does seem to be known
behavior. But for what it's worth, one of the Emacs maintainers did look
this over and think it was a bug, so I'm not the only one confused.

I'll experiment further and will update if necessary. Is there a
preferred way to tell message-mode to assume that the buffer is a
message body, rather than a header?

Thanks for the reply.

Jesse Sheidlower




bug reassigned from package 'emacs' to 'emacs,gnus'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 08 Feb 2011 18:55:02 GMT) Full text and rfc822 format available.

bug No longer marked as found in versions 23.2. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 08 Feb 2011 18:55:02 GMT) Full text and rfc822 format available.

Changed bug title to 'message-mode perhaps to document more that it expects mail-header-separator' from '23.2; Refill error in message-mode' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 08 Feb 2011 18:55:02 GMT) Full text and rfc822 format available.

Severity set to 'minor' from 'normal' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 08 Feb 2011 18:55:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#7987; Package emacs,gnus. (Tue, 08 Feb 2011 19:08:02 GMT) Full text and rfc822 format available.

Message #22 received at 7987 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Jesse Sheidlower <jester <at> panix.com>
Cc: 7987 <at> debbugs.gnu.org
Subject: Re: bug#7987: 23.2; Refill error in message-mode
Date: Tue, 08 Feb 2011 14:16:32 -0500
Jesse Sheidlower wrote:

> The EmacsWiki page on MuttInEmacs does give a code sample (apparently
> problematic, as there are various kludgy-looking updates) that 'sets
> mail-header-separator to "" for M-q and auto-fill to work correctly', so

I'd probably have tried that.

> I'll experiment further and will update if necessary. Is there a
> preferred way to tell message-mode to assume that the buffer is a
> message body, rather than a header?

For filling, you can in a mode hook change the value of
fill-paragraph-function to something appropriate. The default is
message-fill-paragraph, which checks for headers as you can see.
I have no idea what other pieces of message-mode rely on the presence of
mail-header-separator though.





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#7987; Package emacs,gnus. (Thu, 10 Feb 2011 19:42:01 GMT) Full text and rfc822 format available.

Message #25 received at 7987 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jesse Sheidlower <jester <at> panix.com>
Cc: Glenn Morris <rgm <at> gnu.org>, 7987 <at> debbugs.gnu.org
Subject: Re: bug#7987: 23.2; Refill error in message-mode
Date: Thu, 10 Feb 2011 14:50:42 -0500
> Hmm. I guess you're right, although this behavior doesn't seem to be
> mentioned in the Manual. I'm using message-mode with Mutt, so there are
> no headers in the buffer.

No headers at all?  Where's the subject, then?

> But for what it's worth, one of the Emacs maintainers did look
> this over and think it was a bug, so I'm not the only one confused.

Indeed, I naively tried M-x message-mode in *scratch* and refilled some
indented text, without paying much attention to the fact that there was
no header.

> I'll experiment further and will update if necessary. Is there a
> preferred way to tell message-mode to assume that the buffer is a
> message body, rather than a header?

Add a header.

Maybe it would be be good to make message-mode accept an empty line as
a mail-header-separator (as does rfc822-goto-eoh).


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#7987; Package emacs,gnus. (Thu, 10 Feb 2011 20:54:02 GMT) Full text and rfc822 format available.

Message #28 received at 7987 <at> debbugs.gnu.org (full text, mbox):

From: Jesse Sheidlower <jester <at> panix.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Glenn Morris <rgm <at> gnu.org>, 7987 <at> debbugs.gnu.org
Subject: Re: bug#7987: 23.2; Refill error in message-mode
Date: Thu, 10 Feb 2011 16:02:09 -0500
On Thu, Feb 10, 2011 at 02:50:42PM -0500, Stefan Monnier wrote:
> > Hmm. I guess you're right, although this behavior doesn't seem to be
> > mentioned in the Manual. I'm using message-mode with Mutt, so there are
> > no headers in the buffer.
> 
> No headers at all?  Where's the subject, then?

In the headers that are not dumped to Emacs. The default configuration
of Mutt has the headers edited through the Mutt interface, and only the
body is sent to your $EDITOR. (You can override this, and edit the
entire message, including headers, if desired, but my impression is that
most people don't do this.)

> > I'll experiment further and will update if necessary. Is there a
> > preferred way to tell message-mode to assume that the buffer is a
> > message body, rather than a header?
> 
> Add a header.
> 
> Maybe it would be be good to make message-mode accept an empty line as
> a mail-header-separator (as does rfc822-goto-eoh).

Well, I don't truly know how common this use-case is (though it's common
enough that the EmacsWiki entry for Mutt and Emacs provides a
workaround), but maybe it would also be good to be able to have
message-mode accept the fact that you're editing a message body only? I
personally don't use message-mode for the actual sending of messages,
and in general I'd think that there could be reasons for wanting the
editing and formatting features of message-mode without the sending
features. Being able to say explicitly that you're editing the body
would be, to my mind, a better solution than adding a fake header, or
adding "(setq mail-header-separator "")" to one's .emacs, which feel
like kludges for this issue.

I'm not familiar with other text-based e-mail programs, but this is how
most GUI or web-based mailers work too--the headers are off in one
place, where they can be modified using one method, and the body is some
textarea that is edited using some other variety of tools.

Jesse Sheidlower




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#7987; Package emacs,gnus. (Fri, 11 Feb 2011 01:50:03 GMT) Full text and rfc822 format available.

Message #31 received at 7987 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jesse Sheidlower <jester <at> panix.com>
Cc: Glenn Morris <rgm <at> gnu.org>, 7987 <at> debbugs.gnu.org
Subject: Re: bug#7987: 23.2; Refill error in message-mode
Date: Thu, 10 Feb 2011 20:58:17 -0500
> Well, I don't truly know how common this use-case is (though it's common
> enough that the EmacsWiki entry for Mutt and Emacs provides a
> workaround), but maybe it would also be good to be able to have
> message-mode accept the fact that you're editing a message body only? I
> personally don't use message-mode for the actual sending of messages,
> and in general I'd think that there could be reasons for wanting the
> editing and formatting features of message-mode without the sending
> features. Being able to say explicitly that you're editing the body

AFAIK, more than 90% of message-mode's code i devoted to editing of the
headers and to the sending part of the job.  E.g. I'm not sure what
happens if you try to use MIME attachments in your use-case, but
I suspect it won't work right.


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#7987; Package emacs,gnus. (Fri, 11 Feb 2011 09:33:02 GMT) Full text and rfc822 format available.

Message #34 received at 7987 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Jesse Sheidlower <jester <at> panix.com>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 7987 <at> debbugs.gnu.org
Subject: Re: bug#7987: 23.2; Refill error in message-mode
Date: Fri, 11 Feb 2011 10:41:19 +0100
Jesse Sheidlower <jester <at> panix.com> writes:

> In the headers that are not dumped to Emacs. The default configuration
> of Mutt has the headers edited through the Mutt interface, and only the
> body is sent to your $EDITOR.

Then what you are editing is not a message and message-mode is not the
right mode to use.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#7987; Package emacs,gnus. (Fri, 11 Feb 2011 09:39:02 GMT) Full text and rfc822 format available.

Message #37 received at 7987 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Jesse Sheidlower <jester <at> panix.com>, 7987 <at> debbugs.gnu.org
Subject: Re: bug#7987: 23.2; Refill error in message-mode
Date: Fri, 11 Feb 2011 10:46:58 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> E.g. I'm not sure what happens if you try to use MIME attachments in
> your use-case, but I suspect it won't work right.

Attachments are handled by mml-mode which is an independent
(minor-)mode.  Of course, Mutt is unlikely to know about MML.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#7987; Package emacs,gnus. (Fri, 11 Feb 2011 10:58:02 GMT) Full text and rfc822 format available.

Message #40 received at 7987 <at> debbugs.gnu.org (full text, mbox):

From: Jesse Sheidlower <jester <at> panix.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Glenn Morris <rgm <at> gnu.org>, 7987 <at> debbugs.gnu.org
Subject: Re: bug#7987: 23.2; Refill error in message-mode
Date: Fri, 11 Feb 2011 06:06:39 -0500
On Thu, Feb 10, 2011 at 08:58:17PM -0500, Stefan Monnier wrote:
> > Well, I don't truly know how common this use-case is (though it's common
> > enough that the EmacsWiki entry for Mutt and Emacs provides a
> > workaround), but maybe it would also be good to be able to have
> > message-mode accept the fact that you're editing a message body only? I
> > personally don't use message-mode for the actual sending of messages,
> > and in general I'd think that there could be reasons for wanting the
> > editing and formatting features of message-mode without the sending
> > features. Being able to say explicitly that you're editing the body
> 
> AFAIK, more than 90% of message-mode's code i devoted to editing of the
> headers and to the sending part of the job.  E.g. I'm not sure what
> happens if you try to use MIME attachments in your use-case, but
> I suspect it won't work right.

In my use-case you wouldn't do this; as with the headers, you'd normally
attach MIME attachments using Mutt itself, not Emacs.

Jesse




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#7987; Package emacs,gnus. (Fri, 11 Feb 2011 11:07:01 GMT) Full text and rfc822 format available.

Message #43 received at 7987 <at> debbugs.gnu.org (full text, mbox):

From: Jesse Sheidlower <jester <at> panix.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 7987 <at> debbugs.gnu.org
Subject: Re: bug#7987: 23.2; Refill error in message-mode
Date: Fri, 11 Feb 2011 06:14:54 -0500
On Fri, Feb 11, 2011 at 10:41:19AM +0100, Andreas Schwab wrote:
> Jesse Sheidlower <jester <at> panix.com> writes:
> 
> > In the headers that are not dumped to Emacs. The default configuration
> > of Mutt has the headers edited through the Mutt interface, and only the
> > body is sent to your $EDITOR.
> 
> Then what you are editing is not a message and message-mode is not the
> right mode to use.

Well, what _is_ the right mode to use that handles refilling text that's
quoted with ">" characters, and coloring such text, and not really doing
anything else? I'd be happy to use that, or to add this capability to
text-mode by using hooks, or something.

When I first brought up the question in gnu.emacs.help, I specified that
I wasn't interested in the mail-handling capabilities of these modes, so
if 90% of the code of message-mode is wasted on me, I can't help that.

It's typical for Mutt users to use message-mode, mail-mode, or post-mode
for editing the body of e-mails, i.e. it's not just me who wants this
functionality. The fact that people use kludges to force message-mode
into behaving in the desired way, shows that there's a need for this.

Jesse




Reply sent to Lars Magne Ingebrigtsen <larsi <at> gnus.org>:
You have taken responsibility. (Thu, 30 Jun 2011 00:41:03 GMT) Full text and rfc822 format available.

Notification sent to Jesse Sheidlower <jester <at> panix.com>:
bug acknowledged by developer. (Thu, 30 Jun 2011 00:41:03 GMT) Full text and rfc822 format available.

Message #48 received at 7987-close <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Jesse Sheidlower <jester <at> panix.com>
Cc: 7987-close <at> debbugs.gnu.org
Subject: Re: bug#7987: 23.2; Refill error in message-mode
Date: Thu, 30 Jun 2011 02:40:41 +0200
Jesse Sheidlower <jester <at> panix.com> writes:

> In message-mode, there is an error in the fill command when you try to
> refill indented (blockquoted) paragraphs. Instead of filling the
> indented paragraph in-place, it removes empty lines before and after the
> blockquote, indents the first line further, and then indents the second
> and subsequent lines further still, leading to a mess.

I've now changed `message-point-in-header-p' to return nil if there's no
header separator at all.  I think this should make your use case work
better, without leading to any other problems.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#7987; Package emacs,gnus. (Thu, 30 Jun 2011 20:01:01 GMT) Full text and rfc822 format available.

Message #51 received at 7987 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 7987 <at> debbugs.gnu.org
Cc: larsi <at> gnus.org
Subject: Re: bug#7987: 23.2; Refill error in message-mode
Date: Thu, 30 Jun 2011 16:00:01 -0400
>> In message-mode, there is an error in the fill command when you try to
>> refill indented (blockquoted) paragraphs. Instead of filling the
>> indented paragraph in-place, it removes empty lines before and after the
>> blockquote, indents the first line further, and then indents the second
>> and subsequent lines further still, leading to a mess.

> I've now changed `message-point-in-header-p' to return nil if there's no
> header separator at all.  I think this should make your use case work
> better, without leading to any other problems.

Hmm... so message-mode now won't recognize an RFC2822-format buffer
(i.e. with an empty line as header separator)?  That would seem like
a more important use-case then the "no header" case.


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#7987; Package emacs,gnus. (Thu, 30 Jun 2011 20:11:02 GMT) Full text and rfc822 format available.

Message #54 received at 7987 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 7987 <at> debbugs.gnu.org
Subject: Re: bug#7987: 23.2; Refill error in message-mode
Date: Thu, 30 Jun 2011 22:10:11 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> Hmm... so message-mode now won't recognize an RFC2822-format buffer
> (i.e. with an empty line as header separator)?  That would seem like
> a more important use-case then the "no header" case.

I use an empty line as a separator, and `M-q' and friends work for me in
all my use cases.  But it's certainly possible that I've missed some.

Using an empty line as a separator, and then not including any headers
in the buffer doesn't work, though.  Eurhm.  That wasn't the original
author's use case, was it?  I assumed that he had a buffer starting with

  --- text follows etc etc ---

with no headers before that...

If not, yeah, you're right -- message mode just isn't meant to be used
like that.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




Forcibly Merged 7987 8594. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 09 Jul 2011 19:08:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 07 Aug 2011 11:24:21 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 317 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.