doomemacs/modules/editor/objed/config.el
Henrik Lissner 10d0b60f5d
refactor(lib): deprecate pushnew!
In the spirit of 6f40ad5, I'm deprecating this macro because it doesn't
provide enough value to exist and serves only to complicate a casual
reader's understanding of Doom's modules.

Ref: 6f40ad55f5
2026-03-01 18:10:43 -05:00

28 lines
1,015 B
EmacsLisp

;;; editor/objed/config.el -*- lexical-binding: t; -*-
(use-package! objed
:after-call pre-command-hook
:config
;; Prevent undo actions from exiting edit state
(add-to-list 'objed-keeper-commands 'undo-fu-only-undo)
(add-to-list 'objed-keeper-commands 'undo-fu-only-redo)
(defvar +objed--extra-face-remaps nil)
(defadvice! +objed--add-face-remaps-a (&rest _)
"Add extra face remaps when objed activates."
:after 'objed--init
(when (memq 'objed-hl (assq 'hl-line face-remapping-alist))
(push (face-remap-add-relative 'solaire-hl-line-face 'objed-hl)
+objed--extra-face-remaps)))
(defadvice! +objed--remove-face-remaps-a (&rest _)
"Remove extra face remaps when objed de-activates."
:after 'objed--reset
(unless (memq 'objed-hl (assq 'hl-line face-remapping-alist))
(dolist (remap +objed--extra-face-remaps)
(face-remap-remove-relative remap))
(setq +objed--extra-face-remaps nil)))
(unless (modulep! +manual)
(objed-mode +1)))