Where do you stand on format=flowed

341 views
Skip to first unread message

clem.ba...@gmail.com

unread,
Mar 19, 2013, 3:14:28 PM3/19/13
to mu-di...@googlegroups.com
Hi,

I suppose this is a typical question for a mail-client list: what about
a minimal format=flowed support in mu4e?
In the defense of f=f, I've noticed that my quoted messages display weird
line-breaks.

bye,


Clément

Oscar Carlsson

unread,
Mar 20, 2013, 3:15:27 AM3/20/13
to mu-di...@googlegroups.com
Hi!

You can always press 'w' while viewing a message, and visual-line-mode
will be enabled for the buffer. I've also bound 'l' to enable
longlines-mode:

(eval-after-load 'mu4e
'(progn (define-key mu4e-view-mode-map (kbd "l") 'longlines-mode)))


Oscar

Clement Barthelemy

unread,
Mar 23, 2013, 2:48:10 PM3/23/13
to mu-di...@googlegroups.com
Hi,

You are right, visual-line-mode does rewrap the message nicely.
It does not, however, prevent 'embarrassing line wrap' with the quoted
part of the message such as:

> This is a badly wrapped line of
quoted text

I must admit I do not fully understand how format=flowed works, but my
understanding was that this kind of problem is the reason why it was
proposed in the first place.

By the way, it seems that visual-line-mode is supposed to eventually
replace longlines-mode, is there a reason to use them both ?


Bye,

Clément

Oscar Carlsson

unread,
Mar 24, 2013, 3:53:49 AM3/24/13
to mu-di...@googlegroups.com

Clement Barthelemy <clem.ba...@gmail.com> writes:

> Hi,
>
> By the way, it seems that visual-line-mode is supposed to eventually
> replace longlines-mode, is there a reason to use them both ?

They have different uses. visual-line-mode wraps at rightmost border of
your window, while longlines-mode wraps at the 80 th (or so)
column. When I use Emacs on a wide monitor I prefer to usee
longlines-mode, since long lines are hard to read (and in my case, 27"
long lines are really hard to read).


Oscar

Joost Kremers

unread,
Mar 24, 2013, 8:00:07 AM3/24/13
to mu-di...@googlegroups.com
On Sun, Mar 24 2013, Oscar Carlsson <oscar.c...@gmail.com> wrote:
> They have different uses. visual-line-mode wraps at rightmost border of
> your window, while longlines-mode wraps at the 80 th (or so)
> column. When I use Emacs on a wide monitor I prefer to usee
> longlines-mode, since long lines are hard to read (and in my case, 27"
> long lines are really hard to read).

Then get used to splitting your windows... Longlines-mode has been
retired as of Emacs 24.3. From what I understand, it was really a hack,
not a future-proof implementation. I personally do mis the option to
wrap at a given boundary, but I've written some code to work around that.

--
Joost Kremers
Life has its moments

Oscar Carlsson

unread,
Mar 24, 2013, 9:11:12 AM3/24/13
to mu-di...@googlegroups.com

Joost Kremers writes:

> Then get used to splitting your windows... Longlines-mode has been
> retired as of Emacs 24.3. From what I understand, it was really a hack,
> not a future-proof implementation. I personally do mis the option to
> wrap at a given boundary, but I've written some code to work around that.

It's been retired? That's news for me, and I think it's too bad (without
any knowledge of the implementation) since splitting windows is _not_ the
same thing. OTOH I rarely use Emacs in fullscreen on my high resolution
displays so I'll probably be fine.


Oscar

Marius Hofert

unread,
May 19, 2013, 4:23:40 AM5/19/13
to mu-di...@googlegroups.com
Dear Joost,

I would like to have the lines wrapped as in visual-line-mode but at column 80 (as opposed to the window edge).
I saw your post and I am hoping you could show the code you use for doing this.

With best wishes,

Marius 

Joost Kremers

unread,
May 19, 2013, 5:34:37 AM5/19/13
to mu-di...@googlegroups.com
Hi Marius,

On Do, Jan 01 1970, Marius Hofert <marius...@gmail.com> wrote:
> I would like to have the lines wrapped as in visual-line-mode but at column
> 80 (as opposed to the window edge).
> I saw your post and I am hoping you could show the code you use for doing
> this.

The code I was referring to is writeroom-mode, which is here:

<https://github.com/joostkremers/writeroom-mode>

Actually, writeroom-mode has a more general purpose (it emulates the
visual behaviour of the Writeroom editor), but you could disable all
other effects and just set the width of the writing area.

However, if that is all you want, you may find find the following code
more useful:

<https://github.com/aculich/window-margin.el>

Note, however, that not wrapping email text actually violates the
standard. Format=flowed does not mean text is not wrapped, it's just
wrapped in a specific way (with space+newline at the end of every line
rather than just newline) so that clients know they can rewrap the text
if they want to. IOW, you shouldn't use visual-line-mode for writing
emails.

