[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FR: support hard-newlines [9.5.5 (release_9.5.5 @ /home/viz/lib/port
From: |
Ihor Radchenko |
Subject: |
Re: FR: support hard-newlines [9.5.5 (release_9.5.5 @ /home/viz/lib/ports/emacs/lisp/org/)] |
Date: |
Tue, 20 Sep 2022 20:16:13 +0800 |
Visuwesh <visuweshm@gmail.com> writes:
> Hard-newlines [1] are an excellent way to inform Emacs to stop refilling
> lines. In a way, this serves a similar purpose to org's \\ but with a
> major difference being that hard-newlines are not saved to file. There
> are several cases where this is the desired behaviour:
> 1. When you want to end a line with a link and continue text in the
> next line. You don't care about the export since it will be
> taken care of properly.
> 2. When reflowing text with inline latex in them. You adjust the
> line width so that it looks like 80 columns are present in a
> single line. With hard-newlines, this becomes a very easy job
> without with you have to isolate the line of interest into a
> separate paragraph, then do the manual reflow, rinse and repeat.
This sounds as a reasonable use case. However, the Emacs definition of
hard newlines also involves re-defining paragraph breaks. I do not think
that it is a good idea for Org to alter Org paragraph syntax depending
on `use-hard-newlines' - it will create too much confusion when Org
documents are opened outside Emacs.
> 3. When writing a list, you give a short description at the top.
> Then continue writing down below like this without the need to
> insert a empty line after the first line.
Note that _not_ having an empty line after the first line can be
misleading. In Org syntax, absence of line will merge description and
the text below into a single paragraph. It will, for example, affect
export.
> My point is that there are several instances where you need a solution
> that is less aggressive than \\ and hard-newlines hit that sweet spot
> perfectly.
All in all, I feel that fully respecting `use-hard-newlines' in Org is
not a good idea. We can do it partially (for filling), but I am afraid
that it may create some confusion.
I'd like to hear what others think about this.
> - (fill-region-as-paragraph c end justify)
> + (fill-region c end justify)
There are 3 calls to `fill-region-as-paragraph' inside
`org-fill-element'. If we decide to support `use-hard-newlines'
partially, all 3 calls should probably be replaced.
--
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92