From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id ObazAjYRXGDxOgAAgWs5BA (envelope-from ) for ; Thu, 25 Mar 2021 05:27:34 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 6KzwODURXGDwLAAAbx9fmQ (envelope-from ) for ; Thu, 25 Mar 2021 04:27:33 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 00E561F6C2 for ; Thu, 25 Mar 2021 05:27:33 +0100 (CET) Received: from localhost ([::1]:51834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPHal-0008Ht-Jj for larch@yhetil.org; Thu, 25 Mar 2021 00:27:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPHaO-0008Hn-JD for emacs-orgmode@gnu.org; Thu, 25 Mar 2021 00:27:08 -0400 Received: from out0.migadu.com ([94.23.1.103]:47195) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPHaL-0001El-Gi for emacs-orgmode@gnu.org; Thu, 25 Mar 2021 00:27:08 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1616646421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+JvPmQ75Des/KPQtExdsKsTT2is0jCrKMQ8CdGmd5+E=; b=Sim6h1OY80jOV8ficMEemzr0dgM2DqrHanDAEypTisge/xmeCy4pgtwi9xcEMy4ugz3RDp OBup0Y8xwYpVIgInxHv157HPaFUVF6v44ts+fUwrdVdLKhpDTM/B3WL1KE0yRknrphL7Kt ZluTF/2kYm2a3DrP6xiid6OseV80z9/V4emwyN12lI+99UrtlmjmW1lmj9SPLD4ih5KgCo +PW2sFJp0F2EmKL1A28T4cI/enLDQO3pT2dOfYZ7RkblL90vpXYkPI5SeAxhHe1iRqg/xl p43gGFdkg1LrO5GkZb0gzqSewKAVOgCTqDReZL8vFCXmR9qpXrWj1mQEWSM87g== From: Kyle Meyer To: sebastien.miquel@posteo.eu Subject: Re: [PATCH] org.el (org-do-latex-and-related): Fix duplicate 'latex-and-related faces In-Reply-To: <580b0b82-798f-0b82-aaf7-67015aae1c6c@posteo.eu> References: <580b0b82-798f-0b82-aaf7-67015aae1c6c@posteo.eu> Date: Thu, 25 Mar 2021 00:26:59 -0400 Message-ID: <87czvnuacs.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Auth-User: kyle@kyleam.com Received-SPF: pass client-ip=94.23.1.103; envelope-from=kyle@kyleam.com; helo=out0.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1616646453; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=+JvPmQ75Des/KPQtExdsKsTT2is0jCrKMQ8CdGmd5+E=; b=OmzRq4ZDyEWUzBC8GAROlhJ7weIga9gp0DjdUIw8b4eqMaPwxrN1Ah97pHUOru1fX//1T4 Ieop8+SFy5XHazu3ToYYbm9JLYyzWPG8XLD4DM9uRJ/IV0EgAYJUz/Q3ORLWTlD3YdYJcg HCbX6kBzA2hkIiG5JnDdL6HiKLIst/luk25HR05SXdrrOZtVMAXhf0y4s9QG0vt54Ek7F0 o0qfemL36jug92E12Y+9lWxG7Q6teXu01+vVT2fQzs7hMVJxNzXjKzMgkz2cw6wPjOgZsl HoLe9FHr/ozBwNeiUrM8WDfdB20MeqkdC31DYOl97wNgQ1miJCVCUzQIU69kTg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616646453; a=rsa-sha256; cv=none; b=Tt/lTLAxI4MaE/IABgdvnlk5pWZF08OgfI2NlJDXQTYPviQFhQ1NcdbwNY1pTvNwPsVqkI MRhpUVAJkzo0hXujGz5aRtpI5vArtecgdQdeFdy7boTqpIqpLIGyzS73ktTKEkwgxuio/q 9koc0mWkG2dsyw873hrJ0n7fWWEurNAeLJmyCt3BtdTXUHeFyTs9RrQHGQgHXz3HRX+sFJ mQyJIyZaoiwd/LAv5j1pDmAclw/l9LtAEQc+8hXIy+Oynorr7Oh3OoLxuYCYnjwdYLRArT 2N+naqlg3UrbXqyvP/s41DKFqbdUOjDE8b1D+T/0Ds5l+t6KLRgw4LrfFTv6oQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=Sim6h1OY; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=Sim6h1OY; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 00E561F6C2 X-Spam-Score: -1.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: H0B2OccnJ+zq S=C3=A9bastien 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. https://www.gnu.org/prep/standards/html_node/Style-of-Change-Logs.html > --- > 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 > + ((>=3D (match-beginning 0) limit) > + (throw 'found nil)) Any reason not to pass limit as re-search-forward's BOUND instead?