emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Matt Beshara <m@mfa.pw>
Cc: emacs-orgmode@gnu.org
Subject: Should page break (^L) work as paragraph element separator and be included into Org syntax? (was: [BUG] org-fill-paragraph doesn't handle ^L correctly [9.5.4 (release_9.5.4-19-g4dff42 @ /home/matt/Code/emacs/lisp/org/)])
Date: Mon, 26 Sep 2022 19:39:02 +0800	[thread overview]
Message-ID: <87mtamjrft.fsf@localhost> (raw)
In-Reply-To: <87o7v4iawb.fsf@mfa.pw>

Matt Beshara <m@mfa.pw> writes:

> ‘org-fill-paragraph’ does not correctly handle ^L characters 
> (a.k.a. form feed, C-q C-l).  It should treat them as paragraph 
> separating whitespace, but instead treats them as any other 
> character which would appear in normal text.  Here is an example 
> to demonstrate the current behaviour:
>
> abc def
> ^L
> ghi jkl

This may or may not be a correct expectation.

Please remember that Org mode is a markup language.

^L is not a part of Org specification for paragraph separators.
According to https://orgmode.org/worg/dev/org-syntax.html#Paragraphs,
paragraph boundaries should either be empty lines, or beginning of other
Org elements.

> In org-mode, with point at the beginning or the end of the first 
> or last line, doing ‘org-fill-paragraph’ (M-q) should do nothing, 
> because the lines are already shorter than the fill-column.  What 
> really happens is that I end up with one line which looks like:
>
> abc def ^L def ghi

Which is correct wrt current Org syntax specification, although I do
agree that it is counter-intuitive.

Dear all,
Should we add page break (^L) to our syntax? It sounds like a reasonable
addition for a text-based markup.

> In text-mode, ‘fill-paragraph’ does handle ^L characters 
> correctly, and pressing M-q anywhere in the first example results 
> in no change being made to the buffer.

Indeed. That's because text mode syntax is treated ^L specially.

-- 
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


  reply	other threads:[~2022-09-26 11:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-24 23:39 [BUG] org-fill-paragraph doesn't handle ^L correctly [9.5.4 (release_9.5.4-19-g4dff42 @ /home/matt/Code/emacs/lisp/org/)] Matt Beshara
2022-09-26 11:39 ` Ihor Radchenko [this message]
2022-09-26 15:10   ` Should page break (^L) work as paragraph element separator and be included into Org syntax? (was: [BUG] org-fill-paragraph doesn't handle ^L correctly [9.5.4 (release_9.5.4-19-g4dff42 @ /home/matt/Code/emacs/lisp/org/)]) Matt Beshara
2022-09-27  6:21     ` Robert Klein
2022-09-26 16:13   ` Max Nikulin
2022-09-26 20:13     ` Tim Cross
2022-09-27 10:48       ` Should page break (^L) work as paragraph element separator and be included into Org syntax? (was: [BUG] org-fill-paragraph doesn't handle ^L correctly) Max Nikulin
2022-09-28  1:00         ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mtamjrft.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=m@mfa.pw \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).