Tweak source block export in the "CL custom font locking" section

This commit is contained in:
Gerard Vermeulen 2023-02-26 21:44:42 +01:00
parent 888466e7d1
commit 860010a7f7

View File

@ -4153,6 +4153,14 @@ EOF
# End: # End:
#+end_src #+end_src
*** [[https://www.n16f.net/blog/custom-font-lock-configuration-in-emacs/][Common Lisp custom font locking]]
:PROPERTIES:
:CUSTOM_ID: sec:cl-custom-font-locking
:END:
#+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 :results silent #+begin_src emacs-lisp -n :results silent
;;; Common Lisp custom font lock configuration. ;;; Common Lisp custom font lock configuration.
;;; https://www.n16f.net/blog/custom-font-lock-configuration-in-emacs/ ;;; https://www.n16f.net/blog/custom-font-lock-configuration-in-emacs/
@ -4170,9 +4178,9 @@ EOF
"The face used to highlight standard Common Lisp value symbols.") "The face used to highlight standard Common Lisp value symbols.")
#+end_src #+end_src
#+caption[Define tools to find =Common Lisp= standard symbol names]: #+caption[Setup =SLY= and =Common Lisp= to find standard symbol names]:
#+caption: Define tools to find =Common Lisp= standard symbol names. #+caption: Setup =SLY= and =Common Lisp= to find standard symbol names.
#+name: lst:find-cl-standard-symbol-names #+name: lst:sly-cl-standard-symbol-names
#+begin_src lisp -n :eval never-export :results silent :tangle no #+begin_src lisp -n :eval never-export :results silent :tangle no
(rplacd (assoc 'slynk:*string-elision-length* slynk:*slynk-pprint-bindings*) (rplacd (assoc 'slynk:*string-elision-length* slynk:*slynk-pprint-bindings*)
(ash 1 14)) (ash 1 14))
@ -4185,17 +4193,18 @@ EOF
(sort symbols #'string<))) (sort symbols #'string<)))
#+end_src #+end_src
#+caption[Define the =cl-function-names= variable]: #+caption[Define the =cl-function-names= variable in an =Emacs Lisp= block]:
#+caption: Define the =cl-function-names= variable. #+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 #+name: lst:define-cl-function-names
#+header: :wrap "src emacs-lisp -n :export none :eval never" #+header: :wrap "src emacs-lisp -n :results silent"
#+begin_src lisp -n #+begin_src lisp -n :exports both :eval never-export
(format nil "(defvar~% cl-function-names~% '~S)~%" (format nil "(defvar~% cl-function-names~% '~S)~%"
(standard-symbol-names #'fboundp)) (standard-symbol-names #'fboundp))
#+end_src #+end_src
#+RESULTS: lst:define-cl-function-names #+RESULTS: lst:define-cl-function-names
#+begin_src emacs-lisp -n :export none :eval never #+begin_src emacs-lisp -n :results silent
(defvar (defvar
cl-function-names cl-function-names
'("*" "+" "-" "/" "/=" "1+" "1-" "<" "<=" "=" ">" ">=" "abort" "abs" "acons" '("*" "+" "-" "/" "/=" "1+" "1-" "<" "<=" "=" ">" ">=" "abort" "abs" "acons"
@ -4350,17 +4359,20 @@ EOF
"yes-or-no-p" "zerop")) "yes-or-no-p" "zerop"))
#+end_src #+end_src
#+caption[Define the =cl-value-names= variable]: \newpage
#+caption: Define the =cl-value-names= variable.
#+caption[Define the =cl-variable-names= variable in an =Emacs Lisp= block]:
#+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 #+name: lst:define-cl-value-names
#+header: :wrap "src emacs-lisp :export none :eval never" #+header: :wrap "src emacs-lisp -n :results silent"
#+begin_src lisp -n #+begin_src lisp -n :exports both :eval never-export
(format nil "(defvar~% cl-value-names~% '~S)~%" (format nil "(defvar~% cl-value-names~% '~S)~%"
(standard-symbol-names #'boundp)) (standard-symbol-names #'boundp))
#+end_src #+end_src
#+RESULTS: lst:define-cl-value-names #+RESULTS: lst:define-cl-value-names
#+begin_src emacs-lisp :export none :eval never #+begin_src emacs-lisp -n :results silent
(defvar (defvar
cl-value-names cl-value-names
'("*" "**" "***" "*break-on-signals*" "*compile-file-pathname*" '("*" "**" "***" "*break-on-signals*" "*compile-file-pathname*"
@ -4403,6 +4415,9 @@ EOF
"single-float-negative-epsilon" "t")) "single-float-negative-epsilon" "t"))
#+end_src #+end_src
#+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 :results silent #+begin_src emacs-lisp -n :results silent
(defvar cl-font-lock-keywords (defvar cl-font-lock-keywords
(let* ((character-re (concat "#\\\\" lisp-mode-symbol-regexp "\\_>")) (let* ((character-re (concat "#\\\\" lisp-mode-symbol-regexp "\\_>"))