From a quick Google search, it seems that Gnus allows composing proper
format=flowed messages, but IIUC it does this by reformatting the
message when it's being sent off. Since mu4e (AFAIK) doesn't do the
same, writing format=flowed messages with it doesn't seem possible ATM.

HTH

Marius Hofert

unread,
May 19, 2013, 10:59:28 AM5/19/13
to mu-di...@googlegroups.com
Dear Joost,

Thanks for helping. 

I currently use (add-hook 'mu4e-view-mode-hook 'visual-line-mode)
to view messages in visual-line-mode. For reading a message, this
is more comfortable than the default. I actually wanted to have
the (visual) wrap at colum 80 since this would be even more
comfortable (wide screen). IIUC window-margin would make my
window smaller/larger depending on window-margin-width, but this
seems like a 'hack' to me. I have a fixed place for my
window/frame on the screen and I wouldn't want it to change.

Concerning 'not wrapping email text actually violates the
standard'. Indeed, but isn't that what the current default is
doing anyways?

When replying to a message (R), we possibly have very long lines
in the cited text. This is exactly what I would like to
avoid. What I normally do when replying 'inline' is to hit
M-RET. Then, automatically (message-newline-and-reformat) the
message is reformatted to have max. 80 characters per line. For
the other paragraphs I use M-q by hand to reformat them. Needless
to say, this is tedious. I was wondering if not the whole mail
body could be formated 'like with M-q' (fill-paragraph) before
replying or ideally even already when reading (?). This seems
like the only useful 'default' to me, but I don't know how to get
this behavior. There is no "fill-buffer" or "fill-email-body"
as "fill-paragraph"...

Cheers,

Marius

Joost Kremers

unread,
May 19, 2013, 1:01:20 PM5/19/13
to mu-di...@googlegroups.com
Hi Marius,

Op 19 mei 2013 om 16:59 heeft Marius Hofert <marius...@gmail.com> het volgende geschreven:
> I currently use (add-hook 'mu4e-view-mode-hook 'visual-line-mode)
> to view messages in visual-line-mode.

I think there is a mu4e setting that does that. No need to do it with a hook. (Not sure, though, can't check right now as I'm on my iPad. Which, unfortunately, doesn't run Linux...)

> For reading a message, this
> is more comfortable than the default. I actually wanted to have
> the (visual) wrap at colum 80 since this would be even more
> comfortable (wide screen). IIUC window-margin would make my
> window smaller/larger depending on window-margin-width, but this
> seems like a 'hack' to me. I have a fixed place for my
> window/frame on the screen and I wouldn't want it to change.

No, window-margin doesn't make your window larger or smaller. Emacs has a concept of margins, which are the areas between the actual text area and the window borders. (Actually, between the text area and the fringes, but that's a detail that's irrelevant here). window-margin-mode works by widening the right margin. This does not change the window border, just the area that's used for text.

(In contrast, writeroom-mode adjusts both margins, not just the right margin, so that the text appears in the middle of the window. window-margin-mode puts the text at the left of the window.)

So you can safely try it out, it shouldn't change the window size or configuration.

> Concerning 'not wrapping email text actually violates the
> standard'. Indeed, but isn't that what the current default is
> doing anyways?

Yes. For some reason, I thought you wanted to use format=flowed for composing messages.

> When replying to a message (R), we possibly have very long lines
> in the cited text. This is exactly what I would like to
> avoid. What I normally do when replying 'inline' is to hit
> M-RET. Then, automatically (message-newline-and-reformat) the
> message is reformatted to have max. 80 characters per line. For
> the other paragraphs I use M-q by hand to reformat them. Needless
> to say, this is tedious.

Yes... I use M-q myself, too. I wish I could use visual-line-mode for composing and have the messages sent out as format=flowed, but, alas, I'd have to program it myself, I guess. ;-)


> I was wondering if not the whole mail
> body could be formated 'like with M-q' (fill-paragraph) before
> replying or ideally even already when reading (?). This seems
> like the only useful 'default' to me, but I don't know how to get
> this behavior. There is no "fill-buffer" or "fill-email-body"
> as "fill-paragraph"...

No. I suspect that would require a bit more than just that. I agree it would be nice to have, though. :-)

Best,

Joost



--
Joost Kremers, PhD
University of Göttingen
Institute for German Philology
Käte-Hamburger-Weg 3
37073 Göttingen, Germany

Marius Hofert

unread,
May 19, 2013, 1:26:57 PM5/19/13
to mu-di...@googlegroups.com

Joost Kremers writes:

