From 0f77cab1b303bd23e84a48952834d7d607c089bd Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Tue, 6 Sep 2022 11:21:51 +1000 Subject: Adding hcel minor mode and find references in outline mode --- lisp/hcel-source.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lisp/hcel-source.el') diff --git a/lisp/hcel-source.el b/lisp/hcel-source.el index 29efab0..783436b 100644 --- a/lisp/hcel-source.el +++ b/lisp/hcel-source.el @@ -365,4 +365,23 @@ May cause error if the identifier has exact location." (t (error "unimplemented: %s" (hcel-location-tag location-info))))))) +;; hcel-minor mode +(defvar hcel-minor-major-modes + '(hcel-outline-mode hcel-ids-mode eldoc-mode) + "Major modes where hcel-minor mode can live in.") + +(defvar hcel-minor-mode-map + (let ((kmap (make-sparse-keymap))) + (define-key kmap (kbd "M-?") 'hcel-minor-find-references-at-point) + kmap)) + +(define-minor-mode hcel-minor-mode + "A minor mode for exploring haskell codebases." + :after-hook + (if hcel-minor-mode + (if (not (memq major-mode hcel-minor-major-modes)) + (error "Not in one of the following modes: %s" + (string-join (mapcar 'prin1-to-string hcel-minor-major-modes) + ", "))))) + (provide 'hcel-source) -- cgit v1.2.3