From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: temporary set source blocks major-mode-hook to nil locally to speed up Org Mode Date: Mon, 15 Oct 2018 22:58:45 +0200 Message-ID: <87d0sbexkq.fsf@nicolasgoaziou.fr> References: <87r2gt55pq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gC9xE-0004HI-EC for emacs-orgmode@gnu.org; Mon, 15 Oct 2018 16:59:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gC9x9-0002Qg-JR for emacs-orgmode@gnu.org; Mon, 15 Oct 2018 16:59:08 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:39335) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gC9x4-0002HD-OI for emacs-orgmode@gnu.org; Mon, 15 Oct 2018 16:59:01 -0400 In-Reply-To: <87r2gt55pq.fsf@gmail.com> (stardiviner's message of "Sun, 14 Oct 2018 15:48:33 +0800") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: stardiviner Cc: org-mode Hello, stardiviner writes: > When I open a big Org file which contains many different languages > source blocks. And when the Org file buffer is fontified when option > `org-src-fontify-natively` is enabled. Org will try to load those > major modes. Including major-mode-hook like "clojure-mode-hook", > "emacs-lisp-mode-hook", "python-mode-hook" etc. But for fontify the > source blocks, I don't think it is necessary to load those > major-mode-hooks. Also they are slow. Like in my case, most of time is > used for loading source blocks major-mode-hooks. > > - clojure-mode-hook has CIDER etc > - python-mode-hook has elpy etc > - emacs-lisp-mode-hook has some utilities. > > Temporary disable those major-mode-hooks by set-local them to nil is a good solution to speed-up Org. > > WDYT? If I'm wrong, please give out some thought from you. Thanks. Some major modes may use major mode hooks to finish setting up their fontification process, who knows. In any case, it could be worth trying it. Do you want to provide a patch for that? Regards, -- Nicolas Goaziou