lean2/src/emacs
Soonho Kong a1a14cf425 fix(emacs/lean-info): handle when both identifier and symbol info exist
Example: library/data/int/basic.lean file (398, 22)

The '+' symbol is attached with both of identifier info and symbol info

-- SYMBOL|398|22
+
-- ACK
-- IDENTIFIER|398|22
int.add
-- ACK
2014-08-26 22:32:57 -07:00
..
CMakeLists.txt feat(emacs): include lean-mode Emacs files in the distribution 2014-01-09 11:50:07 -08:00
lean-cmd.el feat(emacs/lean-cmd): add cmd-to-string for SET/EVAL 2014-08-26 16:22:31 -07:00
lean-company.el feat(emacs/README.md): add elisp which installs required packages 2014-08-26 17:16:16 -07:00
lean-debug.el feat(emacs): implement lean-show-type 2014-08-13 17:02:49 -07:00
lean-flycheck.el refactor(emacs/lean-flycheck): remove lean-flycheck-initialized 2014-08-26 16:22:31 -07:00
lean-info.el fix(emacs/lean-info): handle when both identifier and symbol info exist 2014-08-26 22:32:57 -07:00
lean-input.el feat(library/hott): add basic HoTT definitions and theorems 2014-07-15 21:46:33 +01:00
lean-mode.el feat(emacs/lean-mode): clean up old generic-mode 2014-08-26 17:16:16 -07:00
lean-server.el feat(emacs/lean-server): handle signal 2014-08-26 17:16:16 -07:00
lean-settings.el feat(emacs/lean-settings): add eldoc-use and eldoc-nay-retry-time 2014-08-26 16:22:31 -07:00
lean-syntax.el feat(emacs/lean-syntax): support multi-line comments /- ... -/ 2014-08-26 16:22:30 -07:00
lean-tags.el feat(emacs/lean-tags): try to find TAGS file upward and use it without asking 2014-08-26 16:22:32 -07:00
lean-type.el feat(emacs/lean-type): implement lean-set-option and lean-eval-cmd 2014-08-26 16:22:31 -07:00
lean-util.el feat(emacs/lean-tags): try to find TAGS file upward and use it without asking 2014-08-26 16:22:32 -07:00
lean-variable.el refactor(lean-variable): init server-buffer and current-file-name with nil 2014-08-26 16:22:31 -07:00
README.md feat(emacs/README.md): add elisp which installs required packages 2014-08-26 17:16:16 -07:00

lean-mode

Emacs mode for lean theorem prover

Requirement

lean-mode requires Emacs 24 and following (optional) packages which can be installed via M-x package-install.

To install them, you need to have MELPA in your package-archives. You can add it by evaluating the following elisp code:

(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/packages/") t)

Put the following elisp code on your emacs setup:

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(when (not package-archive-contents) (package-refresh-contents))

;; Install required packages for lean-mode
(defvar lean-mode-required-packages
  '(company dash dash-functional flycheck whitespace-cleanup-mode fill-column-indicator))
(dolist (p lean-mode-required-packages)
  (when (not (package-installed-p p))
    (package-install p)))

;; Set up lean-root path
(setq lean-rootdir "~/projects/lean")
(setq-local lean-emacs-path
            (concat (file-name-as-directory lean-rootdir)
                    (file-name-as-directory "src")
                    "emacs"))
(add-to-list 'load-path (expand-file-name lean-emacs-path))
(require 'lean-mode)

;; Customization for lean-mode
(customize-set-variable 'lean-delete-trailing-whitespace t)
(customize-set-variable 'lean-flycheck-use t)
(customize-set-variable 'lean-eldoc-use t)

Key Bindings

Key Function
C-c C-x lean-std-exe
C-c C-l lean-std-exe
C-c C-t lean-eldoc-documentation-function
C-c C-f lean-fill-placeholder
M-. lean-find-tag
TAB lean-complete-tag
C-c C-o lean-set-option
C-c C-e lean-eval-cmd