* Displaying newlines as whitespaces on a region.
@ 2019-03-26 23:35 Daniel P. Gomez
0 siblings, 0 replies; only message in thread
From: Daniel P. Gomez @ 2019-03-26 23:35 UTC (permalink / raw)
To: help-gnu-emacs
Dear Emacs friends,
I use Org mode for prose and keep my files under version control
(VC).
To keep VC diffs simple and meaningful, I would like to write a
single sentence in each line, as shown in the following example
(between dashes):
---
* A heading
This is an example.
In the example each sentence is in a newline.
Sentences within a paragraph look ugly when separated by newlines,
though.
Two newlines represent a paragraph, just as in LaTeX.
---
Although writing one sentence per line is good for VC, it is
hardly convenient for reading and writing, because this is not how
people are used to prose, generally.
Currently the question arose whether it'd be possible to have
Emacs display newline characters as whitespaces. A naive solution
could be achieved by tweaking the variable
=whitespace-display-mappings= and activating
=whitespace-newline-mode=, which is a part of Emacs.
Unfortunately, however, this solution has a series of drawbacks.
First, it is no longer possible to visually differentiate between
paragraphs, as they'd be displayed as sentences separated by two
whitespaces. Second, headings and org src blocks get clumped.
Would anyone know how to have =whitespace-newline-mode= only
substitute newlines for whitespaces in sentences outside of org
blocks, tables and headings and only for sentences followed by
other sentences (effectively allowing for paragraph breaks)? More
generally, would anyone know of a solution to this problem even if
using other packages other than whitespace.el?
Ideally the example above would be displayed in the buffer as:
---
* A heading
This is an example. In the example each sentence is in a newline.
Sentences within a paragraph look ugly when separated by newlines,
though.
Two newlines represent a paragraph, just as in LaTeX.
---
Thank you.
Yours,
Daniel Gomez
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-03-26 23:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-26 23:35 Displaying newlines as whitespaces on a region Daniel P. Gomez
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).