emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: "Dr. Arne Babenhauserheide" <arne_bab@web.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug: font-lock error with - in code-mode [9.4.6 (9.4.6-gab9f2a @ /gnu/store/2pny4z6mbi2aybgzzxz0yrzkds7hbpmq-emacs-org-9.4.6/share/emacs/site-lisp/org-9.4.6/)]
Date: Fri, 01 Oct 2021 17:56:32 +0800	[thread overview]
Message-ID: <87lf3d3w6n.fsf@localhost> (raw)
In-Reply-To: <87fsujp7mc.fsf@web.de>

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

"Dr. Arne Babenhauserheide" <arne_bab@web.de> writes:

> When parsing the following code:
>
> Am richtigen Ort zur richtigen Zeit (=+=; 1x pro Abenteuer im richtigen
> Moment auftauchen), Computeraffinität (=+= oder =++=; Bonus von 3 oder 6),
> Kurze Aufmerksamskeitsspanne (~-~), Photographisches Gedächtnis (=+=),
> Primitive Technologie (~-~), Schreckhaft (~-~), Schrecklich Schusselig (~-~),
> Toller Laptop (=+=) oder Verträumt (~-~).
>
> The fourth line is highlighted as code beginning at the first ~-~ until
> the final closing paren (")")  of the paragraph.

Confirmed

The fix is attached.

Best,
Ihor


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-do-emphasis-faces-Never-treat-closing-marker-as-.patch --]
[-- Type: text/x-diff, Size: 1151 bytes --]

From a4c864b7f983a135e8debbc32d8ef4ff3f2e89f4 Mon Sep 17 00:00:00 2001
Message-Id: <a4c864b7f983a135e8debbc32d8ef4ff3f2e89f4.1633082097.git.yantar92@gmail.com>
From: Ihor Radchenko <yantar92@gmail.com>
Date: Fri, 1 Oct 2021 17:47:02 +0800
Subject: [PATCH] org-do-emphasis-faces: Never treat closing marker as next
 opening marker

* lisp/org.el (org-do-emphasis-faces): Make sure that we never match
ending marker of an emphasis as a beginning marker of another
emphasis.  For example, in "(~-~) test (~+~)" "~) test (~" is a valid
code match unless we move point to the end the first code emphasis
completely during parsing.

Fixes https://orgmode.org/list/87fsujp7mc.fsf@web.de
---
 lisp/org.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/org.el b/lisp/org.el
index 9608b52ee..9f68182d9 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -4855,6 +4855,7 @@ (defun org-do-emphasis-faces (limit)
 				       '(invisible t))
 		  (add-text-properties (match-beginning 3) (match-end 3)
 				       '(invisible t)))
+                (goto-char (match-end 0))
 	        (throw :exit t)))))))))
 
 (defun org-emphasize (&optional char)
-- 
2.32.0


  reply	other threads:[~2021-10-01  9:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-05 11:46 Bug: font-lock error with - in code-mode [9.4.6 (9.4.6-gab9f2a @ /gnu/store/2pny4z6mbi2aybgzzxz0yrzkds7hbpmq-emacs-org-9.4.6/share/emacs/site-lisp/org-9.4.6/)] Dr. Arne Babenhauserheide
2021-10-01  9:56 ` Ihor Radchenko [this message]
2021-10-02  4:30   ` Bastien
2021-10-02  4:52     ` Ihor Radchenko
2021-10-02  4:59       ` Bastien
2021-10-02  5:25         ` Ihor Radchenko
2021-10-25 12:57         ` Ihor Radchenko
2021-10-25 17:33           ` Bastien
2021-10-26  6:44             ` Greg Minshall
2021-10-26  6:56               ` Bastien
2021-10-26  7:33                 ` Greg Minshall
2021-10-26 17:11             ` Max Nikulin
2021-10-27  7:08               ` (Reopened) Bug: font-lock error with - in code-mode Ihor Radchenko
2021-10-27 11:50                 ` Cancel "yes" entry on updates.orgmode.org (was: Re: Bug: font-lock error with - in code-mode) Max Nikulin
2021-10-27 16:51                   ` Max Nikulin
2021-10-02  5:07       ` Bug: font-lock error with - in code-mode [9.4.6 (9.4.6-gab9f2a @ /gnu/store/2pny4z6mbi2aybgzzxz0yrzkds7hbpmq-emacs-org-9.4.6/share/emacs/site-lisp/org-9.4.6/)] Ihor Radchenko
2021-10-28 14:03   ` Bug: font-lock error with - in code-mode (reopened) Max Nikulin
2021-10-28 14:16     ` 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=87lf3d3w6n.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=arne_bab@web.de \
    --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).