From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastien Vauban Subject: Re: Redshank gets loaded when exporting ELisp code blocks to HTML!? Date: Fri, 02 May 2014 15:10:30 +0200 Message-ID: <86fvksfhrt.fsf@somewhere.org> References: <86fvlpryql.fsf@somewhere.org> <86bnwdrws3.fsf@sachachua.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hello Sacha and Nicolas, Answering after a (too) long time with very intermittent Internet access... Sacha Chua wrote: > Sebastien Vauban writes: > >> Why are Emacs Lisp minor modes loaded for exporting the Org document >> to HTML? If not necessary, this seems suboptimal (performance-wise). > > org-export-format-source-code-or-example loads the mode associated > with the language in org-src-lang-modes in order to fontify the > block. Only to fontify, not to indent, right? > You could check if org-export-current-backend is nil before > loading anything that you want to use only interactively. > > Maybe like so? > > (add-hook 'emacs-lisp-mode-hook (lambda () > (unless org-export-current-backend > (turn-on-redshank-mode)))) This seems to be a solution (although I did not test it), but it seems as well impractical: I'd have to chase almost all minor modes of all languages... Can't we assume that the major modes have all the information to fontify the code blocks, and -- if yes -- have a manner to forbid loading all the minor modes at once (as, then, they'd be completely useless for the export process)? Best regards, Seb -- Sebastien Vauban