elizadev · 2022-05-21 04:11
Until now I have written most of my Org and Markdown files with `auto-fill-mode`, never exceeding more than 80 characters per column. However, I've increasingly noticed many counterexamples, where each paragraph was a single long line of text. Some platforms like GitHub seem to encourage this practice, as newlines in comments are treated as newlines in the rendered page, contrary to vanilla Markdown.
There seem to be some advantages to this approach. For example, writing prose with `mixed-pitch-mode` makes a lot more sense if lines are arbitrarily long, and I find it a lot more pleasant. But if I'm sharing a document with someone else, I wonder if generally they'd be annoyed at receiving a document without wrapping that requires them to enable `visual-fill-column-mode` and `visual-line-mode`, disable `hl-line-mode`, etc. I know I was at first before I discovered how to make the experience *feel* like I was using `auto-fill-mode` instead.
I'm interested to hear /r/emacs 's thoughts on this!
1980sMUD · 2022-05-21 05:10
I find that visual-line-mode is more pleasant than auto-fill-mode for org and the like.
_viz_ · 2022-05-21 05:25
I enable auto-fill-mode in text-mode buffers as I find it easier to
read when the lines don't span the entire window length. When I need
to share my text with other people, I usually mark the lines and say M-^
or run the following command which also does the job of re-punctuating
sentences to end with a single space
(defun vz/normalise-paragraph ()
"`vz/unfill-paragraph' then double spaces -> single space."
(interactive)
(let ((end (set-marker (make-marker) (if (use-region-p) (region-end) nil))))
(vz/unfill-paragraph)
(save-excursion
(beginning-of-line)
(while (re-search-forward "\\([]\"')]?\\)\\([.?!]\\)\\([]\"')]?\\) "
(if (marker-position end) end (line-end-position))
'return-nil)
(replace-match "\\1\\2\\3 ")))
(set-marker end nil)))
where vz/unfill-paragraph is just
(let ((fill-column most-positive-fixnum))
(call-interactively #'fill-paragraph))
There is one exception though: I have nov not fill paragraphs
because I dislike how shr renders the text (I prefer justified text)
but even then I scale the text so that each line only has a limited
amount of words (usually 6--7).
brookter · 2022-05-21 08:07
Obviously, all this is personal preference, but…
We spent years waiting for Emacs (and Vim) to provide
easy methods/tools
for automatic reflowing of paragraphs. It was one of
the big turn-offs
for writers that you couldn't do this obvious feature
easily. Now that
we have the facility, it seems a bit churlish not to
use it. ;-)
Hard code line endings in paragraphs have no benefits
for the
reader — look at the mess caused when you view an Info
file in
a split window on a small screen. Reflowing paragraphs
are a simple
courtesy to your readers.
I also struggle to think of a benefit for the writer. The only one I can think of is that splitting your text into single lines makes git diffs easier, but even then, you're better off splitting the text into meaningful clauses rather than by line-length.
The above seems obviously true for text modes, but I don't really see what benefits you get from autofill in program modes either (but I'm not a programmer so there may be benefits I've missed). So I always set `(global-visual-line mode t)` and a sensible maximum text width.
HM0880 · 2022-05-21 15:36
I use `longlines-mode` to wrap Github .md files to 70 characters for reading. This works well unless the file is written with lines of 80 characters... then the reflow looks silly. But lines that run the width of my 27" monitor are hard to read, so longlines is very useful for readmes.
a-c-d-w · 2022-05-23 21:22
I used to use `auto-fill-mode` for Org-mode, but I've recently switched to
`visual-line-mode`, because it fills better using a skinnier variable-pitch font
(which I use in Org-mode). I might actually do it for all text-mode
derivatives.... that'd be pretty interesting.
martianh · 2022-05-24 14:57
i used to use `visual-line-mode` for text and prose, but i find that it impacts performance for me too much in large org buffers (long essays). emacs is just hopeless with long lines, despite whatever you can do to mitigate it.
i reluctantly use `auto-fill-mode` now, mainly to keep things snappy. it was strange habit to get used to coming from word processors. then as i started version-controlling my texts, it has the added benefit of working in diffs also.
i also have a fill/unfill toggle command that i found on here or stack exchange.
there's also `refill-mode`, which is cool (it refills automatically if you edit a filled paragraph, which `auto-fill-mode` doesn't do), but it seems to make things like hitting `org-return` in the middle of a paragraph impossible: you insert a new line and then \`refill-mode\` fills it into oblivion and you're left where you started. perhaps someone knows a workaround? it if worked well we'd almost have the best of both worlds.
EDIT: https://github.com/davidshepherd7/aggressive-fill-paragraph-mode seems to work for prose paragraphs.