From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 9/glC/8vJmGdeAEAgWs5BA (envelope-from ) for ; Wed, 25 Aug 2021 13:56:47 +0200 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 8Ax6Bv8vJmHQEAAA1q6Kng (envelope-from ) for ; Wed, 25 Aug 2021 11:56:47 +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 6C0F21ED39 for ; Wed, 25 Aug 2021 13:56:46 +0200 (CEST) Received: from localhost ([::1]:56220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIrWP-0000GF-F2 for larch@yhetil.org; Wed, 25 Aug 2021 07:56:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36080) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIrW2-0000FA-3s for emacs-orgmode@gnu.org; Wed, 25 Aug 2021 07:56:22 -0400 Received: from ciao.gmane.io ([116.202.254.214]:34884) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIrW0-00026o-JX for emacs-orgmode@gnu.org; Wed, 25 Aug 2021 07:56:21 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mIrVy-00033r-Qx for emacs-orgmode@gnu.org; Wed, 25 Aug 2021 13:56:18 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Maxim Nikulin Subject: Re: Bug: org-src-font-lock-fontify-block should be wrapped with save-match-data [9.3.7 (9.3.7-4-gba6ca7-elpaplus @ mixed installation! /mnt/c/Users/toz/Weiterbildung/Soft/Emacs/ and /mnt/c/Users/toz/.emacs.d/elpa/org-plus-contrib-20200615/) Date: Wed, 25 Aug 2021 18:56:09 +0700 Message-ID: References: <1100798379.523019.1629454049171@email.ionos.de> <87r1ektxe3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-2.24, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , 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=1629892606; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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; bh=nj5NDiayckga7CjMzpLrREuf1hyvTB7bXkF26GJROvU=; b=a/z59wweEyR03SDJiJEPR8qUXg/kRkOAFaSQYCjmJ6h/H0+GWNvOZw8k0TDxm5BuLf1TpG /cKO17ZNp+eO1uE74645RZirZPAxRadQGqWcHNWYWGUlpb3ZhgyBRc6npxpMolCJqit4y8 CxrGTubLQOnmybQS+wnNBf+EUj0BVynK0hzKbhGig7wZTltdiE7cnDamfw9AWae85Pk0pv iue2wV3tss5kn6GVM3xXbV09R3Db6KiDckOag7L9dj3xk30jxWzF6wtGhfhrBHEyxvfw1+ NQuv2/aahG0jU9vUaQxgGoZCEmbI/OqQ8YG0Qay4JCfl/MtxHAlAiZdxuX3Rxw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629892606; a=rsa-sha256; cv=none; b=oUp8oQ5p3eHzdz2Je6xy/1M8ZlpD1lq4SWW2vQwpjJzt7NKcaWDpP46wqJObYZrdyGtshM 7Rz5ymuG7SiB7gMbBhOvhhgr708I9NUc2fkblj2nXFDWhkdzkVUYHriCudOZNph/LhEsUP 8RUZqe4Yt5xaUA8mwuPR1n60Sdsevk9KY5IGNol4eZDS9vyJGuumyLr+APgKmAORaxb50Y UWIrrhpaBToBjthThiCiQ1xtYwglmNslex4MSnVajNLaqWpumSKF0Pzp/ZMXzLRYgBczE3 DsKuBaDDEPPpIhYFK86Svj3R6v5dZ52lTDtbxJAAmPQbR626wQ9/g7nI5qK6cw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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-Spam-Score: -0.06 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=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: 6C0F21ED39 X-Spam-Score: -0.06 X-Migadu-Scanner: scn0.migadu.com X-TUID: +P4X6qFGdnTb In my previous message I forgot to mention the subject of the initial bug report: Bug: org-src-font-lock-fontify-block should be wrapped with save-match-data [9.3.7 (9.3.7-4-gba6ca7-elpaplus @ mixed installation! /mnt/c/Users/toz/Weiterbildung/Soft/Emacs/ and /mnt/c/Users/toz/.emacs.d/elpa/org-plus-contrib-20200615/) Notice "mixed installation!". Often it is source of obscure errors. https://orgmode.org/worg/org-faq.html#mixed-install Maybe link to FAQ item should be added to bug report template when mixed installation is detected. Since mixed installation can be detected, I would consider issuing a message during loading of Org mode. On 24/08/2021 23:57, Maxim Nikulin wrote: > On 23/08/2021 14:45, Timothy wrote: >> >> Thanks for your efforts. I have prepared a patch accordingly that wraps >> org-src-font-lock-fontify-block’s body with save-match-data (attached). > > The following question may be dumb since I am not familiar how font lock > works in Emacs. Is it necessary to wrap whole function? I do not see > explicit operation with regexps. The only suspecting line is > >   (org-font-lock-ensure) I think, now it is irrelevant, so just for completeness: initialization of major mode might affect match data as well (unless (eq major-mode lang-mode) (funcall lang-mode))