I'm experimenting with using the highlight-sexp
minor mode to
highlight my current s-expression, since I sometimes get confused
about what I'm modifying with smartparens. The highlight-sexp
background colour is hardcoded by default. I want it to adapt when I
use modus-themes-toggle
. Here's how that works:
(use-package highlight-sexp :quelpa (highlight-sexp :repo "daimrod/highlight-sexp" :fetcher github :version original) :hook (emacs-lisp-mode . highlight-sexp-mode) :config (defun my-hl-sexp-create-overlay () (when (overlayp hl-sexp-overlay) (overlay-put hl-sexp-overlay 'face `(:background ,(car (assoc-default 'bg-inactive (modus-themes--current-theme-palette))))))) (advice-add 'hl-sexp-create-overlay :after 'my-hl-sexp-create-overlay) (advice-add 'modus-themes-toggle :after 'my-hl-sexp-create-overlay))
This is what it looks like:

This is part of my Emacs configuration.