From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id WO6FH/jXVGDiKwAA0tVLHw (envelope-from ) for ; Fri, 19 Mar 2021 16:57:28 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yM4+G/jXVGDqIwAAbx9fmQ (envelope-from ) for ; Fri, 19 Mar 2021 16:57:28 +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 BB5A31EE11 for ; Fri, 19 Mar 2021 17:57:27 +0100 (CET) Received: from localhost ([::1]:51122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNIRB-0004iL-HL for larch@yhetil.org; Fri, 19 Mar 2021 12:57:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNIQo-0004he-DE for emacs-orgmode@gnu.org; Fri, 19 Mar 2021 12:57:02 -0400 Received: from mout02.posteo.de ([185.67.36.66]:40811) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNIQm-0000zK-AF for emacs-orgmode@gnu.org; Fri, 19 Mar 2021 12:57:02 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 251652400FC for ; Fri, 19 Mar 2021 17:56:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.eu; s=2017; t=1616173016; bh=KJGsiWoLFVNOsvLwXxlSeL9L1Nsee5hNTDwdgHYz1po=; h=To:From:Subject:Date:From; b=CtvdSL0njHsDI0VRG5dWpMTBvOAnExjMFKRqdfVHUFH0KLFYjPuGPHOiwlIUkmVD2 LfViFG2ZhXm/9Nl/a5ol12um2AQwq2neEKE9YS9Ttnnc+VazoAJW7oqm87i+RWgazW Cto7o8jLy0eL6AfYGUty+Q9IuQH1GBhmJr4QFS9hJYnsOSyMFa3kUArzkNDPlDH5NP jKDNB7FHyZ/jj6mHyV3cxuTIcf4cYGw0OVeo41MdVLQisGqyfO3EY2ytwDQb9jupUe NGgjzjxirDVzxge9DdFyCFL2rq6mlM0aVGe3QvJLMKThhGLS8c05Qb4HkVsdStTKzX wDQXwm6LnNVFQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4F296H4Fgcz9rxd for ; Fri, 19 Mar 2021 17:56:55 +0100 (CET) To: emacs-orgmode@gnu.org From: =?UTF-8?Q?S=c3=a9bastien_Miquel?= Subject: [PATCH] org.el (org-do-latex-and-related): Fix duplicate 'latex-and-related faces Message-ID: <580b0b82-798f-0b82-aaf7-67015aae1c6c@posteo.eu> Date: Fri, 19 Mar 2021 17:56:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------4C90C024AB805A423296ACFF" Content-Language: fr Received-SPF: pass client-ip=185.67.36.66; envelope-from=sebastien.miquel@posteo.eu; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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: , Reply-To: sebastien.miquel@posteo.eu 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=1616173048; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=u3MnaUS6oroiTiN723gj39xC3cXCFssEs3W35wNw+JA=; b=tR8AaWyE++nvZDpTJ2WpgzahngiBHBFRCv18eUTOD+CGTHrJ31mw7ZNQrnshcxbW15VL4d sSbz2nuwTnfKgPLT4i/kpXDNG+3q2OxI98Fie4pALbDXcC2EnYTmjnkDAg7vjsnnNUSwxi 1icTMtocbVDdQRhLnlshSyUbjHujLlMNwa+8bPLrkxN2HPcYdRcJ4ZSH9kgAcuS0ookEI/ pcQ5RLK3fzpQl1++j/aDmBTgQ0xA8yiAPaEjeBJZjvfoFN2TgPcz6Zjk/fJJnbNTx2y0I2 /Erh5I+SnmOhpSgF0DN9/3xVsv3LGxwsl88V4ReC73H/LbtTaF/RzLFbLIMe7w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616173048; a=rsa-sha256; cv=none; b=e39GZhC3KMt6TLq/urDTly0k38vpl8nYWYaMYCwiqYHCrsKPazmQhAV6saHrMnTv5LLVZl wXDfSVgPJZS2j8CpfnCq5Q4ecQ+Klt+tsLmQub+li/iHUsz0X1UexjGMlH6BbutddbfgMh +tA3oU6S3mN/jp3sQ+iL2HOyrjrCpnT7TwbOhVhRu6KmY9iBNpq43TYDmGRYj50la4G3fb KM5Q5G8UfnLpiRE8EStdGAAm7MelWjwL6k1rTe0kTFifbUhj9Yg91JDaaMN6x0KmrBoiTN 7+yvmdQ5ZoeqLxKYsa3FJT+gY8rKO4DVjocvFXJjk1sPZYO2X25ZQjdajClymw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=CtvdSL0n; 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: -3.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=CtvdSL0n; dmarc=pass (policy=none) header.from=posteo.eu; 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: BB5A31EE11 X-Spam-Score: -3.11 X-Migadu-Scanner: scn0.migadu.com X-TUID: EM7BhKxKFHoI This is a multi-part message in MIME format. --------------4C90C024AB805A423296ACFF Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi, 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. #+BEGIN_SRC org Foo  $a^2 + b^2 = c^2$ #+END_SRC  - Use (setq org-highlight-latex-and-related '(latex))  - Write some text at the end of the first line, triggering    refonfication of the line  - For each character inserted, the org-latex-and-related face is    added (as a duplicate) to the fragment, as you can check using    describe-text-properties. The attached patch fixes this. -- Sébastien Miquel --------------4C90C024AB805A423296ACFF Content-Type: text/x-patch; charset=UTF-8; name="0001-org.el-org-do-latex-and-related-Fix-duplicate-latex-.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-org.el-org-do-latex-and-related-Fix-duplicate-latex-.pa"; filename*1="tch" >From ccce24e08b903e0e955a6b22f6c7321851ec5750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= Date: Fri, 19 Mar 2021 16:55:27 +0100 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 --- 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)) ((cl-some (lambda (f) (memq f '(org-code org-verbatim underline org-special-keyword))) -- 2.30.2 --------------4C90C024AB805A423296ACFF--