all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Brooksby <rb@ravenbrook.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>, Eli Zaretskii <eliz@gnu.org>
Cc: stefan@merten-home.de, 74785@debbugs.gnu.org
Subject: bug#74785: 27.1; Fill-paragraph in RST mode does not respect line blocks
Date: Wed, 18 Dec 2024 04:56:45 +0000	[thread overview]
Message-ID: <a37d5cb6-307e-4990-a0fc-7131f4e745bf@ravenbrook.com> (raw)
In-Reply-To: <jwvzfkuutff.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 323 bytes --]

On 2024-12-17 17:12, Stefan Monnier wrote:
>>> - set `adaptive-fill-regexp` to match this leading `|`.
>> Doesn't it already?
> 
> Not in my test, no.  With a paragraph like:
> 
>      | bblblbl
>      | asdfasdf
>      | asdasdf

Please find attached a self-documenting test document that you may find 
useful.

Thank you!

[-- Attachment #2: verse-test.rst --]
[-- Type: text/x-rst, Size: 2694 bytes --]

================
 Bug 74785 test
================

This is a test file for `GNU Emacs bug 74785
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74785>`_, created to
help clarify the issue and help developers test solutions.  It's not
exhaustive.

You can check the output easily with rst-compile (C-c C-c C-c).

It would be nice if selecting the *entire* document and executing
fill-paragraph would result in a document that is:

1. filled and wrapped nicely as a text source

2. has unchanged output.

Example one.  In the simple case, as a top-level block.

| In Xanadu did Kubla Khan
| A stately pleasure-dome decree:
| Where Alph, the sacred river, ran
| Through caverns measureless to man
| Down to a sunless sea.

Example two.  Here's the same thing as a quote.

  | In Xanadu did Kubla Khan
  | A stately pleasure-dome decree:
  | Where Alph, the sacred river, ran
  | Through caverns measureless to man
  | Down to a sunless sea.

  -- Samuel Taylor Coleridge

Example three.  With continuation lines, this should produce identical
output to the previous example.

  | In Xanadu did Kubla Khan
  | A stately
    pleasure-dome
    decree:
  | Where Alph,
    the sacred river,
    ran
  | Through caverns
                measureless to man
  | Down to a sunless sea.

  -- Samuel Taylor Coleridge

It would be nice if fill-paragraph (M-q) would reformat example three
to look like example two.

Example four.  Conversely, here's a verse with long lines beyond the
default fill column of 70.

  | Begins the night’s shadows creeping, his eyes mocking, and beseeching.
  | I must stop his soul from joining, to fight with Poes’ shadows trying…
  | Trying once more, to take his soul, toward those demon littered shores.
  | Grabbing the ipod I forward tore, to give him tranquility evermore. 
  | Pouch and ear buds firmly seated, engaged in a fierce-some war.
  | Morning found all, in blissful snores… Quoted the raven nevermore.

  -- Carol Eastman

Example five.  It would be nice if fill-paragraph would wrap these
lines, but in a way that keeps the output identical.  For example
(with fill-column 70):

  | Begins the night’s shadows creeping, his eyes mocking, and
    beseeching.
  | I must stop his soul from joining, to fight with Poes’ shadows
    trying…
  | Trying once more, to take his soul, toward those demon littered
    shores.
  | Grabbing the ipod I forward tore, to give him tranquility
    evermore.
  | Pouch and ear buds firmly seated, engaged in a fierce-some war.
  | Morning found all, in blissful snores… Quoted the raven nevermore.

  -- Carol Eastman

Of course all of the above must work when nested within other forms.

Thanks all.

.. end

      reply	other threads:[~2024-12-18  4:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-11 10:37 bug#74785: 27.1; Fill-paragraph in RST mode does not respect line blocks Richard Brooksby
2024-12-14 10:22 ` Eli Zaretskii
2024-12-16 22:05   ` Stefan Merten
2024-12-17  2:53     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-17  6:05       ` James Cloos
2024-12-17 12:51         ` Eli Zaretskii
2024-12-17 14:49           ` James Cloos
2024-12-17 15:11             ` Eli Zaretskii
2024-12-17 15:34               ` Richard Brooksby
2024-12-17 15:41                 ` Eli Zaretskii
2024-12-17 17:07           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-17 12:25       ` Eli Zaretskii
2024-12-17 17:12         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-18  4:56           ` Richard Brooksby [this message]

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

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

  git send-email \
    --in-reply-to=a37d5cb6-307e-4990-a0fc-7131f4e745bf@ravenbrook.com \
    --to=rb@ravenbrook.com \
    --cc=74785@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=stefan@merten-home.de \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.