From c374ac9156c6257b2c03963775e836c8f6f75334 Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Wed, 26 Apr 2023 12:09:45 +0200 Subject: [PATCH] Make an "Org introspection" section that disables tangling --- README.org | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/README.org b/README.org index 5f26fac..571548b 100644 --- a/README.org +++ b/README.org @@ -2413,14 +2413,14 @@ else: | -2 | [NO-PACKAGES] | | -3 | [NO-EXTRA] | -*** Debug setting =org-babel-load-languages= options +*** Org introspection :PROPERTIES: -:CUSTOM_ID: sec:setopt-org-babel-load-languages +:CUSTOM_ID: sec:org-introspection :header-args:emacs-lisp: :exports code :tangle no :END: -#+caption[Find valid entries for =org-babel-load-languages=]: -#+caption: Find valid entries for =org-babel-load-languages=. +#+caption[Find valid entries for =org-babel-load-languages=]: +#+caption: Find valid entries for =org-babel-load-languages=. #+name: lst:valid-org-babel-load-languages-entries #+header: :wrap "src emacs-lisp :results silent :tangle no" #+begin_src emacs-lisp :exports both :results value pp @@ -2499,6 +2499,55 @@ Return a list of items where the filename is the `car' of each item and the ("ob-sqlite" "sqlite")) #+end_src +#+caption[Find active Org Babel languages]: +#+caption: Find active Org Babel languages. +#+name: lst:org-babel-active-languages +#+header: :wrap "src emacs-lisp :results silent :tangle no" +#+begin_src emacs-lisp :exports both :results value pp +(defun org-babel-active-languages () + (let ((result '("conf" "latex-extra-header" "latex-header" "text" "toml"))) + (mapatoms + (lambda (x) + (when (and + (string-prefix-p "org-babel-execute:" (symbol-name x)) + (not (eq 'org-babel-shell-initialize (get x 'definition-name)))) + (when (symbol-file x) + (push (string-remove-prefix "org-babel-execute:" (symbol-name x)) + result))))) + result)) + +(mapcar #'list (org-babel-active-languages)) +#+end_src + +#+caption[Active Org Babel languages]: +#+caption: Active Org Babel languages. +#+RESULTS: lst:org-babel-active-languages +#+begin_src emacs-lisp :results silent :tangle no +(("calc") + ("perl") + ("lisp") + ("eshell") + ("maxima") + ("fortran") + ("D") + ("C") + ("C++") + ("latex-header") + ("org") + ("cpp") + ("js") + ("shell") + ("elisp") + ("latex-extra-header") + ("latex") + ("emacs-lisp") + ("conf") + ("latex-extra-header") + ("latex-header") + ("text") + ("toml")) +#+end_src + *** [[https://github.com/bdarcus/citar][Citar: citing bibliography]] with [[https://orgmode.org/][Org Mode]] :PROPERTIES: :CUSTOM_ID: sec:citing-bibliography