From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SKbbHJZSUGHoGAAAgWs5BA (envelope-from ) for ; Sun, 26 Sep 2021 12:59:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id +P6aGJZSUGE4OAAA1q6Kng (envelope-from ) for ; Sun, 26 Sep 2021 10:59:34 +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 8FCA42FE85 for ; Sun, 26 Sep 2021 12:59:33 +0200 (CEST) Received: from localhost ([::1]:59604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mURsa-00051j-L7 for larch@yhetil.org; Sun, 26 Sep 2021 06:59:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mURrN-0004tp-QZ for emacs-orgmode@gnu.org; Sun, 26 Sep 2021 06:58:20 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:37540) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mURrL-0002va-3C; Sun, 26 Sep 2021 06:58:16 -0400 Received: by mail-pj1-x102a.google.com with SMTP id me5-20020a17090b17c500b0019af76b7bb4so13106149pjb.2; Sun, 26 Sep 2021 03:58:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:references:user-agent:in-reply-to :message-id:mime-version; bh=5+NnMU7KYNhafV3X/s2DHBYV47FELFLNv6f8Wq+NzFc=; b=OBIZcufYjxC12WZfhfyNlXlktzZL7ZV7pteCe9S0emJ+z8/KRh+8jlGnRm8e6dB5tj 7DB1hg7z7cX10MlVA6avxBayX5EbPE1TIAXQTGzuWR6W1BUib3kAC8PggThIeAat3Li2 RUycXMLZtSbXdgttyiRAYnMaBfRBBegsgbsGRExF9aoIGSCxxtoI93jRDh4s5Vj3wJrQ K1g3hRPIEKdJr9s7JY54XBorreu0hh1LDqsOdC2Nv1/Q1bCjfEGLwTK1cp/k8RWH8Otc wFciONdZRiIzFqfv8uef8zZ1mudcKRuUfR9qm7n4QVS3p6INPltnUee1z+UQOSjy5Irg /xJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:references:user-agent :in-reply-to:message-id:mime-version; bh=5+NnMU7KYNhafV3X/s2DHBYV47FELFLNv6f8Wq+NzFc=; b=ZQvyG16L4AIfR8MijMqZ/LbKF04jfJInKsyxIYpwpriajVWpKTP7C0M60cT4gM9Kx3 ceOQxlzU3CBHCzXhueQlW01HcMozJ8i4a4aZWdGl/vL3fulSXmObwcWYxdq7SL3u2XgW 8qo9IQ77W1785hiUcoUGf0c1E67wGl8Ng/qsU+9XSCib8eMIXDEynDnC6g1zeu7+q7wv biFy6lPCGk5AleFcbebVhu848AReUE72ukaV/tde2bGYi6xoZluyZZydK86drxm+/uXn 1s0Ip0CWxG/BjhNYTuZoqdLJiwA8SpQUMajkR1tbbywZKPn4F8zBUajNKS1DUVV5O0x2 sL5g== X-Gm-Message-State: AOAM532ZJasUNfOZ7edWRIIvsSgXIuMKZIvTVDFA9C1DU0+KOHTWDsUF xXt6wYxgeILW9bt4OcIdFPzSVwKQn4c= X-Google-Smtp-Source: ABdhPJxdyzUGAT8henjCSDBywg+nAP8vax1Cb5TnqiErRCFmqJPl+lGctj3cy4vCdhg3IzN/Vaw8hA== X-Received: by 2002:a17:90b:3841:: with SMTP id nl1mr13037594pjb.206.1632653893152; Sun, 26 Sep 2021 03:58:13 -0700 (PDT) Received: from localhost (61-245-128-160.3df580.per.nbn.aussiebb.net. [61.245.128.160]) by smtp.gmail.com with ESMTPSA id d5sm12961379pjs.53.2021.09.26.03.58.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 03:58:12 -0700 (PDT) From: Timothy To: Bastien Subject: Re: Bug: Fontify error with markdown source block [9.4.4 (release_9.4.4 @ /usr/share/emacs/28.0.50/lisp/org/)] Date: Sun, 26 Sep 2021 18:53:17 +0800 References: <87h7ej35yq.fsf@gmail.com> <87ee9b4r0u.fsf@gnu.org> <87lf3jej0g.fsf@gmail.com> <87mtnzbpqm.fsf@gnu.org> User-agent: mu4e 1.6.5; emacs 28.0.50 In-reply-to: <87mtnzbpqm.fsf@gnu.org> X-Woof-Patch: applied Message-ID: <87h7e7eh8e.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=tecosaur@gmail.com; helo=mail-pj1-x102a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: Yikai Zhao , 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=1632653973; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=5+NnMU7KYNhafV3X/s2DHBYV47FELFLNv6f8Wq+NzFc=; b=OKl/A6RhrS2WhJPWPr5fHtViLIFXVPcknUN7TbzXkypB136SDgSzXncnWKiruyDJTg9zKQ cFwdPXppVxlY6GBlDaKIyZqvQWDP0mP1nXtGYoq3EYa2/Vu0/lqch2hGpKydCCoTmOlAQY khryXerrVJjfsDi0Zdu1e/NQfEKbNQHMhMlhWi0hpKy4gckWS+311e/jCkJOyrHt/6YpB7 rv7C4N4hP/T1sX+mjDSLpMXOdgiC9/x0Hs26seAO+WlWln9g5ej2Jtvz7CCCMYbtuY2INh yUfApvQDGO9fft3iZts67OM/yqLU42tyGXCFKsulT1YlRo8KSt/gNDdK8c8Y3w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1632653973; a=rsa-sha256; cv=none; b=dv9C3pNNX0Es0/xvGfEhETFEcTRTSsT3vVg2UXSapgmU//ZclEgXvH9WtNDY8EV9b0w+uw 6VamuAqiFHQoNeIFxzioBN5JjCyp62rMO4MMmpebxk1KPNOyLSk3GRnTbbSlCyb49VvicM CNArWrlnniXSE3LqbWFg8gz4CUAvKQ9GZhoNgCOeYFIBDyTZjRy836WDnb1PuKYnHHUscq Qr1hVbBniXuwsABsDoWPRcDgtx56FxUmerPPYK+6Mksfl/SGvmTfkq93rjpmdZFe7ergiP bDUindWy4CBYhJna+GURgeIGNA6gNYGNhgp1vYc9URN2YNOrYhO+UeT228JJnA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=OBIZcufY; dmarc=pass (policy=none) header.from=gmail.com; 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.59 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=OBIZcufY; dmarc=pass (policy=none) header.from=gmail.com; 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: 8FCA42FE85 X-Spam-Score: -1.59 X-Migadu-Scanner: scn0.migadu.com X-TUID: wa0xj5rlvtSS --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Bastien, > Okay - can you post the patch in this thread? Ahh, I forgot to attach it didn=E2=80=99t I. You should find it attached to= this message. > After you send it here, you can push to bugfix and merge the bugfix > branch into main. I=E2=80=99ll do exactly this shortly. > You can also add the X-Woof-Patch: applied header to your reply. I fully intend to =F0=9F=98=80. In fact, I=E2=80=99ve recently made this mu= ch easier for myself (). In case this is of interest: All the best, Timothy --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-Fix-potential-modified-src-match-data-issue.patch >From 0c3571097bda58d1ef0fd0554322a42ff7068a67 Mon Sep 17 00:00:00 2001 From: TEC Date: Fri, 17 Sep 2021 17:23:58 +0800 Subject: [PATCH 1/6] org: Fix potential modified src match-data issue * lisp/org.el (org-fontify-meta-lines-and-blocks-1): When this is run on a src block, a "leaky" major mode called in `org-src-font-lock-fontify-block' can modify the match data. This is problematic, as the match data already set is important for font-lock. To protect ourselves from this behaviour, we can wrap `org-src-font-lock-fontify-block' in `save-match-data' to ensure that the match data for the src block is conserved. --- lisp/org.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 733dda429..64f82b5ee 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5330,7 +5330,8 @@ (defun org-fontify-meta-lines-and-blocks-1 (limit) (org-remove-flyspell-overlays-in nl-before-endline end-of-endline) (cond ((and lang (not (string= lang "")) org-src-fontify-natively) - (org-src-font-lock-fontify-block lang block-start block-end) + (save-match-data + (org-src-font-lock-fontify-block lang block-start block-end)) (add-text-properties bol-after-beginline block-end '(src-block t))) (quoting (add-text-properties -- 2.33.0 --=-=-=--