From f19fcfd025243d62d649fd0a52465c3f5530cb3d Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Tue, 28 Dec 2021 08:42:19 +0100 Subject: [PATCH] Start fleshing out the appearance section --- README.org | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/README.org b/README.org index da54958..0cff2fa 100644 --- a/README.org +++ b/README.org @@ -1829,7 +1829,7 @@ The code in listing [[lst:configure-face-attributes]] source implements those ru #+caption[Configure =face-attributse=]: #+caption: Configure =face-attributes=. -#+label: lst:configure-face-attributes +#+name: lst:configure-face-attributes #+begin_src emacs-lisp (unless noninteractive ;; Set face attributes. @@ -1853,41 +1853,44 @@ the the code in [[lst:my-set-default-face-height]] shows. #+caption[Implement =my-set-default-face-height=]: #+caption: Implement =my-set-default-face-height=. -#+label: lst:my-set-default-face-height +#+name: lst:my-set-default-face-height #+begin_src emacs-lisp - (defun my-set-default-face-height () - "Set the default face height in all current and future frames. + (unless noninteractive + (defun my-set-default-face-height () + "Set the default face height in all current and future frames. Scale all other faces with a height that is a real number." - (interactive) - (let* ((prompt (format "face heigth (%s): " - (face-attribute 'default :height))) - (choices (mapcar #'number-to-string - (number-sequence 50 200 10))) - (height (string-to-number - (completing-read prompt choices nil 'require-match)))) - (message "Setting the height of the default face to %s" height) - (set-face-attribute 'default nil :height height))) + (interactive) + (let* ((prompt (format "face heigth (%s): " + (face-attribute 'default :height))) + (choices (mapcar #'number-to-string + (number-sequence 50 200 10))) + (height (string-to-number + (completing-read prompt choices nil 'require-match)))) + (message "Setting the height of the default face to %s" height) + (set-face-attribute 'default nil :height height)))) #+end_src -Allow swapping fhe foreground and background colors of the default face on all -frames. +Listing [[lst:my-invert-default-face]] allows swapping the foreground and background +colors of the default face on all frames. #+caption[Implement =my-invert-default-face=]: #+caption: Implement =my-invert-default-face=. -#+label: lst:my-invert-default-face +#+name: lst:my-invert-default-face #+begin_src emacs-lisp - (defun my-invert-default-face () - "Invert the default face." - (interactive) - (invert-face 'default)) + (unless noninteractive + (defun my-invert-default-face () + "Invert the default face." + (interactive) + (invert-face 'default))) #+end_src -Enable =rainbow-mode= to colorize color names in buffers for debugging. +Listing [[lst:enable-rainbow-mode]] enables =rainbow-mode= to colorize color names +in buffers for debugging. #+caption[Enable =rainbow-mode=]: #+caption: Enable =rainbow-mode=. -#+label: lst:enable-rainbow-mode +#+name: lst:enable-rainbow-mode #+begin_src emacs-lisp (when (fboundp 'rainbow-mode) (custom-set-variables