From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gPhELn43XGBThwAAgWs5BA (envelope-from ) for ; Thu, 25 Mar 2021 08:10:54 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id wrsJKn43XGBaQQAA1q6Kng (envelope-from ) for ; Thu, 25 Mar 2021 07:10:54 +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 8503E22C90 for ; Thu, 25 Mar 2021 08:10:54 +0100 (CET) Received: from localhost ([::1]:40780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPK8q-0007vF-5e for larch@yhetil.org; Thu, 25 Mar 2021 03:10:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPK7o-0007us-Lr for emacs-orgmode@gnu.org; Thu, 25 Mar 2021 03:09:48 -0400 Received: from mout02.posteo.de ([185.67.36.66]:49635) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPK7m-0003B6-2a for emacs-orgmode@gnu.org; Thu, 25 Mar 2021 03:09:48 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 6FB342400FC for ; Thu, 25 Mar 2021 08:09:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.eu; s=2017; t=1616656181; bh=wpNherpZZ/nmb6bHgnOy2md/90Nif6wHOSmVTo7hQ7I=; h=Subject:To:Cc:From:Date:From; b=rH70mtQjt5ssxGoup3bUqXyUELjger0SEhDzQtQwl9SaurTpgGlBuI0NvuZPI5Qpr NS6USiJsNLwRX2JaSx5e1W776x0AkMa4/mbc/LUjwtdTecd5U/wRE+t9p6TNscUbSe TE9cvKCk9pLRaAXpmH/A+Km7snB0QdPcFwiVTRltlR4SlhTFmvQdf2BO+GOtUzX44n UmqczU8WwTleiUisSi1GSkTw+EZzN0WC635Egri/E42FDMg4crTaEfQtgXsEhVXbbw 8klFOEHUeCGnP0I3OylLc/VSg0fhewuzekeBJJS7DUW0O3w+7qj8cYVqUaXozDr6dq y2wp7f9LIBOJQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4F5bnw5VVsz9rxg; Thu, 25 Mar 2021 08:09:40 +0100 (CET) Subject: Re: [PATCH] org.el (org-do-latex-and-related): Fix duplicate 'latex-and-related faces To: Kyle Meyer References: <580b0b82-798f-0b82-aaf7-67015aae1c6c@posteo.eu> <87czvnuacs.fsf@kyleam.com> From: =?UTF-8?Q?S=c3=a9bastien_Miquel?= Message-ID: <7447ad40-4711-bd04-79d8-0a5bad199938@posteo.eu> Date: Thu, 25 Mar 2021 08:09:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <87czvnuacs.fsf@kyleam.com> Content-Type: multipart/mixed; boundary="------------2BC05D1A9719403447656CB8" 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, NICE_REPLY_A=-0.001, 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 Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.00 Authentication-Results: aspmx1.migadu.com; none X-Migadu-Queue-Id: 8503E22C90 X-Spam-Score: -4.00 X-Migadu-Scanner: scn0.migadu.com X-TUID: qra/zidOv6H9 This is a multi-part message in MIME format. --------------2BC05D1A9719403447656CB8 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Kyle Meyer writes: > Please add a period after the changelog entry. Done. > Any reason not to pass limit as re-search-forward's BOUND instead? I've looked at the history of this code, and some earlier comment indicated that limit was ignored on purpose. The only case where it'd make a difference with my patch is when limit is in the middle of a latex fragment (since re-search-forward's BOUND bounds the end of the match). Now, AFAIU, this should almost never happen, since the fontified region is extended  + according to the font-lock-multiline text property, that latex    fragment do have  + and to contain matching begin/end delimiters. I can think of a few edge cases where it may make a difference :  - If you write a multiline fragment, and add $ delimiters    afterwards, starting with the closing one. Then when you add the    opening one, you wouldn't get fontification, I think  - If you add an empty line in a multiline $ fragment by mistake, which    breaks fontification, then remove it -- Sébastien Miquel --------------2BC05D1A9719403447656CB8 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 7fb4e2d408791742281bf220d227ccdcfd5baa71 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.31.0 --------------2BC05D1A9719403447656CB8--