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: Fri, 19 Oct 2018 00:17:59 +0200 Message-ID: <87zhva6grs.fsf@nicolasgoaziou.fr> References: <87r2gt55pq.fsf@gmail.com> <87d0sbexkq.fsf@nicolasgoaziou.fr> <871s8nua1k.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDGcM-0003UR-Ux for emacs-orgmode@gnu.org; Thu, 18 Oct 2018 18:18:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDGcI-0001hy-D8 for emacs-orgmode@gnu.org; Thu, 18 Oct 2018 18:18:10 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:59713) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDGcE-0001ap-Ug for emacs-orgmode@gnu.org; Thu, 18 Oct 2018 18:18:04 -0400 In-Reply-To: <871s8nua1k.fsf@gmail.com> (stardiviner's message of "Thu, 18 Oct 2018 12:57:11 +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: > Here is my try: > > #+begin_src diff > modified lisp/org-src.el > @@ -585,7 +585,14 @@ as `org-src-fontify-natively' is non-nil." > (erase-buffer) > ;; Add string and a final space to ensure property change. > (insert string " ")) > - (unless (eq major-mode lang-mode) (funcall lang-mode)) > + (unless (eq major-mode lang-mode) > + (message "%s enabled in source block" lang-mode) > + ;; (make-local-variable (intern (format "%s-hook" lang-mode))) > + ;; (set (intern (format "%s-hook" lang-mode)) nil) > + (message "%s is %s" > + (intern (format "%s-hook" lang-mode)) > + (symbol-value (intern (format "%s-hook" lang-mode)))) > + (funcall lang-mode)) > (org-font-lock-ensure) > (let ((pos (point-min)) next) > (while (setq next (next-property-change pos)) > #+end_src > > But it seems does not work as I expected. Did you try to set the hook to a different value before (funcall lang-mode)? Regards, -- Nicolas Goaziou