emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jeremie Juste <jeremiejuste@gmail.com>
To: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: processing of babel blocks and select_tags
Date: Sat, 19 Feb 2022 08:54:42 +0100	[thread overview]
Message-ID: <87iltbffzx.fsf@gmail.com> (raw)
In-Reply-To: <87wnhss7z4.fsf@ucl.ac.uk> (Eric S. Fraga's message of "Fri, 18 Feb 2022 11:57:19 +0000")

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




  parent reply	other threads:[~2022-02-19  7:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-18 11:57 processing of babel blocks and select_tags Eric S Fraga
2022-02-18 15:33 ` John Kitchin
2022-02-18 15:45   ` Eric S Fraga
2022-02-19  7:54 ` Jeremie Juste [this message]
2022-02-19 16:47   ` Eric S Fraga
2022-10-23  5:35     ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87iltbffzx.fsf@gmail.com \
    --to=jeremiejuste@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).