doomemacs/modules/editor/objed/config.el
Henrik Lissner ad6a3d0f33
refactor: deprecate featurep! for modulep!
featurep! will be renamed modulep! in the future, so it's been
deprecated. They have identical interfaces, and can be replaced without
issue.

featurep! was never quite the right name for this macro. It implied that
it had some connection to featurep, which it doesn't (only that it was
similar in purpose; still, Doom modules are not features). To undo such
implications and be consistent with its namespace (and since we're
heading into a storm of breaking changes with the v3 release anyway),
now was the best opportunity to begin the transition.
2022-08-14 20:43:35 +02:00

27 lines
972 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
(pushnew! objed-keeper-commands 'undo-fu-only-undo '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)))