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 wDWNJUjh0GAELgAAgWs5BA (envelope-from ) for ; Mon, 21 Jun 2021 20:58:16 +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 uB6fIEjh0GBBWwAA1q6Kng (envelope-from ) for ; Mon, 21 Jun 2021 18:58:16 +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 74E67F4E7 for ; Mon, 21 Jun 2021 20:58:15 +0200 (CEST) Received: from localhost ([::1]:45334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvP7e-0002PI-Bd for larch@yhetil.org; Mon, 21 Jun 2021 14:58:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvP75-0002Nh-Oc for emacs-orgmode@gnu.org; Mon, 21 Jun 2021 14:57:40 -0400 Received: from mout01.posteo.de ([185.67.36.65]:42393) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvP72-0007na-U3 for emacs-orgmode@gnu.org; Mon, 21 Jun 2021 14:57:39 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 238A9240026 for ; Mon, 21 Jun 2021 20:57:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.eu; s=2017; t=1624301849; bh=z9ff5WBR9kvSq1qy1m13R9QxlgavcWBbzQbVSuUxWtU=; h=Subject:To:From:Date:From; b=N26yQciVUP5802gdqVMP3p1U56urntzojCBXPYuzM7X2ulq/FdxP+hE/fNgEXsxIK HlEdmeGrMLvh2aqegONGOWdouOxv6C2+xg5FmkQGBJwfUwnJfxqL2z4mctNmOk2Nk0 yy/823WqVfTD9DMAWjIpLL021Mk+UmkOYq/g6HQ4rBWXririOkFEpvHr1nTtjniSlw dcSAvadtv/iP+3uUZAxyOQNX/PI0pBKezdxrexVs9DYQqKMToxIT4kyq5ApVNpdzP9 qqjHtMQPd5cRRjcONwRI7/qp2n/kDbY5Qqz5CsZ9T4b8xa6ZBQea5Em0B4P8ENlrUt L3y0F9z/KPusw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4G7zL005qPz6tmM; Mon, 21 Jun 2021 20:57:27 +0200 (CEST) Subject: Re: Large source block causes org-mode to be unusable To: =?UTF-8?Q?L=c3=a9o_Ackermann?= , emacs-orgmode@gnu.org References: From: =?UTF-8?Q?S=c3=a9bastien_Miquel?= Message-ID: <79aa8ce7-b387-06d8-3eef-c4858970c970@posteo.eu> Date: Mon, 21 Jun 2021 18:57:27 +0000 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: fr Received-SPF: pass client-ip=185.67.36.65; envelope-from=sebastien.miquel@posteo.eu; helo=mout01.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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 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=1624301895; h=from:from:sender:sender:reply-to: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:dkim-signature; bh=p7dzHWOmKQ4fGe8gEXqHgh7iJldE38nx9RepvzUZDRk=; b=e9fsJqQ1hWTDAUDlKy0NKs3nPBADisdTu9KIiGqE2rh5MPtAed49X51kMQs/0oHQuFPXtg VVcT41o94JHJZ3uPziFwV9E7A/gqHfNvPrS7m5NIO9MreNUfIu3CGpZQJNj8UfZ/oK/uzV 9pCKDcPC6DtpCaWZLyGNMU5oMW1At42S0sEySETOynUVFszOnA6hRAQ6AuIQR5aIQVMB4w GxfxpCP7XjB6+PGLQ0Q3SFPSwES7cVr59UvBHs49TBSQIDPBA/3QFL5sltu0DP3NW5gdws zZY5T0+RlfrUoSDJ6fjcWKJhoIQVNW2o2gWH8VluBSihSastCvUGD09dou/5PQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624301895; a=rsa-sha256; cv=none; b=qQS9z3jhKjE8s5e3J8nXFCjn9v9pgzBpbKoDQY8/0JM42xDhOJHE1yeK2blPfhPPDDZkPs aCZjAMj52+lEAPN/ZA+ajgfVmn7W+WvZ5DpQB2lmBozq3wwYAz+UdZ28odQO3FzP9Nvqfd 7zJRZUGkCY0hPwRn180NU/m+tpdtfrzXjEKJ6g052kjn8VcJrleb0FUufepjUFTarTMIE7 lwnsPN1GiaugHk6xVR7DB1ZNeuewZjfaA2w8jFZCcjgB5l9YE8WEiW4GbWtRN4Fa2PIWsp ywUKgp55I2legyVaWGaFpzDFa+Q4ZbI15HWU5HDEoLcFv0qiZEgzc+wPNCTjXw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=N26yQciV; 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: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.eu header.s=2017 header.b=N26yQciV; dmarc=pass (policy=none) header.from=posteo.eu; 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: 74E67F4E7 X-Spam-Score: -3.12 X-Migadu-Scanner: scn1.migadu.com X-TUID: r4QfMXkbPhZO Hi Léo, Léo Ackermann writes: > I am working in an org-file of reasonable size (<2000 lines): my first > paper written in org-mode. Everything fine (and fast) until I started > to add `#+BEGIN_proof / #+END_proof` within my .org to make my .pdf > export prettier. This caused the editing of the proofs to be very > slow: navigation within the proof is fast but adding/removing any char > takes around 4s per char. > It seems that the fontify function is responsible for that (see > screenshot). As far as I understand, this function tries to fontify > the whole block as soon as a single char is modified. In my case, it > then tries to fontify a whole proof (~4 pages in my .pdf, with many > LaTeX formulas) several times per second... You can try setting org-highlight-latex-and-related to '(latex) instead of '(native). Even with this setting, latex fontification in special blocks is slow. The reason being that the whole block has the `font-lock-multiline' property, hence every char insertion triggers refontification of the whole block. In the function `org-do-latex-and-related', I commented out the second condition of the `cond' form, which makes calls to `face-at-point'. This yields a significant speedup, and was enough to make things bearable in my cases. You can also try to simplify the latex regexp. If you try these, I'd be interested to hear how much of an improvement theymake. Regards, -- Sébastien Miquel