Try again to get rid off `org-ctags' and cleanup "Setup Org" section

This commit is contained in:
Gerard Vermeulen 2024-02-02 14:42:36 +01:00
parent 38b2556eab
commit d69071a556

View File

@ -2283,34 +2283,37 @@ of the [[info:org#Top][Org (info)]] manual.
I have split the initial [[https://orgmode.org/][Org-mode]] setup over several listings. Here, follows a
list detailing and motivating each listing:
1. Listing [[lst:set-org-options]] handles basic [[https://orgmode.org/][Org-mode]] options.
2. Listing [[lst:setup-org-babel]] handles basic [[https://orgmode.org/][Org-mode]] options to [[info:org#Working with Source Code][work with
source code (info)]] and adds =org-babel-execute:<LANGUAGE>= functions to
silence src_emacs-lisp[:results silent]{(find-library "org-lint")}.
3. Listing [[lst:org-babel-execute-named-block]] adds a function to execute a named
2. Listing [[lst:kill-org-ctags]] tries to disable ~org-ctags~ functionality without
side-effects.
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")}.
5. Listing [[lst:org-babel-execute-named-block]] adds a function to execute a named
source block interactively.
4. Listing [[lst:ob-tangle-plus]] extends [[info:org#Noweb Reference Syntax][source code export (info)]] with the
6. Listing [[lst:ob-tangle-plus]] extends [[info:org#Noweb Reference Syntax][source code export (info)]] with the
possibility to tangle of for instance Emacs Lisp files (or other programming
mode files) into a directory specified by ~org-babel-post-tangle-dir~ which
~toggle-post-tangle-hook-dir-usage~ may change.
5. Listing [[lst:set-org-link-options]] handles [[https://orgmode.org/][Org-mode]] options specific to
7. Listing [[lst:set-org-link-options]] handles [[https://orgmode.org/][Org-mode]] options specific to
[[info:org#Hyperlinks][hyperlinks (info)]].
6. Listing [[lst:setup-org-mode-map-1]] and [[lst:setup-org-mode-map-2]] extend the
8. Listing [[lst:setup-org-mode-map-1]] and [[lst:setup-org-mode-map-2]] extend the
=org-mode-map= with useful key-bindings.
7. Listing [[lst:setup-org-src]] facilitates [[info:org#Editing Source Code][editing source code blocks]], and it
9. Listing [[lst:setup-org-src]] facilitates [[info:org#Editing Source Code][editing source code blocks]], and it
provides functions to change the indentation of all =org-src-mode= blocks.
8. Listing [[lst:setup-ob-python]] allows to pretty-print Python session source
block values with [[https://github.com/psf/black#readme][black]] instead of [[https://docs.python.org/3/library/pprint.html][pprint]]. This snippet may break in the
future, because it sets =org-babel-python--def-format-value= which is a
constant declared "private" by two dashes in its name!
9. Listing [[lst:set-org-export-options]] selects the =non-intrusive= expert user
interface for export dispatching.
10. Listing [[lst:setup-org-for-lualatex-export]] and
10. Listing [[lst:setup-ob-python]] allows to pretty-print Python session source
block values with [[https://github.com/psf/black#readme][black]] instead of [[https://docs.python.org/3/library/pprint.html][pprint]]. This snippet may break in the
future, because it sets =org-babel-python--def-format-value= which is a
constant declared "private" by two dashes in its name!
11. Listing [[lst:set-org-export-options]] selects the =non-intrusive= expert user
interface for export dispatching.
12. Listing [[lst:setup-org-for-lualatex-export]] and
[[lst:set-ox-latex-options-for-lualatex-export]] configure [[https://orgmode.org/][Org-mode]] to generate
output for the LuaLaTeX compiler.
11. Listing [[lst:setup-org-latex-classes]] defines [[info:org#LaTeXspecificexportsettings][org-latex-classes (info)]] for
backward compatibility. See table [[tab:org-latex-class-tag-placeholder]] and
type {{{kbd(C-h v org-latex-classes)}}} for an explanation of the code in
listing [[lst:setup-org-latex-classes]].
13. Listing [[lst:setup-org-latex-classes]] defines [[info:org#LaTeXspecificexportsettings][org-latex-classes (info)]] for
backward compatibility. Type {{{kbd(C-h v org-latex-classes)}}} for an
explanation of the code in listing [[lst:setup-org-latex-classes]].
#+caption[Set basic =Org= options]:
#+caption: Set basic =Org= options.
@ -2360,13 +2363,39 @@ list detailing and motivating each listing:
org-use-property-inheritance t))
#+end_src
#+caption[Setup =org-babel=]:
#+caption: Setup =org-babel=.
#+caption[Kill =org-ctags=]:
#+caption: Kill =org-ctags=.
#+name: lst:kill-org-ctags
#+begin_src emacs-lisp -n :results silent
(with-eval-after-load 'org-ctags
;; This is not enough, since `org-execute-file-search-in-bibtex'
;; may be a member of `org-execute-file-search-function'.
;; Does this trigger `org-ctags'? Why? How to fix this?
(setq org-execute-file-search-functions nil))
#+end_src
#+caption[Set =org-babel= options]:
#+caption: Set =org-babel= options.
#+name: lst:setup-org-babel
#+begin_src emacs-lisp -n :results silent
(with-eval-after-load 'ob-core
(setopt org-confirm-babel-evaluate nil)
(with-eval-after-load 'ob-latex
(setopt org-babel-latex-preamble
(lambda (_)
"\\documentclass[preview]{standalone}\n")))
(with-eval-after-load 'ob-lisp
;; Default to `sly-eval' whenever feasible:
(when (package-installed-p 'sly)
(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
#+begin_src emacs-lisp -n :results silent
;; Modes are not executable:
(defun org-babel-execute:conf (_body _params)
"NO-OP to silence warnings." nil)
@ -2390,20 +2419,6 @@ list detailing and motivating each listing:
(defun org-babel-execute:scheme (_body _params)
"NO-OP to silence warnings." nil))
(with-eval-after-load 'ob-latex
(setopt
org-babel-latex-preamble (lambda (_)
"\\documentclass[preview]{standalone}\n")
org-babel-latex-begin-env (lambda (_)
"\\begin{document}\n")
org-babel-latex-end-env (lambda (_)
"\\end{document}\n")))
(with-eval-after-load 'ob-lisp
;; Default to `sly-eval' whenever feasible:
(when (package-installed-p 'sly)
(setopt org-babel-lisp-eval-fn #'sly-eval)))
#+end_src
#+caption[Add function to execute a named source block interactively]:
@ -2747,7 +2762,7 @@ def __org_babel_python_format_value(result, result_file, result_params):
#+caption: Set =ox-latex= options for export to LuaLaTeX.
#+name: lst:set-ox-latex-options-for-lualatex-export
#+begin_src emacs-lisp -n :results silent
(with-eval-after-load 'ox-latex
(when (require 'ox-latex nil 'noerror) ;; To use the safe file local variables!
(setopt
org-latex-compiler "lualatex"
org-latex-compiler-file-string
@ -2836,19 +2851,6 @@ def __org_babel_python_format_value(result, result_file, result_params):
("\\subsubsection{%s}" . "\\subsubsection*{%s}")))))))
#+end_src
#+attr_latex: :booktabs yes :float table
#+caption[The relation tag-placeholder in listing [[lst:setup-org-latex-classes]]]:
#+caption: The relation tag-placeholder in listing [[lst:setup-org-latex-classes]].
#+name: tab:org-latex-class-tag-placeholder
| tag | placeholder |
|-----+-----------------------|
| +1 | [DEFAULT-PACKAGES] |
| +2 | [PACKAGES] |
| +3 | [EXTRA] |
| -1 | [NO-DEFAULT-PACKAGES] |
| -2 | [NO-PACKAGES] |
| -3 | [NO-EXTRA] |
*** Org HTML style default
:PROPERTIES:
:CUSTOM_ID: sec:org-html-style-default