From 686ac237490bae44a2270e32e22bb9b47d5ff34c Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Sun, 9 Jun 2024 11:54:44 +0200 Subject: [PATCH] Move `defface' forms to toplevel --- README.org | 76 ++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/README.org b/README.org index bb33f53..84b6359 100644 --- a/README.org +++ b/README.org @@ -506,20 +506,19 @@ Scale all other faces with a height that is a real number." #+caption: Shadow Org font-lock faces to improve the readability. #+name: lst:shadow-org-font-lock-faces #+begin_src emacs-lisp -n -(with-eval-after-load 'emacs - ;; Shadow two definitions in org-faces.el: - (defface org-block - ;; https://emacs.stackexchange.com/a/9604 answers: - ;; How to override a defined face for light and dark backgrounds? - `((((background dark)) - :inherit (fixed-pitch) - ,@(and (>= emacs-major-version 27) '(:extend t)) - :background "#444444") - (t - :inherit (fixed-pitch) - ,@(and (>= emacs-major-version 27) '(:extend t)) - :background "#FFFFD0")) - "My face used for text inside blocks. +;; Shadow two definitions in org-faces.el: +(defface org-block + ;; https://emacs.stackexchange.com/a/9604 answers: + ;; How to override a defined face for light and dark backgrounds? + `((((background dark)) + :inherit (fixed-pitch) + ,@(and (>= emacs-major-version 27) '(:extend t)) + :background "#444444") + (t + :inherit (fixed-pitch) + ,@(and (>= emacs-major-version 27) '(:extend t)) + :background "#FFFFD0")) + "My face used for text inside blocks. It is always used for source blocks. You can refine what face should be used depending on the source block language by setting, @@ -528,38 +527,37 @@ should be used depending on the source block language by setting, When `org-fontify-quote-and-verse-blocks' is not nil, text inside verse and quote blocks are fontified using the `org-verse' and `org-quote' faces, which inherit from `org-block'." - :group 'org-faces) + :group 'org-faces) - (defface org-table - ;; https://emacs.stackexchange.com/a/9604 answers: - ;; How to override a defined face for light and dark backgrounds? - `((((background dark)) - :inherit (fixed-pitch) - ,@(and (>= emacs-major-version 27) '(:extend t)) - :background "#444444") - (t - :inherit (fixed-pitch) - ,@(and (>= emacs-major-version 27) '(:extend t)) - :background "#FFFFD0")) - "My face for tables." - :group 'org-faces)) +(defface org-table + ;; https://emacs.stackexchange.com/a/9604 answers: + ;; How to override a defined face for light and dark backgrounds? + `((((background dark)) + :inherit (fixed-pitch) + ,@(and (>= emacs-major-version 27) '(:extend t)) + :background "#444444") + (t + :inherit (fixed-pitch) + ,@(and (>= emacs-major-version 27) '(:extend t)) + :background "#FFFFD0")) + "My face for tables." + :group 'org-faces) #+end_src #+caption[Shadow Emacs font-lock faces to improve the readability]: #+caption: Shadow Emacs font-lock faces to improve the readability. #+name: lst:shadow-emacs-font-lock-faces #+begin_src emacs-lisp -n -(with-eval-after-load 'emacs - ;; Shadow one definition in sh-script.el: - (defface sh-heredoc - '((((class color) (background dark)) - (:foreground "yellow")) - (((class color) (background light)) - (:foreground "magenta")) - (t - (:weight bold))) - "My face to show a here-document." - :group 'sh-indentation)) +;; Shadow one definition in sh-script.el: +(defface sh-heredoc + '((((class color) (background dark)) + (:foreground "yellow")) + (((class color) (background light)) + (:foreground "magenta")) + (t + (:weight bold))) + "My face to show a here-document." + :group 'sh-indentation) (require 'org) #+end_src