aboutsummaryrefslogtreecommitdiff
path: root/lisp/hcel-source.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/hcel-source.el')
-rw-r--r--lisp/hcel-source.el19
1 files changed, 19 insertions, 0 deletions
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)