From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id qJv0MB8Cb2S7cQAASxT56A (envelope-from ) for ; Thu, 25 May 2023 08:37:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id mJcJMB8Cb2TZGQEAG6o9tA (envelope-from ) for ; Thu, 25 May 2023 08:37:19 +0200 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 701B1A4FF for ; Thu, 25 May 2023 08:37:19 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q24aE-00010l-Im; Thu, 25 May 2023 02:36:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q24a2-00010E-C5 for emacs-orgmode@gnu.org; Thu, 25 May 2023 02:36:13 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q24Zz-0006O7-7p for emacs-orgmode@gnu.org; Thu, 25 May 2023 02:36:09 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id C056F24002B for ; Thu, 25 May 2023 08:36:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1684996564; bh=Fe1NYNOpw5NUJH1AJXGdtVj4VbhvgWSEMT+EZ/ko7ao=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=Dxc22nKzGERm7s1nhMBuJLWyPeYyq2XeB668hBtek+e0t3rK9P0aaZKtm2MN8tN2R iO8H6oqY5ZSpxJndiSaUdHV+39nPO8AtVRcWtehkGJSOBi71UISI77N26xuXR5/VlZ 7PDi13BOka/Eajm7NmOmXdHch+nfVKTGcpdxWZTR+iFiFGkyoQjQXCdWjr7EEIn52W yun5MX3TCHiMho4Twu6TqQK5AWBVnCl4fzARqOCWkkA2JvdZkGrkwRlzDByhO28tAZ PV0nYHCIPwAtoHg3hLU/k5HhOmp6tGQoIYgtqff7LJV+435RrX5QFYcphpRJCAdasI 78BvjBKkotx2g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QRdc42Wn8z9rxK; Thu, 25 May 2023 08:36:04 +0200 (CEST) From: Ihor Radchenko To: numbchild@gmail.com Cc: Org mode Subject: Re: [QUESTION] Hope to improve the `org-set-font-lock-defaults` performance by lazy and limit to current visible area In-Reply-To: <646ee2c7.170a0220.bc877.0cfa@mx.google.com> References: <646ee2c7.170a0220.bc877.0cfa@mx.google.com> Date: Thu, 25 May 2023 06:40:13 +0000 Message-ID: <874jo0ykvm.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1684996639; a=rsa-sha256; cv=none; b=daPl+tf28jZl/lxbVIFjfiuofsbPE99F3fjA5uX+tEODPQTtsx6XTpMoA4k+Rw6gdgmnoP 3LEVeIvj3AITCFO7+DHxG1VQD0WPYIHU1nhsT32bPluCFquvKxWPZgm7SUs/eONXaGedEr MzS3n0jeqS9BQUOC22U/F56rGbL21XpgHCURbz8zutinjWGdOWfBwxd0iXieAZq79LPqw2 usfzcY9mQQmsgxjRF9hfsuGbkVznwCIUTKLMhIzw/vPC7e3eW13V5mYgBmuRCle1zk48Sf T/kYPrlNtPejwd2yf3kubIUi+AYYg+buaOGTa8J1Jg7HindSIsgKtpYFdVxDKg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Dxc22nKz; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1684996639; 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=/wRElTPvEH+qiDxzmhMMx9+dlL3skFcvB7gqDwFYRMo=; b=atExwlkROd2/hTSbq4ZC187A0Ne1NCBito9UOHu0K/3EjNIMgUeOQBW2RjOjZELekH28VD lDbzUXWjVs3eCl0+B2t4u/GVyESVR/Z6xTDgeWrAXVozTMMlQ7Ki5BN3RkJ4k6hPCz9VSV 3KU//4ZKh/CxE7KMagO/cq8sknqJeVTqfRyP+WWAGWOi9R9la0vNGE0kDdo8Ayo12CSQRU 3c3m85ZbNu/MKVLHbufZfKXGKR5u2CHJ01hCkYJlw9rxOnn8R4RDLyFTcH0crb5lDHoM4N 16H1X/vZTXQOhMk9Bp6P7RKO0w4CrF0so1ztXUzsQwOSEL2H5laEhI8KpRDy3Q== X-Migadu-Spam-Score: -9.92 X-Spam-Score: -9.92 X-Migadu-Queue-Id: 701B1A4FF X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Dxc22nKz; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-TUID: vM6KlP3nTLrJ "Christopher M. Miles" writes: > I'm the developer of Org mode package "org-link-beautify" > https://repo.or.cz/org-link-beautify.git . The package main theory > is to use org-link-parameters `:activate-func` to do link file preview > with generating thumbnail images or file content etc. > > But I found it's slow one some big Org file and slow on small Org file > when previewing has a lot. > ... > I can see the `org-mode` invoked `org-set-font-lock-defaults` soon when > `org-mode` enabled. I hope the link `:activate-func` function can be > called only on link elements which is VISIBLE (means unfolded subtrees > or similar). So org-mode don't need to render all buffer links at > beginning soon. Instead render them as needed as unfolded. (Maybe I read > source code without fully understand the code. If so, correct me, > thanks.) Emacs fontification, by default, only requests fontification of the text visible on screen. That's what LIMIT argument to `font-lock-keywords' MATCHER function is for. Org mode obeys LIMIT. If you are seeing fontification being requested for invisible part of buffer or parts of buffer outside screen, it is likely caused by some third-party package forcing the fontification. As usual, try emacs -Q + minimal set of loaded packages and see if you can reproduce the problem. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at