Since updating to Emacs 26.1. message mode was changed so that M-q
does something unexpected. I have fill-column
and message-fill-column
both set to 72 and pressing M-q
on this text:
turns it into this text:
It seems that in other modes M-q
does what it usually does. In particular, if I switch this buffer to text mode I can get the expected formatting.
Update: I have researched the issue. It appears as if in message mode the function message-fill-paragraph
is called. This function was slightly changed from 25.3 to 26.1. But essentially it just calls message-newline-and-reformat
which actually does something else. I can't find the reason for the totally unexpected behaviour of message-fill-paragraph
. It does not what it says it should do and for example seems totally unrelated to the value of message-fill-column
.
C-h k M-q
tell you in that context? Then look at the definition of the command that it says is bound toM-q
there.fill-paragraph
which runsfill-paragraph-function
if that variable is not nil. Indeed, in message mode it is set tomessage-fill-paragraph
frommessage.el
. I'm can't see through that function, though. I can replace it with fill-paragraph, though.mail-header-separator
which typically is--text follows this line--
in your message? If not your paragraph possibly gets handled as a field.