diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-16 14:50:29 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-16 14:50:29 -0500 |
| commit | 9b41fb33ea92420e372bc702004a04825555f16b (patch) | |
| tree | bd9a122133b085872d3f1fbe3fdec2d4d68174ed /modules/system-utils.el | |
| parent | 43872c7c20e64098ee19a05727e651be6955b9a1 (diff) | |
| download | dotemacs-9b41fb33ea92420e372bc702004a04825555f16b.tar.gz dotemacs-9b41fb33ea92420e372bc702004a04825555f16b.zip | |
refactor(system-utils): remove the *scratch* background tint
I dropped the buffer-local face remap that lightened the *scratch* background 5% above the theme default. Scratch now uses the plain theme background like every other buffer. The startup hook still moves the cursor to end-of-scratch. Only the tint call, its two helpers, the defcustom, the color require, and the now-orphaned test go.
Diffstat (limited to 'modules/system-utils.el')
| -rw-r--r-- | modules/system-utils.el | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/modules/system-utils.el b/modules/system-utils.el index b3e038ef0..7cf958674 100644 --- a/modules/system-utils.el +++ b/modules/system-utils.el @@ -157,39 +157,12 @@ detached from Emacs." ;; Set scratch buffer to org-mode (setopt initial-major-mode 'org-mode) -;; Tint the *scratch* background a shade lighter than the default so it reads -;; as the scratch buffer at a glance. Buffer-local face remap, recomputed from -;; whatever theme is loaded. -(require 'color) - -(defcustom cj/scratch-background-lighten 5 - "Percent to lighten the *scratch* background above the default background. -Aesthetic; tune to taste." - :type 'integer - :group 'convenience) - -(defun cj/--scratch-lightened-background (bg) - "Return BG lightened by `cj/scratch-background-lighten' percent. -Return nil when BG is not a usable color string (e.g. `unspecified')." - (when (and (stringp bg) (color-name-to-rgb bg)) - (color-lighten-name bg cj/scratch-background-lighten))) - -(defun cj/scratch-apply-background () - "Remap the *scratch* buffer background a shade lighter than the default." - (when (get-buffer "*scratch*") - (with-current-buffer "*scratch*" - (let ((lighter (cj/--scratch-lightened-background - (face-attribute 'default :background nil t)))) - (when lighter - (face-remap-add-relative 'default :background lighter)))))) - -;; Move cursor to end of scratch buffer on startup, and tint its background +;; Move cursor to end of scratch buffer on startup (add-hook 'emacs-startup-hook (lambda () (when (get-buffer "*scratch*") (with-current-buffer "*scratch*" - (goto-char (point-max)))) - (cj/scratch-apply-background))) + (goto-char (point-max)))))) ;;; --------------------------------- Dictionary -------------------------------- |
