diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-15 13:58:04 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-15 13:58:04 -0500 |
| commit | 856ffe1fbb220997c35696a4700b1630ae95cd1e (patch) | |
| tree | c9147f0cd8b268c59df7468aedf7031c53667f1a | |
| parent | 46c39f329979a105a7aec0909d720090aaa0dc33 (diff) | |
| download | dotemacs-856ffe1fbb220997c35696a4700b1630ae95cd1e.tar.gz dotemacs-856ffe1fbb220997c35696a4700b1630ae95cd1e.zip | |
feat(face-diagnostic): bind cj/describe-face-at-point to C-h F
Bind the diagnostic in the help cluster on C-h F (Face), Craig's pick. It shadows helpful-function, which also sits on C-h F in this config. face-diagnostic is required after help-config, so this binding wins. A test asserts C-h F resolves to the command.
| -rw-r--r-- | modules/face-diagnostic.el | 7 | ||||
| -rw-r--r-- | tests/test-face-diagnostic.el | 6 |
2 files changed, 12 insertions, 1 deletions
diff --git a/modules/face-diagnostic.el b/modules/face-diagnostic.el index 83c81d92..6b1b547f 100644 --- a/modules/face-diagnostic.el +++ b/modules/face-diagnostic.el @@ -8,7 +8,7 @@ ;; Load shape: eager. ;; Eager reason: none; a diagnostic command, a command-loaded deferral candidate. ;; Top-level side effects: defines cj/face-diagnostic-mode and the -;; cj/describe-face-at-point command; binds no global key. +;; cj/describe-face-at-point command; binds it to C-h F in help-map. ;; Runtime requires: seq. ;; Direct test load: yes (the pure core is tested by requiring this module). ;; @@ -447,5 +447,10 @@ See docs/specs/face-font-diagnostic-popup-spec-implemented.org." (cj/--face-diag-render-region (region-beginning) (region-end)) (cj/--face-diag-render (cj/--face-diagnosis-at (point)))))) +;; Bound on C-h F (Face) in the help cluster. This shadows helpful-function, +;; which also sits on C-h F here; face-diagnostic loads after help-config, so +;; this binding wins. +(keymap-set help-map "F" #'cj/describe-face-at-point) + (provide 'face-diagnostic) ;;; face-diagnostic.el ends here diff --git a/tests/test-face-diagnostic.el b/tests/test-face-diagnostic.el index f75d5b67..241425fc 100644 --- a/tests/test-face-diagnostic.el +++ b/tests/test-face-diagnostic.el @@ -322,5 +322,11 @@ (should (string-match-p "Face stack" (buffer-string))))) (when (buffer-live-p buf) (kill-buffer buf)))))) +;;; keybinding + +(ert-deftest test-face-diag-bound-on-c-h-F () + "Normal: loading the module binds C-h F to the diagnostic command." + (should (eq (keymap-lookup help-map "F") 'cj/describe-face-at-point))) + (provide 'test-face-diagnostic) ;;; test-face-diagnostic.el ends here |
