Change how to handle unevaluable source blocks

This commit is contained in:
Gerard Vermeulen 2024-03-17 17:20:32 +01:00
parent 34eb7ad8cb
commit baeae8f991

View File

@ -2149,8 +2149,7 @@ configuration objectives:
:CUSTOM_ID: sec:writing-org-files
:END:
The [[https://org-babel.readthedocs.io/en/latest/][Org Babel reference card]] complements section [[info:org#Working with Source Code][Working with Source Code (info)]]
of the [[info:org#Top][Org (info)]] manual. Here are links to Org-mode videos:
Here are links to Org-mode videos:
1. [[yt:o6rE18Mxu9U][Analyze Your Time with Org Mode Clocktables]]
2. [[yt:EgOBBiomfGo][Basic Task Management with Org: Checklists, TODOs, and Org-Agenda]]
3. [[yt:oJTwQvgfgMM][Emacs Org-mode: a system for note-taking and project planning]]
@ -2167,7 +2166,6 @@ of the [[info:org#Top][Org (info)]] manual. Here are links to Org-mode videos:
#+name: lst:bind-org-commands
#+begin_src emacs-lisp -n :results silent
(with-eval-after-load 'emacs
;; (global-set-key (kbd "C-c C-l") #'org-insert-link-global)
(global-set-key (kbd "C-c a") #'org-agenda)
(global-set-key (kbd "C-c c") #'org-capture)
(global-set-key (kbd "C-c l") #'org-store-link))
@ -2185,9 +2183,9 @@ list detailing and motivating each listing:
more information.
3. Listing [[lst:setup-org-babel]] sets ~ob-core~, ~ob-latex~, and ~ob-lisp~ options.
See [[info:org#Working with Source Code][working with source code (info)]] for Org Babel information.
4. Listing [[lst:fake-org-babel-functions]] adds =org-babel-execute:<LANGUAGE>=
functions to silence src_emacs-lisp[:results silent]{(find-library
"org-lint")}.
4. Listing [[lst:no-org-babel-eval]] prevents evaluation of blocks without an
=org-babel-execute:<LANG>= function and adds fake =org-babel-execute:<LANG>=
functions to silence {{{kbd(M-x org-lint)}}} warnings.
5. Listing [[lst:set-org-link-options]] handles [[https://orgmode.org/][Org-mode]] options specific to
[[info:org#Hyperlinks][hyperlinks (info)]].
6. Listing [[lst:looking-at-org-id]] enables recent ~org-id~ features.
@ -2304,22 +2302,24 @@ Watch out for completion `visit-tags-table' prompts."
(setopt org-babel-lisp-eval-fn #'sly-eval)))
#+end_src
#+caption[Fake =org-babel= functions]:
#+caption: Fake =org-babel= functions.
#+name: lst:fake-org-babel-functions
#+caption[Unevaluable source blocks]:
#+caption: Unevaluable source blocks.
#+name: lst:no-org-babel-eval
#+begin_src emacs-lisp -n :results silent
;; Modes are not executable:
(setq org-babel-default-header-args:conf '((:eval . "no")))
(setq org-babel-default-header-args:diff '((:eval . "no")))
(setq org-babel-default-header-args:text '((:eval . "no")))
(setq org-babel-default-header-args:toml '((:eval . "no")))
;;; Kludges to silence `org-lint' warnings:
(defun org-babel-execute:conf (_body _params)
"NO-OP to silence warnings." nil)
"Silence `org-lint' warnings." nil)
(defun org-babel-execute:diff (_body _params)
"NO-OP to silence warnings." nil)
"Silence `org-lint' warnings." nil)
(defun org-babel-execute:text (_body _params)
"NO-OP to silence warnings." nil)
"Silence `org-lint' warnings." nil)
(defun org-babel-execute:toml (_body _params)
"NO-OP to silence warnings." nil)
"Silence `org-lint' warnings." nil)
#+end_src
#+caption[Set =org-link= options]: