emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Lucas Viana <lucasvianareis@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [BUG] Fill-paragraph issue with hidden emphasis markers and composed characters
Date: Fri, 6 Aug 2021 14:07:22 -0300	[thread overview]
Message-ID: <CAC9BvE5sXk5pB6kZL72wsC-nMBbZbr=Hr8biwUXKR3U0vgqMUg@mail.gmail.com> (raw)

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

Dear list,

I'm not sure if this is a general issue with fill-paragraph or with the way
org hides emphasis markers, but I'm facing a problem with bare emacs + org.

Steps to reproduce:
1. Start emacs -Q (no configuration)
2. Set some variables:

(setq org-pretty-entities t
      org-hide-emphasis-markers t
      fill-column 80)

3. Create an empty org-mode buffer with the following paragraph:
""
This is a /italic sentence for a buggy/ \alpha\beta\gamma\delta\nu\epsilon
paragraph in terms of filling, see, it's not filled yet and still the line
above
ends early.
""

So far so good, and with the previous config the emphasis markers are now
hidden and the greek letters appear as unicode characters.

4. Hit M-q (either fill-paragraph or org-fill-paragraph, both have the same
issue)
The first line wrongly wraps after "buggy" and leaves a big empty space
after that, as if the greek letters were not composed.

5. In the same buffer, compare the behaviour with this paragraph (very
similar, but note the ! character after "buggy"):
""
This is a /italic sentence for a buggy/ ! \alpha\beta\gamma\delta\nu\epsilon
paragraph in terms of filling, see, it's not filled yet and still the line
above
ends early.
""

When I fill this slightly different paragraph with M-q, it wraps the text
in the right way and the first line is completely filled.

So the issue happens when a hidden emphasis marker is immediately followed
(maybe after a space) by a composed character like \alpha. I am also facing
the same issue when the characters are composed by prettify-symbols-mode
instead of org-pretty-entities, and also with other types of hidden
emphasis markers. If org-hide-emphasis-markers is disabled then the issue
doesn't happen.

Thanks in advance!

Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.29, cairo version 1.17.4)
 of 2021-07-09
Package: Org mode version 9.5 (9.5-b83ae59 @
/home/lucas/.emacs.d/.local/straight/build-28.0.50/org/)

[-- Attachment #2: Type: text/html, Size: 2255 bytes --]

             reply	other threads:[~2021-08-09 16:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06 17:07 Lucas Viana [this message]
2021-08-10  1:34 ` [BUG] Fill-paragraph issue with hidden emphasis markers and composed characters Tim Cross
2021-08-10 22:57 ` Rudolf Adamkovič
2022-10-26  6:58 ` Ihor Radchenko
2022-10-27 10:39   ` 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='CAC9BvE5sXk5pB6kZL72wsC-nMBbZbr=Hr8biwUXKR3U0vgqMUg@mail.gmail.com' \
    --to=lucasvianareis@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).