emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: alain.cochard@unistra.fr
Cc: emacs-orgmode@gnu.org
Subject: [PATCH] [O] Single opening star induces bold face if immediately preceeding inlinetask
Date: Sun, 03 Oct 2021 15:53:14 +0800	[thread overview]
Message-ID: <87bl467ded.fsf@localhost> (raw)
In-Reply-To: <23707.20428.546749.44853@frac.u-strasbg.fr>

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

Alain.Cochard@unistra.fr writes:

> Hello.
> With this org file, the "blah" is in bold face.
> * foo
> a *blah
> *************** task
> bar
> *************** END
> I would it is a small bug.  NB: If I insert a blank line before the
> task, the face goes back to normal.

Thanks for your report. It took a while to process, but here is the fix.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org.el-Do-not-span-emphasis-over-inlinetask-boundari.patch --]
[-- Type: text/x-diff, Size: 1678 bytes --]

From ae325834b75944d81ad57087336ca6efa6e57480 Mon Sep 17 00:00:00 2001
Message-Id: <ae325834b75944d81ad57087336ca6efa6e57480.1633247511.git.yantar92@gmail.com>
From: Ihor Radchenko <yantar92@gmail.com>
Date: Sun, 3 Oct 2021 15:48:23 +0800
Subject: [PATCH] org.el: Do not span emphasis over inlinetask boundaries

* lisp/org.el (org-do-emphasis-faces): Check paragraph boundaries
within emphasis even when the boundary is not starting right at the
beginning of the emphasis.

Fixes https://orgmode.org/list/23707.20428.546749.44853@frac.u-strasbg.fr
 lisp/org.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 3546e7edd..1551986f6 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5096,8 +5096,14 @@ (defun org-do-emphasis-faces (limit)
 		   ;; Match full emphasis markup regexp.
 		   (looking-at (if verbatim? org-verbatim-re org-emph-re))
 		   ;; Do not span over paragraph boundaries.
-		   (not (string-match-p org-element-paragraph-separate
-					(match-string 2)))
+		   (not (save-match-data
+                        (save-excursion
+                          (goto-char (match-beginning 2))
+                          (re-search-forward org-element-paragraph-separate
+                                             (save-excursion
+                                               (goto-char (match-end 2))
+                                               (line-end-position))
+                                             'noerror))))
 		   ;; Do not span over cells in table rows.
 		   (not (and (save-match-data (org-match-line "[ \t]*|"))
 			     (string-match-p "|" (match-string 4))))))

      reply	other threads:[~2021-10-03  8:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-27 10:26 Single opening star induces bold face if immediately preceeding inlinetask Alain.Cochard
2021-10-03  7:53 ` Ihor Radchenko [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:

  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=87bl467ded.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=alain.cochard@unistra.fr \
    --cc=emacs-orgmode@gnu.org \


* 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


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