Handle also faces after loading in memory
This commit is contained in:
parent
23a7b713df
commit
389de6e59c
61
README.org
61
README.org
@ -263,43 +263,41 @@ the ~custom-file~ as [[info:emacs#Saving Customizations][saving customizations (
|
|||||||
:END:
|
:END:
|
||||||
|
|
||||||
Section [[#sec:text-faces-or-styles][text faces or styles (info)]] tells that this setup does not use theming.
|
Section [[#sec:text-faces-or-styles][text faces or styles (info)]] tells that this setup does not use theming.
|
||||||
However, it relies on shadowing the definition of faces in order to improve
|
However, in order to improve visibility, it relies on:
|
||||||
visibility. The last item in the page on [[https://orgmode.org/worg/org-contrib/babel/examples/fontify-src-code-blocks.html#org5c4406f][fontifying source code blocks]]
|
1. Tweaking faces in memory after loading as in listing
|
||||||
describes this method. Section [[#sec:text-faces-or-styles][text faces or styles (info)]] also defines the
|
[[lst:tweak-faces-faces-after]].
|
||||||
function src_emacs-lisp{(my-invert-default-face)} to toggle between a dark and a
|
2. Shadowing the definition of faces before loading as in listing
|
||||||
light background.
|
[[lst:tweak-org-faces-before]] and [[lst:tweak-sh-script-faces-before]]. The last
|
||||||
|
item in the page on [[https://orgmode.org/worg/org-contrib/babel/examples/fontify-src-code-blocks.html#org5c4406f][fontifying Org mode source code blocks]] describes this
|
||||||
|
method.
|
||||||
|
Section [[#sec:text-faces-or-styles][text faces or styles (info)]] also defines the function
|
||||||
|
src_emacs-lisp{(my-invert-default-face)} to toggle between a dark and a light
|
||||||
|
background.
|
||||||
|
|
||||||
#+caption[Improve the visibility of faces in =faces.el=]:
|
#+caption[Improve the visibility of faces in =faces.el=]:
|
||||||
#+caption: Improve the visibility of faces in =faces.el=.
|
#+caption: Improve the visibility of faces in =faces.el=.
|
||||||
#+name: lst:tweak-faces-faces-early
|
#+name: lst:tweak-faces-faces-after
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
;; Shadow the definition in faces.el:
|
(defun tweak-region-face-background-color ()
|
||||||
(defface region
|
(when (featurep 'gtk)
|
||||||
'((((class color) (min-colors 88) (background dark))
|
(set-face-attribute
|
||||||
:background "blue3" :extend t)
|
'region nil
|
||||||
(((class color) (min-colors 88) (background light) (type gtk))
|
:background (cdr (assoc (face-attribute 'default :background)
|
||||||
:distant-foreground "gtk_selection_fg_color"
|
'(("white" . "LightGoldenrod2")
|
||||||
:background "LightGoldenrod2" :extend t)
|
("black" . "blue3")))))))
|
||||||
(((class color) (min-colors 88) (background light) (type ns))
|
|
||||||
:distant-foreground "ns_selection_fg_color"
|
(tweak-region-face-background-color)
|
||||||
:background "ns_selection_bg_color" :extend t)
|
#+end_src
|
||||||
(((class color) (min-colors 88) (background light))
|
|
||||||
:background "LightGoldenrod2" :extend t)
|
#+begin_src emacs-lisp
|
||||||
(((class color) (min-colors 16) (background dark))
|
(cdr (assoc (face-attribute 'default :background)
|
||||||
:background "blue3" :extend t)
|
'(("white" . "LightGoldenrod2")
|
||||||
(((class color) (min-colors 16) (background light))
|
("black" . "blue3"))))
|
||||||
:background "LightGoldenrod2" :extend t)
|
|
||||||
(((class color) (min-colors 8))
|
|
||||||
:background "blue" :foreground "white" :extend t)
|
|
||||||
(((type tty) (class mono))
|
|
||||||
:inverse-video t)
|
|
||||||
(t :background "gray" :extend t))
|
|
||||||
"My basic face for highlighting the region.")
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+caption[Improve the visibility of faces in =org-faces.el=]:
|
#+caption[Improve the visibility of faces in =org-faces.el=]:
|
||||||
#+caption: Improve the visibility of faces in =org-faces.el=.
|
#+caption: Improve the visibility of faces in =org-faces.el=.
|
||||||
#+name: lst:tweak-org-faces-early
|
#+name: lst:tweak-org-faces-before
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
;; Shadow the definition in org-faces.el:
|
;; Shadow the definition in org-faces.el:
|
||||||
(defface org-block
|
(defface org-block
|
||||||
@ -326,7 +324,7 @@ light background.
|
|||||||
|
|
||||||
#+caption[Improve the visibility of faces in =sh-script.el=]:
|
#+caption[Improve the visibility of faces in =sh-script.el=]:
|
||||||
#+caption: Improve the visibility of faces in =sh-script.el=.
|
#+caption: Improve the visibility of faces in =sh-script.el=.
|
||||||
#+name: lst:tweak-sh-script-faces-early
|
#+name: lst:tweak-sh-script-faces-before
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
;; Shadow the definition in sh-script.el:
|
;; Shadow the definition in sh-script.el:
|
||||||
(defface sh-heredoc
|
(defface sh-heredoc
|
||||||
@ -2665,7 +2663,8 @@ of the default face on all frames.
|
|||||||
(defun my-invert-default-face ()
|
(defun my-invert-default-face ()
|
||||||
"Invert the default face."
|
"Invert the default face."
|
||||||
(interactive)
|
(interactive)
|
||||||
(invert-face 'default)))
|
(invert-face 'default)
|
||||||
|
(tweak-region-face-background-color)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** [[https://jblevins.org/log/rainbow-mode][Visualize color codes and names]]
|
** [[https://jblevins.org/log/rainbow-mode][Visualize color codes and names]]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user