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 eA1yNRN/H2GJZAEAgWs5BA (envelope-from ) for ; Fri, 20 Aug 2021 12:08:19 +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 nlQzMRN/H2EfBwAA1q6Kng (envelope-from ) for ; Fri, 20 Aug 2021 10:08:19 +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 146D5D7C6 for ; Fri, 20 Aug 2021 12:08:19 +0200 (CEST) Received: from localhost ([::1]:35486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mH1Rh-0003Lz-GQ for larch@yhetil.org; Fri, 20 Aug 2021 06:08:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mH1R2-0003La-N8 for emacs-orgmode@gnu.org; Fri, 20 Aug 2021 06:07:36 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:50277) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mH1R0-0002md-62 for emacs-orgmode@gnu.org; Fri, 20 Aug 2021 06:07:36 -0400 Received: from oxbaltgw02.schlund.de ([172.19.246.8]) by mrelayeu.kundenserver.de (mreue108 [213.165.67.113]) with ESMTPSA (Nemesis) id 1Mzz2e-1n1oV53FFG-00x3t7 for ; Fri, 20 Aug 2021 12:07:29 +0200 Date: Fri, 20 Aug 2021 12:07:29 +0200 (CEST) From: Tobias Zawada To: "emacs-orgmode@gnu.org" Message-ID: <1100798379.523019.1629454049171@email.ionos.de> Subject: 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/) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.4-Rev25 X-Originating-Client: open-xchange-appsuite X-Provags-ID: V03:K1:svN061j5ci3YZVQ6VgrZnjLLsFudGPORfs8EQ5WTM3rNvHl+Fc5 yUYgp5E8rjTlsG1nBPRuJ3Ff7lVs8wjQSmyMSFdLzRckA+rKXRZasG5w5m/JL5WOONF3dCJ sIgI/2hK16uwfarUuNz/pHDWCEzAWLPoOBJGzVPNwRnZeoqZVrr9qy1cUfUKkqa2UcBWV2a Jrlzk3iV3RQqTzhImL3SA== X-UI-Out-Filterresults: notjunk:1;V03:K0:6zG0VwAkyow=:VEFx6v2YK6Rp0VpTZ8gTLM c3Nzz3yQQ0A9gM3DALUYgjm9+dWAB7HgeKvvU7Acjgv32QwpP84kxkvO1lRI3/xwIFoes4mih j5tOLU0gTG6cKzitOU4SU7jIpz1IRfljqjBwbqjQAPX8KkCwEzkUWkqLEP+/Wqd9yEDOocy/z ivgYkpSbyHHd38xcQx0yK/fEV4inS1CBGTV45izvl4DAwkE7uMDHQPuesmglQvwHlS2CwEMRj ncF7sNwTrKguiBfPJibVxyuqMLPyfTFNKfyuuqRQR0Mp9JsLVz3MueC8pZ+0NBEUii0wTRM+7 +iNn0cW5KCOyRtMXqwDVoDrm9SiWV2M4dsRGghtsXOc1jR4WAtG3H0ehLQ7YkfXGWIQsyZKae q8gYW2U2y203K2cYnn7djFjguYNlBTsnxuNRQmpmZrog1dF+Q7qpNs2J2Buqv/KkV2SBM1Dnw Z5QWNOieShAWQlG8gQbXwEySWkbCMLJq7TquGF8PYjA0kNhPi7h1A1GiPzBQ2FJvjXVD+ou4x Xrk43MkQ2JmwUV3UFef+2/JJ3JMoBuQTRyEmijKy0tw3W+vSt1HniHjhctt4lDb1t+P97nILp n0jd2y8E5wEccn+kXfj3q7oPzLvgXOM8vqAq3XM1S7fXZJ5IXC/PCV2ue7e/9ynTfdOl5EYvi hlxuzTeB/pQd0u3mutqpii38blBAeROqbnvBVgBkFPuc0+S09D5NXrBzNcZimT4W/d5ZlBVZ2 xVzVPIDpIXVRdBNqHSu3+yVB8Tmaq5rv93LFODvyDCtk6OtDQnZvY2c1NJkeI6eY+sGr1yPzh 1WOtNOPc5Ks9oEdY7Ngv1n0+9uqD+tjDzZSjVI+V0n0mg+tJMVkaQGaua2Bw1DHqkfqWdd1 Received-SPF: none client-ip=212.227.17.24; envelope-from=i_inbox@tn-home.de; helo=mout.kundenserver.de X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, XPRIO=1 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=1629454099; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=4NzDZWYq0gcdOCAH0gVhStsM4JubxhqQR+LoH9+uTr4=; b=EuSsXjlGSpzPeMyU1PYkywbDtJZeOlRkoIdq/cdIz1PwttanG/fqowWrgjXE1YNV9xPHx3 i+PttGklTlElIEkYwxfgBQEInllt2ISb6GDuajSelS1Jrbyn8rkkp2KnNpsCooYSeTpmNH Bj2UZOShmAnAUXDRRWhzJGVLMmkwZlVut/rmJ1LhmU/vOenmMDm+U2FAMouBAA2FL78LDQ iAJU9cuScdOf/4AqHwAmnQANPrh9iDIfjRtEnVXmhLNbBGnzQzXIbOYW1D5fP4XXIW2swb pZWQVfU8IHRB6TpfvQGs0RRSOTsBXb1uAyBB8xHBgNMUpX3Yn1OWOCHIXW93YA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629454099; a=rsa-sha256; cv=none; b=ls/Gkq2nSSefZznmoGdbbJis4exPDkpJOXkZBLMVorp4KtO0FPDwxIJjjPN6oULI3V+7EJ mdotC1c2oWqRBRsE9aQXiKniFlL6PA1BexBVWjI8MI1xQNvK3Ztnk6jCPSqDFrvAg1eaLw hfc6YTI2QzBDzPiCZbB4uQvHMJKgPhxC0A7WBGpwFIWOZS9oNJvTqVK7HhD+hADRRliIgF LN9DBsgFUK9+MahIB0kSFC3aeDomagWVq+V2xrTmQZGg9C7M5un7k20rordcvh+pEfT+Me JTjhfYiB7X/Pu0UisWX7fTepkeaMACA1z+z+G1JAUYa8p30LDl/uD8e7kKWxhA== 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.65 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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: 146D5D7C6 X-Spam-Score: -0.65 X-Migadu-Scanner: scn0.migadu.com X-TUID: jEkPxW+CQylk ~org-src-font-lock-fontify-block~ modifies ~match-data~ through the fontification of the temporary source buffer. But ~org-src-font-lock-fontify-block~ is also called in ~org-fontify-meta-lines-and-blocks-1~ by ~font-lock-fontify-region~. There it puts the text property ~font-lock-multiline~ on some text from the beginning up to the end of the last match in the Org buffer. Since the source buffer is smaller than the Org buffer ~match-beginning~ is smaller than it should be. This can slow down editing operations in org-mode with large source blocks to an extent to which org-mode becomes unusable. An easy workaround is: #+begin_src emacs-lisp (defun org+-with-save-match-data (fun &rest args) "Run FUN with ARGS but save `match-data'." (save-match-data (apply fun args))) (advice-add 'org-src-font-lock-fontify-block :around #'org+-with-save-match-data) #+end_src Emacs : GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2020-09-19 Package: Org mode version 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/)