emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: sebastien.miquel@posteo.eu
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] org.el (org-do-latex-and-related): Fix duplicate 'latex-and-related faces
Date: Thu, 25 Mar 2021 00:26:59 -0400	[thread overview]
Message-ID: <87czvnuacs.fsf@kyleam.com> (raw)
In-Reply-To: <580b0b82-798f-0b82-aaf7-67015aae1c6c@posteo.eu>

Sébastien Miquel writes:

> With the current org-do-latex-and-related function, fontification of
> a region before a LaTeX fragment repeatedly adds the
> 'org-latex-and-related face to the fragment.
> You can reproduce with an org buffer with the following content.
> The attached patch fixes this.

Thanks for the clear reproduction steps and for the patch.

> Subject: [PATCH] org.el (org-do-latex-and-related): Fix duplicate 'latex faces
> * lisp/org.el (org-do-latex-and-related): Do not add a
> 'org-latex-and-related face beyond the fontification limit

Please add a period after the changelog entry.


> ---
>  lisp/org.el | 2 ++
>  1 file changed, 2 insertions(+)
> diff --git a/lisp/org.el b/lisp/org.el
> index 4db2dbe04..a0c703630 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -5502,6 +5502,8 @@ highlighting was done, nil otherwise."
>  	(while (and (< (point) limit)
>  		    (re-search-forward org-latex-and-related-regexp nil t))
>  	  (cond
> +           ((>= (match-beginning 0) limit)
> +	    (throw 'found nil))

Any reason not to pass limit as re-search-forward's BOUND instead?

  reply	other threads:[~2021-03-25  4:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19 16:56 [PATCH] org.el (org-do-latex-and-related): Fix duplicate 'latex-and-related faces Sébastien Miquel
2021-03-25  4:26 ` Kyle Meyer [this message]
2021-03-25  7:09   ` Sébastien Miquel
2021-03-27  6:07     ` Kyle Meyer

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=87czvnuacs.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=sebastien.miquel@posteo.eu \


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