unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#7987: 23.2; Refill error in message-mode
@ 2011-02-05  3:18 Jesse Sheidlower
  2011-02-07 20:43 ` Glenn Morris
  2011-06-30  0:40 ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 14+ messages in thread
From: Jesse Sheidlower @ 2011-02-05  3:18 UTC (permalink / raw)
  To: 7987

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)





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

* bug#7987: 23.2; Refill error in message-mode
  2011-02-05  3:18 bug#7987: 23.2; Refill error in message-mode Jesse Sheidlower
@ 2011-02-07 20:43 ` Glenn Morris
  2011-02-08 15:44   ` Jesse Sheidlower
  2011-06-30  0:40 ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 14+ messages in thread
From: Glenn Morris @ 2011-02-07 20:43 UTC (permalink / raw)
  To: Jesse Sheidlower; +Cc: 7987

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?





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

* bug#7987: 23.2; Refill error in message-mode
  2011-02-07 20:43 ` Glenn Morris
@ 2011-02-08 15:44   ` Jesse Sheidlower
  2011-02-08 19:16     ` Glenn Morris
  2011-02-10 19:50     ` Stefan Monnier
  0 siblings, 2 replies; 14+ messages in thread
From: Jesse Sheidlower @ 2011-02-08 15:44 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 7987

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





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

* bug#7987: 23.2; Refill error in message-mode
  2011-02-08 15:44   ` Jesse Sheidlower
@ 2011-02-08 19:16     ` Glenn Morris
  2011-02-10 19:50     ` Stefan Monnier
  1 sibling, 0 replies; 14+ messages in thread
From: Glenn Morris @ 2011-02-08 19:16 UTC (permalink / raw)
  To: Jesse Sheidlower; +Cc: 7987

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.






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

* bug#7987: 23.2; Refill error in message-mode
  2011-02-08 15:44   ` Jesse Sheidlower
  2011-02-08 19:16     ` Glenn Morris
@ 2011-02-10 19:50     ` Stefan Monnier
  2011-02-10 21:02       ` Jesse Sheidlower
  1 sibling, 1 reply; 14+ messages in thread
From: Stefan Monnier @ 2011-02-10 19:50 UTC (permalink / raw)
  To: Jesse Sheidlower; +Cc: 7987

> 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





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

* bug#7987: 23.2; Refill error in message-mode
  2011-02-10 19:50     ` Stefan Monnier
@ 2011-02-10 21:02       ` Jesse Sheidlower
  2011-02-11  1:58         ` Stefan Monnier
  2011-02-11  9:41         ` Andreas Schwab
  0 siblings, 2 replies; 14+ messages in thread
From: Jesse Sheidlower @ 2011-02-10 21:02 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 7987

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





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

* bug#7987: 23.2; Refill error in message-mode
  2011-02-10 21:02       ` Jesse Sheidlower
@ 2011-02-11  1:58         ` Stefan Monnier
  2011-02-11  9:46           ` Andreas Schwab
  2011-02-11 11:06           ` Jesse Sheidlower
  2011-02-11  9:41         ` Andreas Schwab
  1 sibling, 2 replies; 14+ messages in thread
From: Stefan Monnier @ 2011-02-11  1:58 UTC (permalink / raw)
  To: Jesse Sheidlower; +Cc: 7987

> 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





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

* bug#7987: 23.2; Refill error in message-mode
  2011-02-10 21:02       ` Jesse Sheidlower
  2011-02-11  1:58         ` Stefan Monnier
@ 2011-02-11  9:41         ` Andreas Schwab
  2011-02-11 11:14           ` Jesse Sheidlower
  1 sibling, 1 reply; 14+ messages in thread
From: Andreas Schwab @ 2011-02-11  9:41 UTC (permalink / raw)
  To: Jesse Sheidlower; +Cc: 7987

Jesse Sheidlower <jester@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@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





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

* bug#7987: 23.2; Refill error in message-mode
  2011-02-11  1:58         ` Stefan Monnier
@ 2011-02-11  9:46           ` Andreas Schwab
  2011-02-11 11:06           ` Jesse Sheidlower
  1 sibling, 0 replies; 14+ messages in thread
From: Andreas Schwab @ 2011-02-11  9:46 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Jesse Sheidlower, 7987

Stefan Monnier <monnier@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@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





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

* bug#7987: 23.2; Refill error in message-mode
  2011-02-11  1:58         ` Stefan Monnier
  2011-02-11  9:46           ` Andreas Schwab
@ 2011-02-11 11:06           ` Jesse Sheidlower
  1 sibling, 0 replies; 14+ messages in thread
From: Jesse Sheidlower @ 2011-02-11 11:06 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 7987

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





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

* bug#7987: 23.2; Refill error in message-mode
  2011-02-11  9:41         ` Andreas Schwab
@ 2011-02-11 11:14           ` Jesse Sheidlower
  0 siblings, 0 replies; 14+ messages in thread
From: Jesse Sheidlower @ 2011-02-11 11:14 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 7987

On Fri, Feb 11, 2011 at 10:41:19AM +0100, Andreas Schwab wrote:
> Jesse Sheidlower <jester@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





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

* bug#7987: 23.2; Refill error in message-mode
  2011-02-05  3:18 bug#7987: 23.2; Refill error in message-mode Jesse Sheidlower
  2011-02-07 20:43 ` Glenn Morris
@ 2011-06-30  0:40 ` Lars Magne Ingebrigtsen
  2011-06-30 20:00   ` Stefan Monnier
  1 sibling, 1 reply; 14+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-06-30  0:40 UTC (permalink / raw)
  To: Jesse Sheidlower; +Cc: 7987-close

Jesse Sheidlower <jester@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/





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

* bug#7987: 23.2; Refill error in message-mode
  2011-06-30  0:40 ` Lars Magne Ingebrigtsen
@ 2011-06-30 20:00   ` Stefan Monnier
  2011-06-30 20:10     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 14+ messages in thread
From: Stefan Monnier @ 2011-06-30 20:00 UTC (permalink / raw)
  To: 7987; +Cc: larsi

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





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

* bug#7987: 23.2; Refill error in message-mode
  2011-06-30 20:00   ` Stefan Monnier
@ 2011-06-30 20:10     ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 14+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-06-30 20:10 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 7987

Stefan Monnier <monnier@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/





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

end of thread, other threads:[~2011-06-30 20:10 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-05  3:18 bug#7987: 23.2; Refill error in message-mode Jesse Sheidlower
2011-02-07 20:43 ` Glenn Morris
2011-02-08 15:44   ` Jesse Sheidlower
2011-02-08 19:16     ` Glenn Morris
2011-02-10 19:50     ` Stefan Monnier
2011-02-10 21:02       ` Jesse Sheidlower
2011-02-11  1:58         ` Stefan Monnier
2011-02-11  9:46           ` Andreas Schwab
2011-02-11 11:06           ` Jesse Sheidlower
2011-02-11  9:41         ` Andreas Schwab
2011-02-11 11:14           ` Jesse Sheidlower
2011-06-30  0:40 ` Lars Magne Ingebrigtsen
2011-06-30 20:00   ` Stefan Monnier
2011-06-30 20:10     ` Lars Magne Ingebrigtsen

Code repositories for project(s) associated with this public inbox

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

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