Remove unexported sections and clean up

This commit is contained in:
Gerard Vermeulen 2024-02-11 13:47:39 +01:00
parent 747cc513ff
commit c408bdb50d

View File

@ -2390,10 +2390,7 @@ list detailing and motivating each listing:
(perl . t)
;; Beware of circular Python dependencies.
(python . t)
;; (racket . ,(fboundp 'racket-mode))
(ruby . ,(fboundp 'ruby-mode))
;; MIT/GNU Scheme breaks Babel contrary to Guile, Chez and Chicken Scheme.
(scheme . ,(fboundp 'geiser-mode))
(shell . t))
;; Removal of `svg4css' from `org-export-backends' to silence warnings.
org-export-backends '(ascii beamer html icalendar latex odt texinfo)
@ -2444,7 +2441,7 @@ list detailing and motivating each listing:
#+name: lst:setup-org-babel
#+begin_src emacs-lisp -n :results silent
(with-eval-after-load 'ob-core
(setopt org-confirm-babel-evaluate nil)
(setopt org-confirm-babel-evaluate nil))
(with-eval-after-load 'ob-latex
(setopt org-babel-latex-preamble
@ -2461,25 +2458,19 @@ list detailing and motivating each listing:
#+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)
;; Modes are not executable:
(defun org-babel-execute:conf (_body _params)
"NO-OP to silence warnings." nil)
(defun org-babel-execute:text (_body _params)
"NO-OP to silence warnings." t)
(defun org-babel-execute:text (_body _params)
"NO-OP to silence warnings." t)
(defun org-babel-execute:toml (_body _params)
"NO-OP to silence warnings." nil)
(defun org-babel-execute:toml (_body _params)
"NO-OP to silence warnings." nil)
;; Sections not exported:
(defun org-babel-execute:applescript (_body _params)
"NO-OP to silence warnings." nil)
(defun org-babel-execute:racket (_body _params)
"NO-OP to silence warnings." t)
(defun org-babel-execute:scheme (_body _params)
"NO-OP to silence warnings." nil))
;; Sections not exported:
(defun org-babel-execute:applescript (_body _params)
"NO-OP to silence warnings." nil)
#+end_src
#+caption[Change the =org-babel-tangle= destination to a specific directory]:
@ -3294,8 +3285,8 @@ Return a list of items where the filename is the `car' of each item and the
#+begin_src emacs-lisp -n :eval never :tangle no
(("applescript") ("calc") ("conf") ("emacs-lisp") ("eshell")
("fortran") ("js") ("latex") ("latex-extra-header") ("latex-header")
("lisp") ("maxima") ("org") ("perl") ("python") ("racket") ("ruby")
("scheme") ("shell") ("text") ("toml"))
("lisp") ("org") ("perl") ("python") ("ruby") ("shell") ("text")
("toml"))
#+end_src
*** [[https://github.com/bdarcus/citar][Citar: citing bibliography]] with [[https://orgmode.org/][Org Mode]]
@ -6636,126 +6627,6 @@ configures =code-cells=.
*** TODO Look into: editing facilities
1. [[https://github.com/douglasdavis/numpydoc.el/blob/main/numpydoc.el][Emacs extension to insert numpy style docstrings in function definitions]]
** [[https://racket-lang.org/][Racket Programming]] :noexport:
:PROPERTIES:
:CUSTOM_ID: sec:racket-programming
:header-args:emacs-lisp: :tangle no :eval never-export
:END:
Refer to the [[https://kchousos.github.io/posts/sicp-in-emacs/][SICP in Emacs]] post for an Emacs setup to study of [[https://web.mit.edu/6.001/6.037/sicp.pdf][Structure and
Interpretation of Computer Programs]] in Org. Listing [[lst:setup-sicp]] installs
the required Emacs packages but you have also to install the [[https://docs.racket-lang.org/sicp-manual/index.html][SICP Collections]] in
for instance the [[https://racket-lang.org/][Racket]] programming environment [[https://docs.racket-lang.org/drracket/][DrRacket]].
#+caption[Ensure =racket= installation to study SICP]:
#+caption: Ensure =racket= installation to study SICP.
#+name: lst:setup-sicp
#+begin_src emacs-lisp -n :results silent
(when (ensure-package-installation 'racket-mode 'sicp)
;; Calling `package-upgrade-all' upgrades `ob-racket' always.
(setopt package-vc-selected-packages
'((ob-racket :vc-backend 'Git
:url "https://github.com/hasu/emacs-ob-racket.git")))
(unless (package-installed-p 'ob-racket)
(package-vc-install (assoc 'ob-racket package-vc-selected-packages))))
#+end_src
#+caption[SICP Racket test]:
#+caption: SICP Racket test.
#+name: lst:sicp-test
#+header: :wrap "src text -n"
#+begin_src racket :eval never-export :exports both :lang sicp
(inc 42)
#+end_src
#+caption[SICP Racket test result]:
#+caption: SICP Racket test result.
#+name: lst:sicp-test-result
#+RESULTS: lst:sicp-test
#+begin_src text -n
43
#+end_src
** [[https://en.wikibooks.org/wiki/Scheme_Programming][Scheme Programming]] :noexport:
:PROPERTIES:
:CUSTOM_ID: sec:scheme-programming
:header-args:emacs-lisp: :tangle no :eval never-export
:END:
Listing [[lst:setup-geiser][Ensure Geiser installation]] supports the Scheme implementations
1. [[https://cisco.github.io/ChezScheme/][Chez Scheme]],
2. [[https://call-cc.org/][Chicken Scheme]], and
3. [[https://www.gnu.org/software/guile/][GNU Guile]] Scheme.
It configures Geiser with [[https://cisco.github.io/ChezScheme/][Chez Scheme]] as default implementation. Evaluate one
of the following expressions to switch between those three implementations:
1. src_emacs-lisp[:results silent]{(setopt scheme-default-implementation
'chicken)},
2. src_emacs-lisp[:results silent]{(setopt scheme-default-implementation
'guile)},
3. src_emacs-lisp[:results silent]{(setopt scheme-default-implementation
'chez)}.
This setup does not support [[https://www.gnu.org/software/mit-scheme/][MIT/GNU Scheme]] which does not work with =ob-scheme=
although it works with =geiser-mit=.
The [[https://wiki.call-cc.org/emacs#using-chicken-with-emacs][Using Chicken Scheme with Emacs]] post or [[lst:finish-chicken-install][Finish Chicken Scheme install]]
listing show how to make the [[https://wiki.call-cc.org/man/5/The%20User%27s%20Manual][Chicken Scheme Manual]] available locally in case you
install [[https://call-cc.org/][Chicken Scheme]] with [[https://brew.sh/][Homebrew]].
#+caption[Ensure =geiser= installation]:
#+caption: Ensure =geiser= installation.
#+name: lst:setup-geiser
#+begin_src emacs-lisp -n :results silent
(when (ensure-package-installation 'geiser-chez 'geiser-chicken 'geiser-guile)
(setopt geiser-chez-binary (executable-find "chez")
geiser-scheme-implementation 'chez))
#+end_src
#+caption[Finish Chicken Scheme install]:
#+caption: Finish Chicken Scheme install.
#+name: lst:finish-chicken-install
#+begin_src shell -n
# https://gitlab.com/emacs-geiser/chicken
# Install the necessary support eggs:
chicken-install -s apropos chicken-doc srfi-18 srfi-1
# Update the Chicken documentation database:
cd $(csi -R chicken.platform -p '(chicken-home)')
curl https://3e8.org/pub/chicken-doc/chicken-doc-repo-5.tgz | sudo tar zx
#+end_src
*** Org Babel Ackermann Scheme test
:PROPERTIES:
:CUSTOM_ID: sec:obas-test
:header-args: :eval never-export
:END:
Listing [[lst:obas-test][Org Babel Ackermann Scheme test]] allows to check whether the setup works.
#+caption[Org Babel Ackermann Scheme test]:
#+caption: Org Babel Ackermann Scheme test.
#+name: lst:obas-test
#+header: :wrap "src text -n"
#+begin_src scheme -n :eval never-export :exports both
;; https://rosettacode.org/wiki/Ackermann_function#Scheme
;; https://www.youtube.com/watch?v=i7sm9dzFtEI
(define (ack m n)
(cond
((= m 0) (add1 n))
((= n 0) (ack (sub1 m) 1))
(else (ack (sub1 m) (ack m (sub1 n))))))
;; None of the Scheme implementations handles m > 3 and n > 3:
(ack 3 3)
#+end_src
#+caption[Org Babel Ackermann Scheme test result]:
#+caption: Org Babel Ackermann Scheme test result.
#+name: lst:obas-test-result
#+RESULTS: lst:obas-test
#+begin_src text -n
61
#+end_src
* [[https://github.com/emacs-tw/awesome-emacs#library][Libraries]]
:PROPERTIES:
:CUSTOM_ID: sec:libraries
@ -6896,21 +6767,18 @@ contrary to for instance [[https://github.com/Fanael/rainbow-delimiters#readme][
("C-M-(" . sp-backward-barf-sexp)
("C-M-)" . sp-forward-barf-sexp)))
(dolist (hook '(conf-toml-mode-hook prog-mode-hook text-mode-hook))
(add-hook hook #'smartparens-mode))
(dolist (symbol '(conf-toml-mode-hook prog-mode-hook text-mode-hook))
(add-hook symbol #'smartparens-mode))
(dolist (hook '(emacs-lisp-mode-hook
geiser-repl-startup-hook
go-ts-mode-hook
ielm-mode-hook
lisp-data-mode-hook
lisp-mode-hook
python-mode-hook
racket-mode-hook
racket-repl-mode-hook
slime-repl-mode-hook
sly-mrepl-mode-hook))
(add-hook hook #'smartparens-strict-mode))
(dolist (symbol '(emacs-lisp-mode-hook
geiser-repl-startup-hook
go-ts-mode-hook
ielm-mode-hook
lisp-data-mode-hook
lisp-mode-hook
python-mode-hook
sly-mrepl-mode-hook))
(add-hook symbol #'smartparens-strict-mode))
(when (fboundp 'go-ts-mode)
;; Stolen from `smartparens-go':