Compare commits

..

No commits in common. "91930a038e1d4a8da7dbc74d57b3042c58bf2049" and "e9077c13528f378cc3454eecc107fdc1d76457a3" have entirely different histories.

View File

@ -675,12 +675,6 @@ and [[lst:3rd-window-management]] implement a selection of his recommendations.
#+name: lst:toggle-specific-advice #+name: lst:toggle-specific-advice
#+begin_src emacs-lisp #+begin_src emacs-lisp
(with-eval-after-load 'emacs (with-eval-after-load 'emacs
(defun toggle-engrave-faces-attribute-values-around ()
"Toggle `engrave-faces-attribute-values-around' advice."
(interactive)
(advice-toggle 'engrave-faces-attribute-values
:around #'engrave-faces-attribute-values-around))
(defun toggle-engrave-faces-latex-face-apply-override () (defun toggle-engrave-faces-latex-face-apply-override ()
"Toggle `engrave-faces-latex-face-apply' advice." "Toggle `engrave-faces-latex-face-apply' advice."
(interactive) (interactive)
@ -918,7 +912,6 @@ defined in this Org file.
(define-short-documentation-group init (define-short-documentation-group init
"Advice" "Advice"
(advice-toggle :no-manual t) (advice-toggle :no-manual t)
(toggle-engrave-faces-attribute-values-around :no-manual t)
(toggle-engrave-faces-latex-face-apply-override :no-manual t) (toggle-engrave-faces-latex-face-apply-override :no-manual t)
(toggle-engrave-faces-latex-face-mapper-override :no-manual t) (toggle-engrave-faces-latex-face-mapper-override :no-manual t)
(toggle-eww-display-pdf-around :no-manual t) (toggle-eww-display-pdf-around :no-manual t)
@ -2502,17 +2495,13 @@ this facility to a level acceptable for my workflow:
"faces")} have symbolic color names (beware: Emacs themes may replace the "faces")} have symbolic color names (beware: Emacs themes may replace the
symbolic color names with hexadecimal strings), this fix allows to engrave symbolic color names with hexadecimal strings), this fix allows to engrave
for instance org-mode source blocks during LaTeX export without any for instance org-mode source blocks during LaTeX export without any
customization of =engrave-faces-themes=. Listing customization of =engrave-faces-themes=.
[[lst:ensure-engrave-faces-with-attribute-values-fix]] proposes another method to
obtain the same result. Currently, I prefer to tangle listing
[[lst:ensure-engrave-faces-with-attribute-values-fix]] to the =user-init-file=
instead of listing [[lst:ensure-engrave-faces-with-latex-face-apply-fix]].
3. Listing [[lst:ensure-engrave-faces-with-latex-face-mapper-fix]] makes 3. Listing [[lst:ensure-engrave-faces-with-latex-face-mapper-fix]] makes
=engrave-faces-latex-face-mapper= handle horizontal and vertical spacing in =engrave-faces-latex-face-mapper= handle horizontal and vertical spacing
multiple line documentation strings correctly. For instance, without this fix in multiple line documentation strings correctly. For instance, without this
the mishandling of vertical and horizontal spacing destroys the indentation fix the mishandling of vertical and horizontal spacing destroys the
in Python documentation strings. An Emacs lisp example of the bug is the indentation in Python documentation strings. An Emacs lisp example of the
disappearance of the empty line in the documentation string of bug is the disappearance of the empty line in the documentation string of
=org-latex-engraved-source-block-filter= of listing =org-latex-engraved-source-block-filter= of listing
[[lst:org-latex-engraved-source-block-filter]] in exported =pdf= files. The idea [[lst:org-latex-engraved-source-block-filter]] in exported =pdf= files. The idea
of the fix is to let the LaTeX face mapper wrap only groups of "words joined of the fix is to let the LaTeX face mapper wrap only groups of "words joined
@ -2602,10 +2591,10 @@ environments and non-floating breakable LaTeX environments by means of
[LISTINGS-SETUP]"))) [LISTINGS-SETUP]")))
#+end_src #+end_src
#+caption[Fix engraving of symbolic color names in =engrave-faces-latex=]: #+caption[Fix engraving of symbolic color names]:
#+caption: Fix engraving of symbolic colors names in =engrave-faces-latex=. #+caption: Fix engraving of symbolic colors names.
#+name: lst:ensure-engrave-faces-with-latex-face-apply-fix #+name: lst:ensure-engrave-faces-with-latex-face-apply-fix
#+begin_src emacs-lisp :tangle no #+begin_src emacs-lisp
(when (and (ensure-package-installation 'engrave-faces) (when (and (ensure-package-installation 'engrave-faces)
(require 'engrave-faces-latex nil t)) (require 'engrave-faces-latex nil t))
(defun engrave-faces-latex--color (color) (defun engrave-faces-latex--color (color)
@ -2637,30 +2626,6 @@ environments and non-floating breakable LaTeX environments by means of
:override #'engrave-faces-latex-face-apply-override)) :override #'engrave-faces-latex-face-apply-override))
#+end_src #+end_src
#+caption[Fix engraving of symbolic color names in =engrave-faces=]:
#+caption: Fix engraving of symbolic colors names in =engrave-faces=.
#+name: lst:ensure-engrave-faces-with-attribute-values-fix
#+begin_src emacs-lisp
(when (and (ensure-package-installation 'engrave-faces)
(require 'engrave-faces nil t))
(defun engrave-faces-attribute-values-around (efav-fun &rest args)
(let ((values (apply efav-fun args))
(attribute (cadr args)))
(if (not (member attribute '(:foreground :background)))
values
(mapcar (lambda (color)
(if (char-equal ?# (aref color 0))
color)
(apply 'format "#%02x%02x%02x"
(mapcar (lambda (c) (ash c -8))
(color-values color))))
values))))
(advice-add 'engrave-faces-attribute-values
:around #'engrave-faces-attribute-values-around))
#+end_src
#+caption[Fix engraving of horizontal/vertical spacing in multiline docstrings]: #+caption[Fix engraving of horizontal/vertical spacing in multiline docstrings]:
#+caption: Fix engraving of horizontal and vertical spacing in multiple line #+caption: Fix engraving of horizontal and vertical spacing in multiple line
#+caption: documentation strings. #+caption: documentation strings.
@ -4231,19 +4196,6 @@ Here is a list of links describing how to program and debug [[info:elisp#Top][Em
Ref. [cite:@Monnier.ACM-PL.4.1] exposes the evolution of Emacs Lisp and explains Ref. [cite:@Monnier.ACM-PL.4.1] exposes the evolution of Emacs Lisp and explains
many Emacs Lisp idioms. many Emacs Lisp idioms.
Listing [[lst:setup-ielm][setup ielm]] customizes 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-mode (get-buffer "*ielm*"))}.
#+caption)}[Setup =ielm=]:
#+caption: Install =ielm=.
#+name: lst:setup-ielm
#+begin_src emacs-lisp
(with-eval-after-load 'ielm
(custom-set-variables
'(ielm-dynamic-return nil)))
#+end_src
** [[https://fennel-lang.org/][Fennel Programming]] ** [[https://fennel-lang.org/][Fennel Programming]]
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: sec:fennel-programming :CUSTOM_ID: sec:fennel-programming