From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id IBeIGEclJWHqDQEAgWs5BA (envelope-from ) for ; Tue, 24 Aug 2021 18:58:47 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id SDM5FEclJWFGVwAA1q6Kng (envelope-from ) for ; Tue, 24 Aug 2021 16:58: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 B375CAE18 for ; Tue, 24 Aug 2021 18:58:46 +0200 (CEST) Received: from localhost ([::1]:46416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIZl6-0003IH-8F for larch@yhetil.org; Tue, 24 Aug 2021 12:58:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIZkW-0003Hm-H9 for emacs-orgmode@gnu.org; Tue, 24 Aug 2021 12:58:08 -0400 Received: from ciao.gmane.io ([116.202.254.214]:50232) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIZkU-0001Bw-6W for emacs-orgmode@gnu.org; Tue, 24 Aug 2021 12:58:08 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mIZkR-00081A-22 for emacs-orgmode@gnu.org; Tue, 24 Aug 2021 18:58:03 +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: Tue, 24 Aug 2021 23:57:53 +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: <87r1ektxe3.fsf@gmail.com> 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: 15 X-Spam_score: 1.5 X-Spam_bar: + X-Spam_report: (1.5 / 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.25, NICE_REPLY_A=-1.305, 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=1629824326; 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=MMGAlY9xyqBPXuhnQ/ZL8Hhr05l8ZdYE88gF0H3CcpI=; b=YtPY2UlIlYoyWpN1krl0ohkIwOkQhQy6VNOlMVDFwarfvXK++KdjDVCteyTrnnVoZaTXlU DfIdI5X9cPnlD894q+PjeGwVsOAUe9a0QTgPNSzLWY9kXx+qHSLXOM9na8YVfhuydPnab5 vpEWnBbJGaHtlbHnIbCSenJBE5WITtyDw39303N99FaUUbpd/rBbpa1Hx0+nLVlwmrH5gf 31nqLsgtw6SXk1+Mbw5FuFuX7Z3GYI90OoTSFYTPGp90Z27Cd3wG3fNkq52rT80earoUzE 9ENv66d/1pb+yT8zKGTHIfCwlrWy0fsv9bfilwxr0cLUhd/XqM5fXJ/CnqkU5A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629824326; a=rsa-sha256; cv=none; b=fKnArRwhpVYHDd5kGUVzR+YnuCXAZr3mhp0a2DixfBF4gimmhds6ytFsXrGgMOI5jZ2BdC WrZ1Iz2n0JRrOYBbHLB8XUASBSF3Bc0ij56PAWuy3a8OPvzxINN7CbjubmP/jsQ4dUN6BB pDNC8NbxQNXNK1pl3FiM0Z0L2QMJrkSTi6zL77UYuRWvpkLodhWXsRWP58szg8BG6+RBcF KDHvChhFTw/L8Zf8f3Iaj87SSI1uBuCqxvB4T+VoVt7jaQ0ztyStNcXnRatOWN3g3u4poC jTRp03oMqaiOC6kFDZ22rqgkneuH4acaGKL73SIszgZdzQa9eoAZHzfQ+1JZQA== ARC-Authentication-Results: i=1; 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-Spam-Score: -0.05 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: B375CAE18 X-Spam-Score: -0.05 X-Migadu-Scanner: scn0.migadu.com X-TUID: Urv64trkKsqf 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). > > If I don’t hear anything bad about it in the next few days, I’ll push it :) > Please let me know if my commit message agrees with your understanding of the > issue. Timothy, are you able to reproduce the issue with performance? Due to the thread https://orgmode.org/list/CAFhsWEgAb_im1WpXp3xsfFxcoahKyycM4GaqRin0SUXxD0gMzg@mail.gmail.com/ "Large source block causes org-mode to be unusable" I assume that it could be quite severe. On the other hand I tried to insert an .el file into org-guide.org and I have not noticed slow down. Actually my curiosity is caused by other performance issues, so I am interested if the effect may be broader. 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 am not sure whether the body of `org-src-font-lock-fontify-block' should be wrapped or its call site. Feel free to disregard my questions since fontification is far aside from my experience.