From mboxrd@z Thu Jan 1 00:00:00 1970 From: Torsten Wagner Subject: [babel] eval code only once :eval once Date: Tue, 10 Apr 2012 19:08:22 +0900 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHXzz-00059r-Sr for emacs-orgmode@gnu.org; Tue, 10 Apr 2012 06:08:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SHXzt-00036e-MY for emacs-orgmode@gnu.org; Tue, 10 Apr 2012 06:08:31 -0400 Received: from mail-vx0-f169.google.com ([209.85.220.169]:53631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHXzt-00036F-Fy for emacs-orgmode@gnu.org; Tue, 10 Apr 2012 06:08:25 -0400 Received: by vcbfk14 with SMTP id fk14so2992707vcb.0 for ; Tue, 10 Apr 2012 03:08:22 -0700 (PDT) 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: Org Mode Mailing List Hi, I started to use lisp (as well as other) code blocks more and more to modify my work environment (emacs) for a particular (buffer-based) task. That is I change some variables, add some stuff etc. A real world example is for example the section below * Set-up :nonexport: #+source: setup-minted #+begin_src emacs-lisp :exports none :results silent (setq org-export-latex-listings 'minted) (setq org-export-latex-custom-lang-environments '( (emacs-lisp "common-lispcode") )) (setq org-export-latex-minted-options '(("frame" "lines") ("fontsize" "\\scriptsize") ("linenos" ""))) (setq org-latex-to-pdf-process '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")) #+end_src This are settings from worg, which I use only during my work on that particular file/buffer e.g. to modify the export of the following beamer presentation. Whenever I load the buffer I jump to set-up and hit C-c C-C to execute it once. After that exports will do what I want. If I would change the above to :exports results and :results silent I would be asked to execute the code block on every export. Thanks to the new auto completion feature, I came across :eval and wonder if it makes sense to add :eval once and :eval once-query Which would allow to execute it only once (with query) if not called before and otherwise keeps quite. That would make *Set-up blocks much more efficient. Was thinking why there is no 'no-query' resp. 'always' flag which would execute code blocks without query even if asked for it in general but that would be somehow against safety measures ;) Totti