Konubinix' opinionated web of thoughts

How to Use a Variable to Tangle a Source Code Block

Fleeting

how to use a variable to tangle a source code block

(defun konix/org-babel-generate-file-param/tangle-variable(orig src-name params)
  (let* (
         (tangle_cons (assq :tangle params))
         (tangle (intern (cdr tangle_cons)))
         )
    (when (and
           tangle
           (not (equal tangle 'no))
           (boundp tangle)
           )
      (setq params (cons (cons :tangle (eval tangle t)) params))
      )
    (funcall orig src-name params)
    )
  )

(advice-add #'org-babel-generate-file-param :around #'test)