solarized-emacs

a fork of Bozhidar Batsov's solarized-emacs
git clone https://git.trogloxene.org/solarized-emacs.git
Log | Files | Refs | README

commit 5d136736f76c85a83fef737d10ecd32af4d493fd
parent ac09b782f26936d72f0cf1bbe1ff8d589ca49b04
Author: Ilgiz Mustafin <imustafin@users.noreply.github.com>
Date:   Sat, 22 Feb 2025 15:29:43 +0100

Add option to highlight numbers (#451)


Diffstat:
MREADME.md | 3+++
Msolarized-faces.el | 3++-
Msolarized.el | 7+++++++
3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md @@ -106,6 +106,9 @@ elisp code: (setq solarized-height-plus-3 1.0) (setq solarized-height-plus-4 1.0) +;; Highlight all numbers +(setq solarized-highlight-numbers t) + ``` Note that these need to be set **before** `load-theme` is invoked for Solarized. diff --git a/solarized-faces.el b/solarized-faces.el @@ -236,6 +236,7 @@ ((,class (:foreground ,base01 :slant ,s-maybe-italic)))) `(font-lock-comment-face ((,class (:foreground ,base01)))) `(font-lock-constant-face ((,class (:foreground ,blue :weight bold)))) + `(font-lock-number-face ((,class (:foreground ,(if solarized-highlight-numbers violet 'unspecified))))) `(font-lock-doc-face ((,class (:foreground ,(if solarized-distinct-doc-face violet cyan) :slant ,s-maybe-italic)))) `(font-lock-function-name-face ((,class (:foreground ,blue)))) @@ -919,7 +920,7 @@ `(highlight-indentation-face ((,class (:background ,base02)))) `(highlight-indentation-current-column-face((,class (:background ,base02)))) ;;;;; highlight-numbers - `(highlight-numbers-number ((,class (:foreground ,violet :bold nil)))) + `(highlight-numbers-number ((,class (:inherit font-lock-number-face)))) ;;;;; highlight-symbol `(highlight-symbol-face ((,class (:foreground ,magenta)))) ;;;;; hl-line-mode diff --git a/solarized.el b/solarized.el @@ -52,6 +52,13 @@ Related discussion: https://github.com/bbatsov/solarized-emacs/issues/158" :type 'boolean :group 'solarized) +(defcustom solarized-highlight-numbers nil + "Highlight all numbers. +Applies color to `font-lock-number-face' and `highlight-numbers' mode. +Many tree-sitter based modes use `font-lock-number-face'." + :type 'boolean + :group 'solarized) + (defcustom solarized-use-variable-pitch t "Use variable pitch face for some headings and titles." :type 'boolean