emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: processing of babel blocks and select_tags


From: Jeremie Juste
Subject: Re: processing of babel blocks and select_tags
Date: Sat, 19 Feb 2022 08:54:42 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hello Eric,

On Friday, 18 Feb 2022 at 11:57, Eric S Fraga wrote:
> TL;DR: can I have org completely ignore src blocks in non-selected
> sections during export without using COMMENT?

If I change eval: no_export to :eval no, Only the =Description= section
is evaluated and exported. That said, I have often search in vain of a way of
using tags to prevent evaualtion of code chuck. I have resorted to use
either property at the heading or file level to control the execution
of code chunks.

     ** Subheading
       :PROPERTIES:
       :header-args:julia:    :eval no
       :END:



Another option would be to store what is needed in as a variable in a
session and use =:eval no= before exporting, but it might not be very
practical for a book.

I have a small helper function that toggle eval yes or no at the file
level, if it is of any help.

HTH,

Jeremie

* toggle eval yes.

(defun toggle-global-eval ()
  "toggle :eval yes :evalno  "
  (interactive)
  (save-excursion
  (beginning-of-buffer)
  (search-forward-regexp ":eval ")
  (kill-word 1)
  (setq wd (car kill-ring))
  (if (equal "yes" wd)      
             (insert "no")    
          (insert  "yes"))
  (org-ctrl-c-ctrl-c))
  (save-buffer)
  (message "global :eval was %s" wd)
  )




* file tag.org
#+title: org babel and select tags
#+select_tags: current

* Introduction
This section has some code that should not be evaluated on export.

#+name: introblock
#+begin_src julia :eval no
  a = [1, 2, 3]
#+end_src

* Description                                                  :current:
I am writing this section right now.

* Conclusions
This will be worked on later.
#+name: conclusionblock
#+begin_src julia :eval no
  a = [4, 5, 6]
#+end_src





reply via email to

[Prev in Thread] Current Thread [Next in Thread]