diff --git a/README.org b/README.org index 6b0ae3e..a13ebff 100644 --- a/README.org +++ b/README.org @@ -173,7 +173,7 @@ Try to load [[https://github.com/emacscollective/no-littering][no-littering]] as #+caption[Tangle the early-init-file]: #+caption: Tangle the early-init-file. #+name: lst:tangle-early-init-file -#+begin_src emacs-lisp -n :tangle early-init.el +#+begin_src emacs-lisp -n :results silent :tangle early-init.el ;;; early-init.el --- user early-init file -*- lexical-binding: t -*- ;;; Commentary: ;;; Code: @@ -218,7 +218,7 @@ recommendation of [[info:emacs#Saving Customizations][saving customizations (inf #+caption[Set the first set of Emacs options]: #+caption: Set the first set of Emacs options. #+name: lst:1st-setopt-call -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent ;;; init.el --- user init file -*- lexical-binding: t -*- ;;; Commentary: ;;; Code: @@ -268,7 +268,7 @@ recommendation of [[info:emacs#Saving Customizations][saving customizations (inf #+caption[Set the second set of Emacs options: pin packages to archives]: #+caption: Set the second set of Emacs options: pin packages to archives. #+name: lst:2nd-setopt-call -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (eq system-type 'darwin) (setopt ns-alternate-modifier nil ns-command-modifier 'meta @@ -319,7 +319,7 @@ recommendation of [[info:emacs#Saving Customizations][saving customizations (inf #+caption[Set the third set of Emacs options: upgrade Org and transient]: #+caption: Set the third set of Emacs options: upgrade Org and transient. #+name: lst:3rd-setopt-call -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent ;; To use different Org git repositories (org or gro): (push (expand-file-name "~/VCS/org-mode/lisp") load-path) ;; Postpone (require 'org) after shadowing Org and sh-script faces below. @@ -357,7 +357,7 @@ recommendation of [[info:emacs#Saving Customizations][saving customizations (inf #+caption[Handle ~user-emacs-directory~ site-lisp directories as packages]: #+caption: Handle ~user-emacs-directory~ site-lisp directories as packages. #+name: lst:site-lisp-packages -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs ;; https://www.emacswiki.org/emacs/LoadPath ;; Make user-emacs-directory site-lisp directories look like packages. @@ -392,7 +392,7 @@ opening the next session. #+caption[Setup ~desktop~ to save Emacs sessions]: #+caption: Setup ~desktop~ to save Emacs sessions. #+name: lst:desktop-setup -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (desktop-save-mode t) (setopt desktop-buffers-not-to-save @@ -436,7 +436,7 @@ the contents of packages and allows to update packages to the latest version. #+caption[Install the selected packages]: #+caption: Install the selected packages. #+name: lst:install-selected-packages -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (unless noninteractive (unless (require 'no-littering nil 'noerror) (unless (bound-and-true-p package-archive-contents) @@ -479,7 +479,7 @@ languages. Listing [[lst:setup-go][Setup Go programming]] shows how to configur #+caption[Setup =treesit= grammar sources]: #+caption: Setup =treesit= grammar sources. #+name: lst:setup-treesit-sources -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (require 'treesit nil 'noerror) (setopt treesit-language-source-alist @@ -551,7 +551,7 @@ selects a fixed pitch face for =magit-mode= and =progmode= buffers. #+caption[Configure =face-attributes=]: #+caption: Configure =face-attributes=. #+name: lst:configure-face-attributes -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs ;; Set face attributes. (cond @@ -572,7 +572,7 @@ selects a fixed pitch face for =magit-mode= and =progmode= buffers. #+caption[Implement =set-default-face-height=]: #+caption: Implement =set-default-face-height=. #+name: lst:set-default-face-height -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs (defun set-default-face-height () "Set the default face height in all current and future frames. @@ -592,7 +592,7 @@ Scale all other faces with a height that is a real number." #+caption[Fix a `gtk' color and implement =invert-default-face=]: #+caption: Fix a `gtk' color and implement =invert-default-face=. #+name: lst:fix-gtk-color-for-invert-default-face -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs (defun fix-gtk-region-face-background-color () (when (featurep 'gtk) @@ -832,8 +832,9 @@ and [[lst:3rd-window-management]] implement a selection of his recommendations. Listing [[lst:setup-bookmark][bookmark setup]] preserves bookmark history in [[./var/bookmark-default.el][bookmark-default.el]]. Table [[tab:bookmark-commands-and-bindings]] lists all =bookmark= commands with working -key bindings. Not all key bindings in src_emacs-lisp{(describe-variable -'bookmark-map)} are operational for different reasons. +key bindings. Not all key bindings in src_emacs-lisp[:results +silent]{(describe-variable 'bookmark-map)} are operational for different +reasons. BUG: The virtual buffers of the ~consult-buffer~ command do not seem to work. Therefore, ~consult-buffer~ is no means to access the bookmark history (contrary @@ -842,7 +843,7 @@ to claims in [[info:consult#Top][consult (info)]]). #+caption[Let Emacs save bookmarks when it is killed]: #+caption: Let Emacs save bookmarks when it is killed. #+name: lst:setup-bookmark -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'bookmark (setopt bookmark-save-flag 1) (setf bookmark-exit-hook 'bookmark-unload-function)) @@ -906,7 +907,7 @@ Mark this line without new-line as region 2 #+caption[Setup register usage]: #+caption: Setup register usage. #+name: lst:setup-register -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'register ;; Register `?+' serves as register separator when using `append-to-register': (set-register ?+ "\n") @@ -976,7 +977,7 @@ extension. #+caption[Set =dired= options]: #+caption: Set =dired= options. #+name: lst:set-dired-options -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'dired (setopt dired-dwim-target t ;; | switch | action | @@ -1003,7 +1004,7 @@ alternative. #+caption[Extra =dired= key bindings]: #+caption: Extra =dired= key bindings. #+name: lst:extra-dired-key-bindings -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'dired (defun dired-eww-open-file () "In Dired, open the regular file named on this line with eww" @@ -1034,7 +1035,7 @@ minibuffer completion]]. #+caption[Set =minibuffer= options]: #+caption: Set =minibuffer= options. #+name: lst:set-minibuffer-options -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (require 'minibuffer nil 'noerror) ;; https://www.masteringemacs.org/article/understanding-minibuffer-completion (setopt @@ -1055,7 +1056,7 @@ output to =stdout=. #+caption[Process utilities]: #+caption: Process utilities. #+name: lst:process-utilities -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent ;; https://gitlab.com/howardabrams/spacemacs.d/blob/master/layers/ha-org/funcs.el#L418 (defun shell-command-with-exit-code (program &rest args) "Run PROGRAM with ARGS and return exit-code and output in a list." @@ -1112,7 +1113,7 @@ defined in this Org file. #+caption[Configure =shortdoc=]: #+caption: Configure =shortdoc=. #+name: lst:configure-shortdoc -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (fboundp 'shortdoc-display-group) (keymap-set help-map "y" #'shortdoc-display-group) (with-eval-after-load 'shortdoc @@ -1162,7 +1163,7 @@ looks for files. #+caption[Configure =info=]: #+caption: Configure =info=. #+name: lst:configure-info -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'info ;; Make Emacs find ALL "*.info" files in `package-user-dir' on Gentoo Linux. (when (eq system-type 'gnu/linux) @@ -1212,7 +1213,7 @@ users from shooting themselves in the feet. Listing #+caption[Configure the =disabled-command-function=]: #+caption: Configure the =disabled-command-function=. #+name: lst:configure-disabled-command-function -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs (setq disabled-command-function (defun enable-this-command (&rest _args) @@ -1233,7 +1234,7 @@ Enable it and re-execute it." #+caption[Configure =interaction-log=]: #+caption: Configure =interaction-log=. #+name: lst:configure-interaction-log -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (and (ensure-package-installation 'interaction-log) (require 'interaction-log nil 'noerror)) @@ -1259,7 +1260,7 @@ Listing [[lst:configure-keycast]] configures =keycast=. #+caption[Configure =keycast=]: #+caption: Configure =keycast=. #+name: lst:configure-keycast -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent ;; Make `keycast-log-update-buffer' use a buffer similar to the ;; control buffer `ediff-setup-windows-plain' returns. (when (ensure-package-installation 'keycast) @@ -1311,7 +1312,7 @@ The code in listing [[lst:start-emacs-server]] starts the Emacs server. #+caption[Start the Emacs server]: #+caption: Start the Emacs server. #+name: lst:start-emacs-server -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when window-system (unless (or noninteractive (daemonp)) (add-hook 'after-init-hook #'server-start))) @@ -1409,7 +1410,7 @@ execvp("emacsclient", ("-n", payload)) #+caption[Ensure =applescript-mode= installation]: #+caption: Ensure =applescript-mode= installation. #+name: lst:ensure-applescript-mode-installation -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'applescript-mode)) #+end_src @@ -1511,7 +1512,7 @@ histories. #+caption[Enable =savehist-mode= and =vertico-mode=]: #+caption: Enable =savehist-mode= and =vertico-mode=. #+name: lst:enable-vertico-mode -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (require 'savehist nil 'noerror) (setopt savehist-additional-variables '(kill-ring search-ring)) (savehist-mode +1)) @@ -1563,7 +1564,7 @@ histories. #+caption[Configure =orderless=]: #+caption: Configure =orderless=. #+name: lst:configure-orderless -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'marginalia) (with-eval-after-load 'orderless (setopt orderless-component-separator " +") @@ -1590,15 +1591,14 @@ Listing [[lst:bind-embark-commands][bind =embark= commands]] binds =embark= comm 2. [[info:embark#The default action on a target][The default (embark-dwim) action on a target (info)]]. 3. =embark-bindings= allows to explore all current command key bindings in the minibuffer. -4. The initialization src_emacs-lisp{(setq prefix-help-command - #'embark-prefix-help-command)} enables minibuffer help after a prefix key - (for instance {{{kbd(C-x)}}} or {{{kbd(C-c)}}}) as typing {{{kbd(C-x C-h)}}} - or {{{kbd(C-c C-h)}}} shows. +4. The initialization of =prefix-help-command= enables minibuffer help after a + prefix key (for instance {{{kbd(C-x)}}} or {{{kbd(C-c)}}}) as typing + {{{kbd(C-x C-h)}}} or {{{kbd(C-c C-h)}}} shows. #+caption[Bind =embark= commands globally]: #+caption: Bind =embark= commands globally. #+name: lst:bind-embark-commands -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'embark 'embark-consult) (when (fboundp 'embark-act) (keymap-global-set "C-," #'embark-act)) @@ -1620,7 +1620,7 @@ Listing [[lst:enable-marginalia-mode]] enables =marginalia-mode=. #+caption[Enable =marginalia-mode=]: #+caption: Enable =marginalia-mode=. #+name: lst:enable-marginalia-mode -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (and (ensure-package-installation 'marginalia) (fboundp 'marginalia-mode)) (marginalia-mode +1)) @@ -1684,7 +1684,7 @@ completion function [[info:elisp#Minibuffer Completion][completing-read]]. List #+caption[Bind =consult= commands]: #+caption: Bind =consult= commands. #+name: lst:bind-consult-commands -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'consult) ;; C-c bindings (current-global-map) (keymap-global-set "C-c h" #'consult-history) @@ -1726,7 +1726,7 @@ configures =company= after ensuring the =company= installation. #+caption[Setup =company=]: #+caption: Setup =company=. #+name: lst:setup-company -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'company) ;; https://github.com/purcell/emacs.d/issues/778 (setopt company-transformers '(company-sort-by-occurrence)) @@ -1790,7 +1790,7 @@ the current [[https://en.wikipedia.org/wiki/Version_control][VCS]] directory tre #+caption[Bind =deadgrep= commands]: #+caption: Bind =deadgrep= commands. #+name: lst:bind-deadgrep-commands -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (and (ensure-package-installation 'deadgrep) (fboundp 'deadgrep)) (keymap-set search-map "d" #'deadgrep) @@ -1841,7 +1841,7 @@ implementation of the suggestions on those pages. *To do*: #+caption[Set =grep= and =xref= options to use =ugrep= when available]: #+caption: Set =grep= and =xref= options to use =ugrep= when available. #+name: lst:set-grep+xref-options -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (executable-find "ugrep") (with-eval-after-load 'grep (setopt grep-template (string-join '("ugrep" @@ -1879,7 +1879,7 @@ regexp strings. #+caption[Ensure =xr= installation]: #+caption: Ensure =xr= installation. #+name: lst:ensure-xr-installation -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'xr)) #+end_src @@ -1902,7 +1902,7 @@ single frame and to make all text visible prior to ediffing Org buffers. #+caption[Setup =ediff=]: #+caption: Setup =ediff=. #+name: lst:setup-ediff -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs (setopt ediff-merge-split-window-function #'split-window-horizontally ediff-split-window-function #'split-window-horizontally @@ -2000,7 +2000,7 @@ snippet [[lst:ensure-magit-installation][below]] ensures its installation. Magi #+caption[Ensure =Magit= installation]: #+caption: Ensure =Magit= installation #+name: lst:ensure-magit-installation -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (ensure-package-installation 'magit) #+end_src @@ -2030,7 +2030,7 @@ Listing [[lst:configure-nov]] configures [[https://depp.brause.cc/nov.el/][nov.e #+caption[Configure =nov=]: #+caption: Configure =nov=. #+name: lst:configure-nov -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (and (ensure-package-installation 'nov) (fboundp 'nov-mode)) (add-to-list 'auto-mode-alist `(,(rx ".epub" eos) . nov-mode))) @@ -2051,7 +2051,7 @@ of [[https://github.com/vedang/pdf-tools][pdf-tools]] from [[https://melpa.org/] #+caption[Setup =pdf-tools=]: #+caption: Setup =pdf-tools=. #+name: lst:setup-pdf-tools -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (and (ensure-package-installation 'pdf-tools) (fboundp 'pdf-loader-install)) ;; `pdf-loader-install' is the lazy equivalent of `pdf-tools-install': @@ -2101,7 +2101,7 @@ configuration objectives: #+caption[Ensure =AUCTeX= installation and set =TeX= option]: #+caption: Ensure =AUCTeX= installation and set =TeX= option. #+name: lst:set-tex-options -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'auctex) ;; Use `require' to make `TeX-master' a safe local variable. (when (require 'tex nil 'noerror) @@ -2119,7 +2119,7 @@ configuration objectives: #+caption[Update the =LuaLaTeX OpenType Font= name database]: #+caption: Update the =LuaLaTeX= =OpenType Font= name database. #+name: lst:update-lualatex-opentype-font-name-database -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs (defun update-lualatex-opentype-font-name-database () "Update the \"OpenType Font\" name database for \"LuaLaTeX\"." @@ -2135,7 +2135,7 @@ configuration objectives: #+caption[Set =bibtex= options]: #+caption: Set =bibtex= options. #+name: lst:set-bibtex-options -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'bibtex (setopt bibtex-dialect 'BibTeX)) #+end_src @@ -2143,7 +2143,7 @@ configuration objectives: #+caption[Set =font-latex= options]: #+caption: Set =font-latex= options. #+name: lst:set-font-latex-options -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'font-latex (setopt font-latex-fontify-sectioning 1.0)) #+end_src @@ -2151,7 +2151,7 @@ configuration objectives: #+caption[Set =latex= options]: #+caption: Set =latex= options. #+name: lst:set-latex-options -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'latex (setopt LaTeX-electric-left-right-brace t LaTeX-section-hook '(LaTeX-section-heading @@ -2173,7 +2173,7 @@ buffers with help of an external [[https://nodejs.org][node.js]] program. #+caption[Setup =math-preview=]: #+caption: Setup =math-preview=. #+name: lst:setup-math-preview -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'math-preview) (with-eval-after-load 'math-preview ;; https://docs.mathjax.org/en/latest/input/tex/extensions/physics.html @@ -2238,7 +2238,7 @@ zeromatrix zmat"))) #+caption[Configure =markdown-mode=]: #+caption: Configure =markdown-mode=. #+name: lst:configure-markdown-mode -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'markdown-mode)) #+end_src @@ -2258,7 +2258,7 @@ of the [[info:org#Top][Org (info)]] manual. #+caption[Bind =Org= commands globally]: #+caption: Bind =Org= commands globally. #+name: lst:bind-org-commands -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs (global-set-key (kbd "C-c a") #'org-agenda) (global-set-key (kbd "C-c c") #'org-capture) @@ -2308,7 +2308,7 @@ list detailing and motivating each listing: #+caption[Set basic =Org= options]: #+caption: Set basic =Org= options. #+name: lst:set-org-options -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'org (setopt org-babel-load-languages @@ -2356,7 +2356,7 @@ list detailing and motivating each listing: #+caption[Setup =org-babel=]: #+caption: Setup =org-babel=. #+name: lst:setup-org-babel -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'ob-core (setopt org-confirm-babel-evaluate nil) @@ -2446,7 +2446,7 @@ When prefix ARG is non-nil, prompt first for a language." #+caption[Change the =org-babel-tangle= destination to a specific directory]: #+caption: Change the =org-babel-tangle= destination to a specific directory. #+name: lst:ob-tangle-plus -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs ;; Modified from https://emacs.stackexchange.com/a/61364 which replies to ;; https://emacs.stackexchange.com/questions/61359/ @@ -2488,7 +2488,7 @@ May be changed by `toggle-post-tangle-hook-dir-usage'." #+caption[Set =org-link= options]: #+caption: Set =org-link= options. #+name: lst:set-org-link-options -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'ol ;; Setting `org-link-descriptive' to `t' has caused worse `isearch' ;; behavior. Set `org-link-descriptive' interactively by calling @@ -2500,7 +2500,7 @@ May be changed by `toggle-post-tangle-hook-dir-usage'." #+caption[Setup =org-mode-map= 1]: #+caption: Setup =org-mode-map= 1. #+name: lst:setup-org-mode-map-1 -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs ;; From: "Nicolas Richard" ;; Date: Fri, 08 Mar 2013 16:23:02 +0100 [thread overview] @@ -2592,7 +2592,7 @@ region becomes the block BODY. Otherwise, insert an empty block." #+caption[Setup =org-src=]: #+caption: Setup =org-src=. #+name: lst:setup-org-src -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs (with-eval-after-load 'org-src ;; https://list.orgmode.org/c3cc4ff1fcfb3bc741df89a3f45be30e@posteo.net/ @@ -2646,7 +2646,7 @@ With prefix argument ARG, prompt for the number of spaces." #+caption[Setup =ob-python=]: #+caption: Setup =ob-python=. This snippet may break in the future! #+name: lst:setup-ob-python -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'ob-python (setq org-babel-python--def-format-value "\ def __org_babel_python_format_value(result, result_file, result_params): @@ -2696,7 +2696,7 @@ def __org_babel_python_format_value(result, result_file, result_params): #+caption[Set =org-export= options]: #+caption: Set =org-export= options. #+name: lst:set-org-export-options -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'ox (setopt org-export-dispatch-use-expert-ui t)) #+end_src @@ -2704,7 +2704,7 @@ def __org_babel_python_format_value(result, result_file, result_params): #+caption[Setup =org= for export to LuaLaTeX]: #+caption: Setup =org= for export to LuaLaTeX. #+name: lst:setup-org-for-lualatex-export -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'org ;; https://list.orgmode.org/87o84fd4oi.fsf@posteo.net/ (add-to-list @@ -2739,7 +2739,7 @@ def __org_babel_python_format_value(result, result_file, result_params): #+caption[Set =ox-latex= options for export to LuaLaTeX]: #+caption: Set =ox-latex= options for export to LuaLaTeX. #+name: lst:set-ox-latex-options-for-lualatex-export -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'ox-latex (setopt org-latex-compiler "lualatex" @@ -2783,7 +2783,7 @@ def __org_babel_python_format_value(result, result_file, result_params): #+caption[Setup =org-latex-classes= for backwards compatibility]: #+caption: Setup =org-latex-classes= for backwards compatibility. #+name: lst:setup-org-latex-classes -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'ox-latex (mapc (function (lambda (element) (add-to-list 'org-latex-classes element))) @@ -3028,7 +3028,7 @@ to add =HTML+CSS+JS= for ~mhtml-mode~: #+caption[Buffer properties]: #+caption: Buffer properties. #+name: lst:buffer-properties -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'org (defconst prop-comments-link-re "\\( :comments link$\\)\\|\\( *$\\)" @@ -3292,7 +3292,7 @@ processor, text to product convertor) to an Emacs setup. Listing #+caption[Set =oc= and =citar= options]: #+caption: Set =oc= and =citar= options. #+name: lst:set-oc+citar-options -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'citar 'citar-embark) (with-eval-after-load 'embark (when (fboundp 'citar-embark-mode) @@ -3339,7 +3339,7 @@ valid directories and files. In an [[https://orgmode.org/][Org-mode]] buffer th 4. Select it. 4. The following =citar= functions may be useful too: 1. src_emacs-lisp{(call-interactively 'citar-insert-citation)}. - 2. src_emacs-lisp{(call-interactively 'citar-open)}. + 2. src_emacs-lisp[:results silent]{(call-interactively 'citar-open)}. *** TODO Compare bibtex and biblatex 1. [[https://www.economics.utoronto.ca/osborne/latex/BIBTEX.HTM][Using bibtex: a short guide]] @@ -3350,7 +3350,7 @@ valid directories and files. In an [[https://orgmode.org/][Org-mode]] buffer th #+caption[Delete =Biber= cache when =Biber= fails to make a bibliography]: #+caption: Delete =Biber= cache when =Biber= fails to make a bibliography. #+name: lst:delete-biber-cache -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs ;; https://tex.stackexchange.com/a/579356 answers ;; "How to solve Biber exiting with error code 2 but no error messages?" @@ -3399,7 +3399,7 @@ the user-friendliness of this facility to a level acceptable for my workflow: #+caption: blocks to floating unbreakable LaTeX environments or non-floating #+caption: breakable LaTeX environments. #+name: lst:org-latex-engraved-source-block-filter -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (ensure-package-installation 'engrave-faces) (defun org-latex-engraved-source-block-filter (data _backend _info) @@ -3431,7 +3431,7 @@ environment and an unbreakable Code (floating) environment." #+caption[Smart LaTeX engraving of =org-src-mode= blocks]: #+caption: Smart LaTeX engraving of =org-src-mode= blocks. #+name: lst:smart-latex-engrave-org-source-blocks -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (defun smart-latex-engrave-org-source-blocks () "Enable smart LaTeX engraving of `org-src-mode' blocks. @@ -3508,7 +3508,7 @@ expanded file name of the ~reveal.js~ directory. #+caption[Specify the =reveal.js= location and load =org-re-reveal=]: #+caption: Specify the =reveal.js= location and load =org-re-reveal=. #+name: lst:use-org-re-reveal -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'org-re-reveal) (defun use-org-re-reveal () "Load `org-re-reveal' after setting the \"reveal.js\" root." @@ -3530,7 +3530,7 @@ headline lists with the data in property drawers. #+caption[Install =org-vcard= to read =vcf= files=]: #+caption: Install =org-vcard= to read =vcf= files=. #+name: lst:org-vcarc -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (ensure-package-installation 'org-vcard) #+end_src @@ -3554,7 +3554,7 @@ The listings below implement or reimplement three groups of =org-link= types: #+caption[Define =org-link= types for backwards compatibility with =org-ref=]: #+caption: Define =org-link= types for backwards compatibility with =org-ref=. #+name: lst:org-ref-like-org-link-types -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'ol (org-link-set-parameters "ac*" :export #'org-ref-ac*-export) (org-link-set-parameters "cite" :export #'org-ref-cite-export) @@ -3597,7 +3597,7 @@ The listings below implement or reimplement three groups of =org-link= types: #+caption[Define an =org-link= type for =pdf-tools=]: #+caption: Define an =org-link= type for =pdf-tools=. #+name: lst:define-org-pdfview-link-type -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'ol (autoload 'pdf-view-goto-page "pdf-view" nil t) (org-link-set-parameters "pdfview" @@ -3717,7 +3717,7 @@ The following posts provide programming information: #+caption[Define an =org-link= type for =YouTube=]: #+caption: Define an =org-link= type for =YouTube=. #+name: lst:define-org-yt-link-type -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent ;; https://bitspook.in/blog/extending-org-mode-to-handle-youtube-paths/ (defun org-yt-emms-open (path) "Open an \"YouTube\" PATH link with `emms' using \"mpv\"." @@ -3760,7 +3760,7 @@ The following posts provide programming information: #+caption[Convert upper to lower case keywords]: #+caption: Convert upper to lower case keywords. #+name: lst:convert-upper-to-lower-case-keywords -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs ;; https://tecosaur.github.io/emacs-config/#translate-capital-keywords (defun org-syntax-convert-keyword-case-to-lower () @@ -3788,7 +3788,7 @@ The following posts provide programming information: #+caption[Evaluate specific source blocks at load-time]: #+caption: Evaluate specific source blocks at load-time. #+name: lst:load-time-specific-source-block-evaluation -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs (defun org-eval-named-blocks-with-infix (infix) "Evaluate all source blocks having INFIX in their name." @@ -3831,7 +3831,7 @@ define the [[https://orgmode.org/][Org mode]] =kbd= macro in listing #+caption[Define Emacs Lisp utilities to define the =Org-mode= =kbd= macro]: #+caption: Define Emacs Lisp utilities to define the =Org-mode= =kbd= macro. #+name: lst:by-backend-kbd-org-macro -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs (when (ensure-package-installation 'htmlize) (autoload 'htmlize-protect-string "htmlize" nil t)) @@ -3867,7 +3867,7 @@ make test > out.txt 2>&1 #+caption[Testing Org facilities 1]: #+caption: Testing Org facilities 1: for use during development only. #+name: lst:setup-org-mode-test-1 -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs (defvar org-testing-dir nil) (defvar org-testing-lisp-files nil) @@ -3910,7 +3910,7 @@ make test > out.txt 2>&1 #+caption[Testing Org facilities 2]: #+caption: Testing Org facilities 2: for use during development only. #+name: lst:setup-org-mode-test-2 -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs ;; Stolen from `org-test-run-all-tests'. (defun org-test-run-some-tests () @@ -4246,7 +4246,7 @@ prefixes all lines with \"#+latex_header: \"." #+caption[Convert marked LaTeX export blocks to LaTeX header lines]: #+caption: Convert marked LaTeX export blocks to LaTeX header lines. #+name: lst:org-latex-header-blocks-filter -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'ox (defun org-latex-header-blocks-filter (backend) "Convert marked LaTeX export blocks to \"#+latex_header: \" lines. @@ -4304,7 +4304,7 @@ with LaTeX export. #+caption[Set HTML export options]: #+caption: Set HTML export options. #+name: lst:set-html-export-options -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'ox-html ;; (Info-find-node "Org" "Literal Examples") (setopt org-html-head-include-scripts t) @@ -4404,7 +4404,7 @@ non-interactive =org-element= functions to an =Emacs-lisp= buffer. #+caption[Grok how =org-element= parses your document]: #+caption: Grok how =org-element= parses your document. #+name: lst:grok-org-element-tree -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'org-element (when (require 'pp nil 'noerror) (defconst grok-org-output @@ -4465,13 +4465,14 @@ non-interactive =org-element= functions to an =Emacs-lisp= buffer. [[https://www.masteringemacs.org/][Mickey Peterson]] has posted [[https://www.masteringemacs.org/article/correcting-typos-misspellings-abbrev][Correcting Typos and Misspellings with Abbrev]] showing how to use [[info:emacs#Keyboard Macros][Keyboard Macros (info)]] to exploit [[https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines][Wikipedia's list of common -misspellings for machines]]. Listing [[lst:misspellings-abbrev]] defines his -keyboard macro under the name =misspellings-abrev=. I have used those -directions to define src_emacs-lisp{global-abbrev-table} and to store it in -src_emacs-lisp{abbrev-file-name} for git management. I can change the +misspellings for machines]]. Listing [[lst:misspellings-abbrev]] defines his keyboard +macro under the name =misspellings-abrev=. I have used those directions to +define src_emacs-lisp[:results silent]{(describe-variable 'global-abbrev-table)} +and to store it in src_emacs-lisp[:results silent]{(describe-variable +'abbrev-file-name)} to manage its changes with git. I can change the abbreviation definitions in this file by means of: -1. Execute src_emacs-lisp{(edit-abbrevs)} to alter abbreviation definitions by - editing an =*Abbrevs*= buffer. +1. Execute src_emacs-lisp[:results silent]{(edit-abbrevs)} to alter abbreviation + definitions by editing an =*Abbrevs*= buffer. 2. Add, edit, or remove definitions of the form ="source" 1 "target"= under the global or a mode-specific table. 3. Execute src_emacs-lisp{(abbrev-edit-save-buffer)} to save all user @@ -4480,7 +4481,7 @@ abbreviation definitions in this file by means of: #+caption[Definition of the =misspellings-abbrev= keyboard macro]: #+caption: Definition of the =misspellings-abbrev= keyboard macro. #+name: lst:misspellings-abbrev -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs (defun browse-common-misspellings () "Open the Wikipedia page of common misspellings for machines in EWW." @@ -4501,7 +4502,7 @@ Listing [[lst:word-games]] defines the =anagram-p= function that migth be used g #+caption[Word games]: #+caption: Word games. #+name: lst:word-games -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent ;; https://funcall.blogspot.com/2022/07/lets-play-wordle.html ;; https://github.com/tabatkins/wordle-list (defun anagram-p (evil vile) @@ -4613,7 +4614,7 @@ etymology, or thesaurus back-ends (currently limited to [[https://en.wikipedia.o #+caption[Configure =lexic=]: #+caption: Configure =lexic=. #+name: lst:configure-lexic -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'lexic) ;; http://download.huzheng.org/fr/ ;; https://polyglotte.tuxfamily.org/doku.php?id=donnees:dicos_bilingues @@ -4643,7 +4644,7 @@ the [[https://github.com/gromnitsky/wordnut#readme][wordnut]] prerequisites. #+caption[System check for =wordnut=]: #+caption: System check for =wordnut=. #+name: lst:check-wordnut -#+begin_src emacs-lisp -n :tangle no +#+begin_src emacs-lisp -n :results silent :tangle no (when (ensure-package-installation 'wordnut) (with-eval-after-load 'wordnut (if-let ((wn (executable-find "wn"))) @@ -4663,7 +4664,7 @@ Listing [[lst:configure-writegood-mode]] configures [[https://github.com/bnbeckw #+caption[Configure =writegood-mode=]: #+caption: Configure =writegood-mode=. #+name: lst:configure-writegood-mode -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (and (ensure-package-installation 'writegood-mode) (fboundp 'writegood-mode)) (global-set-key (kbd "C-c g") #'writegood-mode)) @@ -4694,12 +4695,12 @@ configuration: file [[info:emacs#Directory Variables][.dir-locals.el]] in the root directory of any project using proper programming modes). 4. Listing [[lst:whiten-black]] defines Emacs Lisp functions to undo (whiten) some - output of [[https://black.readthedocs.io/en/stable/][Black]] after src_emacs-lisp{(org-babel-tangle)}. + output of [[https://black.readthedocs.io/en/stable/][Black]] after src_emacs-lisp[:results silent]{(org-babel-tangle)}. #+caption[Ensure =eglot= installation with minimal setup]: #+caption: Ensure =eglot= installation with minimal setup. #+name: lst:minimal-eglot-setup -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'eglot (keymap-set eglot-mode-map "C-c n" 'flymake-goto-next-error) (keymap-set eglot-mode-map "C-c p" 'flymake-goto-prev-error) @@ -4709,7 +4710,7 @@ configuration: #+caption[Help to setup any =org-src-mode= buffers for =eglot=]: #+caption: Help to setup any =org-src-mode= buffers for =eglot=. #+name: lst:help-setup-org-src-mode-for-eglot -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs (defcustom eglot-maybe-ensure-modes '(python-mode) "Modes where maybe `eglot-ensure' should be or has been called. @@ -4756,7 +4757,7 @@ the Org-mode source block code before calling `eglot-ensure'." #+caption[Make sessions for "eval-buffer" in "org-src-mode" buffers.]: #+caption: Make sessions for ~eval-buffer~ in ~org-src-mode~ buffers. #+caption: *Experimental: do not tangle*. -#+begin_src emacs-lisp -n :tangle no +#+begin_src emacs-lisp -n :results silent :tangle no (with-eval-after-load 'emacs (defun org-babel-edit-prep:python (info) (message "`%S'" info) @@ -4784,7 +4785,7 @@ the Org-mode source block code before calling `eglot-ensure'." #+caption[Setup Python =org-src-mode= buffers for =eglot=]: #+caption: Setup Python =org-src-mode= buffers for =eglot=. #+name: lst:setup-python-org-src-mode-for-eglot -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs ;; https://www.reddit.com/r/emacs/comments/w4f4u3 ;; /using_rustic_eglot_and_orgbabel_for_literate/ @@ -4811,7 +4812,7 @@ This is to advice `org-edit-src-exit' and `org-edit-src-save'." #+caption[Start =eglot= in case of a proper =dir-local-variables-alist=]: #+caption: Start =eglot= in case of a proper =dir-local-variables-alist=. #+name: lst:eglot-maybe-ensure -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs (defun eglot-maybe-ensure () (when (and (apply #'derived-mode-p eglot-maybe-ensure-modes) @@ -4827,7 +4828,7 @@ This is to advice `org-edit-src-exit' and `org-edit-src-save'." #+caption[Whiten Black]: #+caption: Whiten Black #+name: lst:whiten-black -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs (defun black-python-sequence () "Try to find a Blackened Python sequence to whiten." @@ -4957,7 +4958,7 @@ Listing [[lst:configure-format-all]]: #+caption[Configure =format-all=]: #+caption: Configure =format-all=. #+name: lst:configure-format-all -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent ;; https://github.com/lassik/emacs-format-all-the-code#readme ;; https://ianyepan.github.io/posts/format-all/ ;; https://jamesaimonetti.com/posts/formatting-tangled-output-in-org-mode/ @@ -4988,7 +4989,7 @@ that do not visit a file. Listing [[lst:configure-flymake]] aliases =list-error #+caption[Configure =Flymake=]: #+caption: Configure =Flymake= #+name: lst:configure-flymake -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'flymake (defalias 'list-errors #'flymake-show-buffer-diagnostics "Show a list of Flymake diagnostics for current buffer.")) @@ -5020,7 +5021,7 @@ Links to Common Lisp books and posts are: #+caption[Configure =slime=]: #+caption: Configure =slime=. #+name: lst:configure-slime -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'slime) (with-eval-after-load 'slime (setq slime-default-lisp 'sbcl @@ -5063,13 +5064,14 @@ for use with [[http://www.sbcl.org/][Steel Bank Common Lisp (sbcl)]]: to the [[info:sly#Basic customization][basic customization (info)]] manual. Listing [[lst:slink-sel]] allows to set or get the Sly string elision length. Finally, listing [[lst:configure-sly]] uses a technique to [[info:sly#Loading Slynk faster][load Slynk faster (info)]] -by means of a custom core file in src_emacs-lisp{no-littering-var-directory}. -Listing [[lst:sbcl-core-for-sly]] tangles to a script to dump such a [[http://www.sbcl.org/][SBCL]] core. +by means of a custom core file in src_emacs-lisp[:results +silent]{(describe-variable 'no-littering-var-directory)}. Listing +[[lst:sbcl-core-for-sly]] tangles to a script to dump such a [[http://www.sbcl.org/][SBCL]] core. #+caption[Configure =sly=]: #+caption: Configure =sly=. #+name: lst:configure-sly -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'sly 'sly-macrostep 'sly-named-readtables) (with-eval-after-load 'sly ;; Set `sly-default-lisp' instead of `inferior-lisp-program', @@ -5107,7 +5109,7 @@ Listing [[lst:sbcl-core-for-sly]] tangles to a script to dump such a [[http://ww #+caption[Get/set Sly ~slynk:*string-elision-length*~ functionality]: #+caption: Get/set Sly ~slynk:*string-elision-length*~ functionality. #+name: lst:slink-sel -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'sly (defconst slynk-command-get-sel "(cdr (assoc 'slynk:*string-elision-length* slynk:*slynk-pprint-bindings*))" @@ -5288,7 +5290,7 @@ git clone git@github.com:ageldama/cl-state-machine.git #+caption[Install =sbcli=]: #+caption: Install =sbcli=. #+name: lst:install-sbcli -#+begin_src emacs-lisp -n :eval never-export :lexical t :tangle no +#+begin_src emacs-lisp -n :eval never-export :results silent :tangle no (let ((url "https://raw.githubusercontent.com/hellerve/sbcli/master/repl.lisp") (file "~/bin/sbcli")) (url-copy-file url file 'ok-if-already-exists) @@ -5322,7 +5324,7 @@ post. #+caption[Define faces for =Common Lisp= custom font locking]: #+caption: Define faces for =Common Lisp= custom-font-locking. #+name: lst:cl-custom-font-locking-faces -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent ;;; Common Lisp custom font lock configuration. ;;; https://www.n16f.net/blog/custom-font-lock-configuration-in-emacs/ @@ -5377,14 +5379,14 @@ post. #+caption: Use =Common Lisp= to define the =cl-function-names= variable in #+caption: an =Emacs Lisp= source block for tangling into =user-init-file=. #+name: lst:define-cl-function-names -#+header: :wrap "src emacs-lisp -n" +#+header: :wrap "src emacs-lisp -n :results silent" #+begin_src lisp -n :exports both :eval never-export (format nil "(defvar~% cl-function-names~% '~S)~%" (standard-symbol-names #'fboundp)) #+end_src #+RESULTS: lst:define-cl-function-names -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (defvar cl-function-names '("*" "+" "-" "/" "/=" "1+" "1-" "<" "<=" "=" ">" ">=" "abort" "abs" "acons" @@ -5548,14 +5550,14 @@ post. #+caption: Use =Common Lisp= to define the =cl-variable-names= variable in #+caption: an =Emacs Lisp= source block for tangling into =user-init-file=. #+name: lst:define-cl-value-names -#+header: :wrap "src emacs-lisp -n" +#+header: :wrap "src emacs-lisp -n :results silent" #+begin_src lisp -n :exports both :eval never-export (format nil "(defvar~% cl-value-names~% '~S)~%" (standard-symbol-names #'boundp)) #+end_src #+RESULTS: lst:define-cl-value-names -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (defvar cl-value-names '("*" "**" "***" "*break-on-signals*" "*compile-file-pathname*" @@ -5606,7 +5608,7 @@ post. #+caption[Finalize =Common Lisp= custom font locking]: #+caption: Finalize =Common Lisp= custom font locking. #+name: lst:finalize-cl-custom-font-locking -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (defvar cl-font-lock-keywords (let* ((character-re (concat "#\\\\" lisp-mode-symbol-regexp "\\_>")) (function-re (concat "(" (regexp-opt cl-function-names t) "\\_>")) @@ -5650,12 +5652,12 @@ many Emacs Lisp idioms. Listing [[lst:setup-ielm][setup ielm]] configures the [[https://wikemacs.org/wiki/IELM][Interactive Emacs Lisp Mode]] for better interoperability with [[https://smartparens.readthedocs.io/en/latest/][Smartparens]]: get help on the key bindings by means of -src_emacs-lisp{(describe-function 'inferior-emacs-lisp-mode)}. +src_emacs-lisp[:results silent]{(describe-function 'ielm)}. #+caption[Setup =ielm=]: #+caption: Setup =ielm=. #+name: lst:setup-ielm -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'ielm (setopt ielm-dynamic-return nil)) #+end_src @@ -5672,7 +5674,7 @@ Emacs Lisp forms. #+caption[Define macro to benchmark groups of forms]: #+caption: Define macro to benchmark groups of forms. #+name: lst:benchmark-group -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (defvar joaot/bench-group-name nil) (defvar joaot/setup-form nil) (defvar joaot/timings-alist nil) @@ -5710,7 +5712,7 @@ Emacs Lisp forms. #+caption[Define macro to benchmark forms]: #+caption: Define macro to benchmark forms. #+name: lst:benchmark-form -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (defmacro joaot/bench (form) `(cl-progv (mapcar #'car joaot/setup-form) @@ -5732,7 +5734,7 @@ Emacs Lisp forms. #+caption[Define benchmark helper functions]: #+caption: Define benchmark helper functions. #+name: lst:benchmark-helpers -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (defun bench-cl-loop-list (l) (cl-loop for e in l thereis (identity e))) @@ -5932,7 +5934,7 @@ byte code: #+caption[Setup Go programming]: #+caption: Setup Go programming. #+name: lst:setup-go -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (featurep 'treesit) ;; Set `tab-width' in `after-change-major-mode-hook' function too. (setopt go-ts-mode-indent-offset 2) @@ -5962,7 +5964,7 @@ arguments of listing [[lst:maxima-example]]. #+caption[Configure =maxima=]: #+caption: Configure =maxima=. #+name: lst:configure-maxima -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (require 'maxima nil t) ;; In case of https://gitlab.com/sasanidas/maxima, uncomment the next 2 lines: ;; (add-hook 'maxima-mode-hook #'maxima-hook-function) @@ -6053,7 +6055,7 @@ of [[https://github.com/jorgenschaefer/pyvenv#readme][pyvenv]]). Therefore, I r Install [[https://github.com/PyCQA/isort#readme][isort]] and [[https://github.com/PyCQA/pyflakes#readme][pyflakes]] to enable adding, removing, sorting, and fixing import statements in [[https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/python.el][Python-mode]], see the end of the commentary -src_emacs-lisp{(find-library "python")} section. +src_emacs-lisp[:results silent]{(find-library "python")} section. Listing [[lst:pyproject-toml-kickoff][kickoff pyproject.toml proposal]] facilitates dropping a [[https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml][pyproject.toml]] file into Python projects which anyhow should switch to using a [[https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml][pyproject.toml]] @@ -6071,7 +6073,7 @@ Finally, listing [[lst:flake8-nocolor][flake8-nocolor]] and [[lst:ruff-nocolor][ #+caption[Setup Python mode with =ob-python=]: #+caption: Setup Python mode with =ob-python=. #+name: lst:setup-python-mode -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'ob-python (setopt org-babel-python-command (concat (or (executable-find "python3") (executable-find "python")) @@ -6092,7 +6094,7 @@ Finally, listing [[lst:flake8-nocolor][flake8-nocolor]] and [[lst:ruff-nocolor][ #+caption[Access =pyenv=]: #+caption: Access =pyenv=. #+name: lst:access-pyenv -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (executable-find "pyenv") (defun pyenv-full-path (version) "Return the full path for VERSION." @@ -6138,7 +6140,7 @@ Complete the result with \"system\"." #+caption[Select the Python virtual environment]: #+caption: Select the Python virtual environment. #+name: lst:select-python-virtual-environment -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'python (when (cl-every #'fboundp '(pyenv-full-path pyenv-version-name @@ -6283,7 +6285,7 @@ ruff "$@" | cat #+caption: Org Babel Ackermann Python test. #+name: lst:obap-test #+header: :wrap "src text -n" -#+begin_src python -n :eval never-export :exports both :session +#+begin_src python -n :eval never-export :exports both :session Python # https://rosettacode.org/wiki/Ackermann_function#Python # https://www.youtube.com/watch?v=i7sm9dzFtEI @@ -6353,7 +6355,7 @@ Available versions: 0.2.0, 0.1.1, 0.1.0 #+caption[Emacs client "Package Installer for Python" and "PyPI" options]: #+caption: Emacs client "Package Installer for Python" and "PyPI" options. #+name: lst:pip-pypi-options -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (defgroup pip nil "Client for accessing the \"Package Installer for Python\" and \"PyPI\"." :group 'applications) @@ -6370,7 +6372,7 @@ Available versions: 0.2.0, 0.1.1, 0.1.0 #+caption[Emacs interface to list outdated Python packages]: #+caption: Emacs interface to list outdated Python packages. #+name: lst:pip-list-outdated -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (defvar pip-outdated-packages nil "Outdated Python packages.") @@ -6455,14 +6457,15 @@ file in the root directory of any [[https://www.python.org][Python]] project to according to the configuration in listing [[lst:eglot-maybe-ensure]]. Type {{{kbd(M-x eglot-show-workspace-configuration)}}} to dump a =JSON= -representation of src_emacs-lisp{eglot-workspace-configuration} for debugging. -The comment in listing [[lst:minimal-eglot-setup][minimal Eglot setup]] also shows how to decrease -or to increase the verbosity of [[https://github.com/python-lsp/python-lsp-server][Python LSP server]] log output for debugging. +representation of src_emacs-lisp[:results silent]{(describe-variable +'eglot-workspace-configuration)} for debugging. The comment in listing [[lst:minimal-eglot-setup][minimal +Eglot setup]] also shows how to decrease or to increase the verbosity of [[https://github.com/python-lsp/python-lsp-server][Python +LSP server]] log output for debugging. #+caption[Configure =eglot= with =python-lsp-ruff=]: #+caption: Configure =eglot= with =python-lsp-ruff=. #+name: lst:configure-eglot+pylsp-ruff -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'eglot (setq-default eglot-workspace-configuration @@ -6487,7 +6490,7 @@ or to increase the verbosity of [[https://github.com/python-lsp/python-lsp-serve #+caption: A =.dir-locals.el= file proposal for Python projects or Org-mode #+caption: projects tangling Python files to launch =eglot= automatically. #+name: lst:eglot-directory-variables-for-python -#+begin_src emacs-lisp -n :tangle dir-locals.el +#+begin_src emacs-lisp -n :eval never :tangle dir-locals.el ;; A .dir-locals.el file proposal in the root of any ;; Python project or Org-mode project tangling Python files ;; to launch eglot automatically. @@ -6561,7 +6564,7 @@ configures =code-cells=. #+caption[Configure =code-cells=]: #+caption: Configure =code-cells=. #+name: lst:configure-code-cells -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'code-cells) (with-eval-after-load 'code-cells (let ((map code-cells-mode-map)) @@ -6587,7 +6590,7 @@ for instance the [[https://racket-lang.org/][Racket]] programming environment [[ #+caption[Ensure =racket= installation to study SICP]: #+caption: Ensure =racket= installation to study SICP. #+name: lst:setup-sicp -#+begin_src emacs-lisp -n +#+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 @@ -6625,9 +6628,12 @@ Listing [[lst:setup-geiser][Ensure Geiser installation]] supports the Scheme imp 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{(setopt scheme-default-implementation 'chicken)}, -2. src_emacs-lisp{(setopt scheme-default-implementation 'guile)}, -3. src_emacs-lisp{(setopt scheme-default-implementation 'chez)}. +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=. @@ -6638,7 +6644,7 @@ install [[https://call-cc.org/][Chicken Scheme]] with [[https://brew.sh/][Homebr #+caption[Ensure =geiser= installation]: #+caption: Ensure =geiser= installation. #+name: lst:setup-geiser -#+begin_src emacs-lisp -n +#+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)) @@ -6709,7 +6715,7 @@ Emacs setup (for instance [[https://github.com/andras-simonyi/citeproc-el#readme #+caption[Configure =dash= fontification and info lookup]: #+caption: Configure =dash= fontification and info lookup. #+name: lst:configure-dash -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (fboundp #'global-dash-fontify-mode) (global-dash-fontify-mode)) @@ -6748,7 +6754,7 @@ setup and requires no configuration. #+caption[Enable =iedit=]: #+caption: Enable =iedit=. #+name: lst:enable-iedit -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'iedit) (require 'iedit nil 'noerror)) #+end_src @@ -6761,7 +6767,7 @@ setup and requires no configuration. #+caption[Configure =ws-butler=]: #+caption: Configure =ws-butler=. #+name: lst:configure-ws-butler -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (and (ensure-package-installation 'ws-butler) (require 'ws-butler nil 'noerror)) (setopt ws-butler-keep-whitespace-before-point nil) @@ -6801,11 +6807,12 @@ following links show how to put the documentation to practical use: how the machinery after the first and after later usages of =eval-expression= differ and discusses options how to handle those differences. Listing [[lst:configure-smartparens]] aims to configure [[https://github.com/Fuco1/smartparens][smartparens]] for Go, LaTeX, -Lisp dialects, Org, and Python. Execute src_emacs-lisp{(sp-cheat-sheet)} for -short documentation taking into account the overridden key bindings in listing -[[lst:configure-smartparens]]. Table [[tab:smartparens-commands-and-bindings]] lists -commands with key bindings taken in order from src_emacs-lisp{(sp-cheat-sheet)} -that takes the overrides of listing [[lst:configure-smartparens]] into account. +Lisp dialects, Org, and Python. Execute src_emacs-lisp[:results +silent]{(sp-cheat-sheet)} for short documentation taking into account the +overridden key bindings in listing [[lst:configure-smartparens]]. Table +[[tab:smartparens-commands-and-bindings]] lists commands with key bindings taken in +order from src_emacs-lisp[:results silent]{(sp-cheat-sheet)} that takes the +overrides of listing [[lst:configure-smartparens]] into account. Despite the provocative post [[https://andreyorst.gitlab.io/posts/2022-02-20-what-if-structural-editing-was-a-mistake/]["What if structural editing was a mistake?"]], [[https://github.com/Fuco1/smartparens][smartparens]] is one of my favorite packages. In particular, [[https://github.com/Fuco1/smartparens][smartparens]] handles @@ -6818,7 +6825,7 @@ contrary to for instance [[https://github.com/Fanael/rainbow-delimiters#readme][ #+caption[Configure =smartparens=]: #+caption: Configure =smartparens=. #+name: lst:configure-smartparens -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (and (ensure-package-installation 'smartparens) ;; Require `smartparens-config' instead of `smartparens' to ;; disable pairing of the quote character for lisp modes. @@ -6917,7 +6924,7 @@ formatter for Python]]. #+caption[Configure =electric-operator=]: #+caption: Configure =electric-operator=. #+name: lst:configure-electric-operator -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (and (ensure-package-installation 'electric-operator) (fboundp 'electric-operator-mode)) (add-hook 'c-mode-common-hook #'electric-operator-mode) @@ -6932,7 +6939,7 @@ formatter for Python]]. #+caption[Enable =yas-global-mode=]: #+caption: Enable =yas-global-mode=. #+name: lst:enable-yas-global-mode -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'yasnippet) ;; Set `yas-alias-to-yas/prefix-p' before loading `yasnippet'. (setopt yas-alias-to-yas/prefix-p nil) @@ -6967,7 +6974,7 @@ Listing [[lst:configure-tempo-latex-completing-read]] shows how to combine =temp #+caption[Configure =tempo= user interface]: #+caption: Configure =tempo= user-interface. #+name: lst:configure-tempo-ui -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (require 'tempo nil 'noerror) (setopt tempo-interactive t) @@ -7012,7 +7019,7 @@ Allows `tempo' expansion by typing after a complete `tempo' tag." #+caption[Configure =tempo= for =latex= with =completing-read=]: #+caption: Configure =tempo= for =latex= with =completing-read=. #+name: lst:configure-tempo-latex-completing-read -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'latex (require 'tempo nil 'noerror) @@ -7050,7 +7057,7 @@ Allows `tempo' expansion by typing after a complete `tempo' tag." #+caption[Configure =tempo= for =python-mode=]: #+caption: Configure =tempo= for =python-mode=. #+name: lst:setup-python-tempo -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'python (require 'tempo nil 'noerror) @@ -7108,7 +7115,7 @@ on any Org table, Org source block, Org block, or Org subtree. #+caption[Configure =narrow-or-widen-dwim=]: #+caption: Configure =narrow-or-widen-dwim=. #+name: lst:configure-narrow-or-widen-dwim -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emacs (declare-function org-at-table-p "org" (&optional table-type)) @@ -7163,7 +7170,7 @@ and names in buffers for debugging. #+caption[Enable =rainbow-mode=]: #+caption: Enable =rainbow-mode=. #+name: lst:enable-rainbow-mode -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (and (ensure-package-installation 'rainbow-mode) (fboundp 'rainbow-mode)) (setopt rainbow-x-colors-major-mode-list '(c++-mode @@ -7189,7 +7196,7 @@ point movements visually. #+caption[Implement =flash-line-around-point=]: #+caption: Implement =flash-line-around-point=. #+name: lst:flash-line-around-point -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent ;; Ensure loading `pulse' with the dynamic variables `pulse-delay' and ;; `pulse-iterations' before masking them lexically instead of after ;; to prevent the warning triggered by lazy loading. @@ -7230,7 +7237,7 @@ Listing [[lst:configure-browse-url]] configures =browse-url=. #+caption[Configure =browse-url=]: #+caption: Configure =browse-url=. #+name: lst:configure-browse-url -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'browse-url (defun browse-url-mpv (url &optional _) (start-process "mpv" nil "mpv" url)) @@ -7257,7 +7264,7 @@ Listing [[lst:configure-browse-url]] configures =browse-url=. #+caption[Configure =eww= URLs]: #+caption: Configure =eww= URLs. #+name: lst:configure-eww-urls -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (fboundp 'eww-browse-url) (defun eww-subreddit () "Read a subreddit in Emacs." @@ -7273,7 +7280,7 @@ Listing [[lst:configure-browse-url]] configures =browse-url=. #+caption[Rename =eww= buffers and display =pdf= links properly]: #+caption: Rename =eww= buffers and display =pdf= links properly. #+name: lst:rename-eww-buffer-display-pdf-links -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'eww (defun eww-display-pdf-as-binary (fn &rest args) (let ((buffer-file-coding-system 'binary)) @@ -7312,13 +7319,13 @@ Listing [[lst:ensure-hyperbole-installation][ensure Hyperbole installation]] wor =vertico-mode= preselection of the first candidate out of the full candidate completion list interferes with =hyperbole-mode= expectations where it must handle a full candidate list. Therefore, the function call - src_emacs-lisp{(either-hyperbole-or-vertico-mode)} handles this conflict by - toggling between =hyperbole-mode= and =vertico-mode=. + src_emacs-lisp[:results silent]{(either-hyperbole-or-vertico-mode)} handles + this conflict by toggling between =hyperbole-mode= and =vertico-mode=. #+caption[Ensure Hyperbole installation]: #+caption: Ensure Hyperbole installation and address two Hyperbole quirks. #+name: lst:ensure-hyperbole-installation -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'hyperbole) (unless (load "kotl-autoloads.el" 'noerror nil nil 'must-suffix) ;; See `package-generate-autoloads' for `loaddefs-generate' usage. @@ -7401,14 +7408,14 @@ bound to {{{kbd(C-x r b)}}}. #+caption[Ensure "osm" installation]: #+caption: Ensure ~osm~ installation. #+name: lst:ensure-osm-installation -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (ensure-package-installation 'osm) #+end_src #+caption[Using "osm" example]: #+caption: Using ~osm~ example. #+name: lst:using-osm-example -#+begin_src emacs-lisp -n :tangle no +#+begin_src emacs-lisp -n :results silent :tangle no (osm "Tower of London") #+end_src @@ -7421,7 +7428,7 @@ bound to {{{kbd(C-x r b)}}}. runs queries from a plain-text query sheet and displays results as images, pretty-printed =XML=, and pretty-printed =JSON=. -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (ensure-package-installation 'restclient) #+end_src @@ -7462,7 +7469,7 @@ sets the =webjump-sites= option. #+caption[Set =webjump= options and bind the =webjump= command]: #+caption: Set =webjump= options and bind the =webjump= command. #+name: lst:set-webjump-options -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (fboundp 'webjump) (keymap-global-set "C-c j" 'webjump) (with-eval-after-load 'webjump @@ -7529,7 +7536,7 @@ Password management: #+caption[Configure =gnus=]: #+caption: Configure =gnus=. #+name: lst:configure-gnus -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'gnus (setopt gnus-select-method '(nntp "news.gmane.io"))) @@ -7562,7 +7569,7 @@ Password management: #+caption[Configure =message=]: #+caption: Configure =message=. #+name: lst:configure-message -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (setopt user-full-name "Gerard Vermeulen" user-mail-address "gerard.vermeulen@posteo.net") (with-eval-after-load 'message @@ -7572,7 +7579,7 @@ Password management: #+caption[Configure =sendmail=]: #+caption: Configure =sendmail=. #+name: lst:configure-sendmail -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'sendmail (setopt mail-specify-envelope-from t mail-envelope-from 'header @@ -7658,7 +7665,7 @@ command, and makes a minimal attempt to enable =emms=. #+caption[Set =elfeed= options and bind =elfeed= command]: #+caption: Set =elfeed= options and bind =elfeed= command. #+name: lst:set-elfeed-options -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (and (ensure-package-installation 'elfeed) (fboundp 'elfeed)) (keymap-global-set "C-x w" #'elfeed) @@ -7693,7 +7700,7 @@ for ~mpv~ while eliminating use of ~mpd~. #+caption[Set =emms= options]: #+caption: Set =emms= options. #+name: lst:set-emms-options -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (when (ensure-package-installation 'emms) (with-eval-after-load 'emms (emms-all) @@ -7749,7 +7756,7 @@ for technical information. #+caption[Hiding =*spurious*= buffers]: #+caption: Hiding =*spurious*= buffers. #+name: lst:hiding-spurious-buffers -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (with-eval-after-load 'emms-player-mpd ;; https://www.masteringemacs.org/article/demystifying-emacs-window-manager ;; Hide `*spurious*' buffers, but you can always switch to them: @@ -7799,7 +7806,7 @@ audio_output { #+caption[Tangle the =user-init-file= footer]: #+caption: Tangle the =user-init-file= footer. #+name: lst:tangle-user-init-file-footer -#+begin_src emacs-lisp -n +#+begin_src emacs-lisp -n :results silent (provide 'init) ;; Emacs looks for "Local variables:" after the last "newline-formfeed".