From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: running some elisp code when exporting a given file Date: Fri, 06 Sep 2013 11:41:36 -0600 Message-ID: <87eh91q23z.fsf@gmail.com> References: <8761ufr2z2.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VI02o-0004BM-NF for emacs-orgmode@gnu.org; Fri, 06 Sep 2013 13:42:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VI025-0008Qn-78 for emacs-orgmode@gnu.org; Fri, 06 Sep 2013 13:42:06 -0400 Received: from mail-pa0-x22a.google.com ([2607:f8b0:400e:c03::22a]:49678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VI024-0008QX-W6 for emacs-orgmode@gnu.org; Fri, 06 Sep 2013 13:41:21 -0400 Received: by mail-pa0-f42.google.com with SMTP id lj1so3636466pab.29 for ; Fri, 06 Sep 2013 10:41:19 -0700 (PDT) In-Reply-To: (Alan Schmitt's message of "Thu, 05 Sep 2013 14:39:15 +0200") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Alan Schmitt Cc: emacs-orgmode , Nicolas Goaziou Alan Schmitt writes: > n.goaziou@gmail.com writes: > >> Hello, >> >> Alan Schmitt writes: >> >>> I would like to inline a css when exporting a file to html, but I don't >>> know how to tell org-mode to set the variable org-html-head from within >>> the file. >>> >>> Here is what I tried: I added the following block at the beginning of my >>> file: >>> >>> #+BEGIN_SRC emacs-lisp :exports none >>> (set (make-local-variable 'org-html-head) (concat >>> "\n")) >>> #+END_SRC >>> >>> It does not seem to be evaluated, however. >>> >>> Is there a way to have arbitrary code stored in the file being exported >>> being evaluated before an export? >> >> I think this has to do with ":exports none", which means that code will >> not be evaluated during export. You may want to try setting the >> attribute to some other value, and put the block in a :noexport: entry. > > Thanks a lot, this was it. > Just for completeness, another option may be the following set of header arguments. #+begin_src emacs-lisp :exports results :results none ;; code executed for side effects #+end_src Cheers, -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D