feat(emacs/lean-mode): add imenu support

Close #97
This commit is contained in:
Soonho Kong 2014-08-31 17:47:53 -07:00
parent 4eb8a9b192
commit b460c02017
2 changed files with 25 additions and 4 deletions

View file

@ -52,7 +52,6 @@
(interactive)
(lean-execute))
(defun lean-check-expansion ()
(interactive)
(save-excursion
@ -88,6 +87,26 @@
("def" "definition")
("th" "theorem")))
(defvar lean-mode-map (make-sparse-keymap)
"Keymap used in Lean mode")
(easy-menu-define lean-mode-menu lean-mode-map
"Menu for the Lean major mode"
`("Lean"
["Execute lean" lean-execute t]
"-----------------"
["Show type info" lean-eldoc-documentation-function lean-eldoc-use]
["Fill a placeholder" lean-fill-placeholder (looking-at (rx symbol-start "_"))]
["Find tag at point" lean-find-tag t]
"-----------------"
["Run flycheck" flycheck-compile lean-flycheck-use]
["List of errors" flycheck-list-errors lean-flycheck-use]
"-----------------"
["Kill lean process" lean-server-kill-process t]
["Restart lean process" lean-server-restart-process t]
"-----------------"
["Customize lean-mode" (customize-group 'lean) t]))
(defconst lean-hooks-alist
'(
;; Handle events that may start automatic syntax checks
@ -149,7 +168,10 @@ enabled and disabled respectively.")
;; Automode List
;;;###autoload
(define-derived-mode lean-mode prog-mode "Lean"
"Major mode for Lean"
"Major mode for Lean
\\{lean-mode-map}
Invokes `lean-mode-hook'.
"
:syntax-table lean-syntax-table
:abbrev-table lean-abbrev-table
:group 'lean

View file

@ -16,8 +16,7 @@
('darwin "lean")
('ms-dos "lean")
('windows-nt "lean.exe")
('cygwin "lean.exe") ;; TODO(soonhok): check this
)
('cygwin "lean.exe"))
"Default executable name of Lean")
(defcustom lean-rootdir nil