Start fleshing out the appearance section

This commit is contained in:
Gerard Vermeulen 2021-12-28 08:42:19 +01:00
parent 424322a129
commit f19fcfd025

View File

@ -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