> Hi Marius,
>
> Op 19 mei 2013 om 16:59 heeft Marius Hofert <...@gmail.com> het volgende geschreven:
>> I currently use (add-hook 'mu4e-view-mode-hook 'visual-line-mode)
>> to view messages in visual-line-mode.
>
> I think there is a mu4e setting that does that. No need to do it with
> a hook. (Not sure, though, can't check right now as I'm on my
> iPad. Which, unfortunately, doesn't run Linux...)

The hook was suggested by Dirk (see his first post on https://groups.google.com/forum/?fromgroups#!topic/mu-discuss/vkt9tMqr5V8)

>
>
>> For reading a message, this
>> is more comfortable than the default. I actually wanted to have
>> the (visual) wrap at colum 80 since this would be even more
>> comfortable (wide screen). IIUC window-margin would make my
>> window smaller/larger depending on window-margin-width, but this
>> seems like a 'hack' to me. I have a fixed place for my
>> window/frame on the screen and I wouldn't want it to change.
>
> No, window-margin doesn't make your window larger or smaller. Emacs has a concept of margins, which are the areas between the actual text area and the window borders. (Actually, between the text area and the fringes, but that's a detail that's irrelevant here). window-margin-mode works by widening the right margin. This does not change the window border, just the area that's used for text.
>
> (In contrast, writeroom-mode adjusts both margins, not just the right margin, so that the text appears in the middle of the window. window-margin-mode puts the text at the left of the window.)
>
> So you can safely try it out, it shouldn't change the window size or
> configuration.

okay, great, thanks. I'll try it then.

>
>
>> Concerning 'not wrapping email text actually violates the
>> standard'. Indeed, but isn't that what the current default is
>> doing anyways?
>
> Yes. For some reason, I thought you wanted to use format=flowed for composing messages.
>
>> When replying to a message (R), we possibly have very long lines
>> in the cited text. This is exactly what I would like to
>> avoid. What I normally do when replying 'inline' is to hit
>> M-RET. Then, automatically (message-newline-and-reformat) the
>> message is reformatted to have max. 80 characters per line. For
>> the other paragraphs I use M-q by hand to reformat them. Needless
>> to say, this is tedious.
>
> Yes... I use M-q myself, too. I wish I could use visual-line-mode for
> composing

referring to the same post as before, I have (add-hook 'mu4e-compose-mode-hook 'visual-line-mode)

> and have the messages sent out as format=flowed, but, alas, I'd have
> to program it myself, I guess. ;-)

yes, indeed, that would be good. If you need 'moral support', I can have
a shell script send you a polite 'request' every other day... (since) I'm on
Linux :-)


What I don't get is that it is possible for Gnus. I though mu4e also
(internally) makes use of Gnus here... but I'm not an elisp programmer,
so I don't know what's happening inside.

Cheers,

Marius

Charl Botha

unread,
Jan 31, 2015, 5:47:28 AM1/31/15
to mu-di...@googlegroups.com
I was not happy with the way the plain text mails I *sent* with mu4e rendered, especially on receiving mobile mail clients, so I went reading up on format=flowed, and then figured out how to activate this in mu4e.

See the issue I logged, along with more explanation: https://github.com/djcb/mu/issues/569

I am very happy that I may continue to send plain text emails. :) (except when HTML is called for: http://vxlabs.com/2015/01/28/sending-emails-with-math-and-source-code/ )
 

bye,


Clément

Eduardo Mercovich

unread,
Feb 1, 2015, 11:09:26 AM2/1/15
to Mu Discuss

Charl.

>> I suppose this is a typical question for a mail-client list: what about
>> a minimal format=flowed support in mu4e?
>> In the defense of f=f, I've noticed that my quoted messages display weird
>> line-breaks.

Same thing here.

> [...] I am very happy that I may continue to send plain text emails. :) (except when HTML is called for: http://vxlabs.com/2015/01/28/sending-emails-with-math-and-source-code/ )

Thanks a lot!
I didn't knew this format=flowed support and would also like to use it by default. :)

Based on your github request (sorry my technical ignorance if this is obvious to everyone in the list=, should we only add this to the .emacs file?

[code[
(add-hook 'mu4e-compose-mode-hook
   (defun cpb-compose-setup ()
    "Use hard newlines, so outgoing mails will have format=flowed."
    (use-hard-newlines t 'guess)
    )
)
[/code]

Thanks a lot! :)

--
e

Damien Cassou

unread,
Feb 1, 2015, 2:15:19 PM2/1/15
to mu-di...@googlegroups.com
AFAICT, mu4e *does not* display format=flowed emails correctly
either: if you change the width of Emacs to be slightly less than
the line length of the email you are reading, you will see both
line wrapping and hard newlines as in
https://mathiasbynens.be/_img/gmail-plain-text/result-in-ios-mail.png.

--
Damien Cassou http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
Reply all
Reply to author
Forward
0 new messages