2014-08-07 15:00:22 +00:00
|
|
|
;; Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
|
|
|
;; Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
;;
|
|
|
|
;; Author: Soonho Kong
|
|
|
|
;;
|
|
|
|
|
2014-08-07 17:40:20 +00:00
|
|
|
(require 'cl-lib)
|
|
|
|
|
2015-07-30 18:31:43 +00:00
|
|
|
(defgroup lean nil
|
|
|
|
"Lean Theorem Prover"
|
|
|
|
:prefix "lean-"
|
|
|
|
:group 'languages
|
|
|
|
:link '(url-link :tag "Website" "http://leanprover.github.io")
|
|
|
|
:link '(url-link :tag "Github" "https://github.com/leanprover/lean"))
|
|
|
|
|
|
|
|
(defgroup lean-keybinding nil
|
|
|
|
"Keybindings for lean-mode."
|
|
|
|
:prefix "lean-"
|
|
|
|
:group 'lean)
|
2014-08-07 15:00:22 +00:00
|
|
|
|
2014-08-14 00:02:49 +00:00
|
|
|
(defvar-local lean-default-executable-name
|
2014-08-07 17:40:20 +00:00
|
|
|
(cl-case system-type
|
2014-08-07 15:00:22 +00:00
|
|
|
('gnu "lean")
|
|
|
|
('gnu/linux "lean")
|
|
|
|
('gnu/kfreebsd "lean")
|
|
|
|
('darwin "lean")
|
|
|
|
('ms-dos "lean")
|
|
|
|
('windows-nt "lean.exe")
|
2014-09-01 00:47:53 +00:00
|
|
|
('cygwin "lean.exe"))
|
2014-08-07 17:40:20 +00:00
|
|
|
"Default executable name of Lean")
|
2014-08-07 15:00:22 +00:00
|
|
|
|
|
|
|
(defcustom lean-rootdir nil
|
|
|
|
"Full pathname of lean root directory. It should be defined by user."
|
|
|
|
:group 'lean
|
2014-08-07 17:40:20 +00:00
|
|
|
:type 'string)
|
2014-08-07 15:00:22 +00:00
|
|
|
|
|
|
|
(defcustom lean-executable-name lean-default-executable-name
|
|
|
|
"Name of lean executable"
|
|
|
|
:group 'lean
|
2014-08-07 17:40:20 +00:00
|
|
|
:type 'string)
|
2014-08-07 15:00:22 +00:00
|
|
|
|
2014-08-18 23:10:07 +00:00
|
|
|
(defcustom lean-company-use t
|
|
|
|
"Use company mode for lean."
|
|
|
|
:group 'lean
|
|
|
|
:type 'boolean)
|
|
|
|
|
2014-09-15 03:41:45 +00:00
|
|
|
(defcustom lean-company-type-foreground (face-foreground 'font-lock-keyword-face)
|
|
|
|
"Color of type parameter in auto-complete candidates"
|
|
|
|
:group 'lean
|
|
|
|
:type 'color)
|
|
|
|
|
2014-08-25 18:40:11 +00:00
|
|
|
(defcustom lean-eldoc-use t
|
|
|
|
"Use eldoc mode for lean."
|
|
|
|
:group 'lean
|
|
|
|
:type 'boolean)
|
|
|
|
|
2014-08-27 06:58:02 +00:00
|
|
|
(defcustom lean-eldoc-nay-retry-time 0.3
|
2015-07-30 18:31:43 +00:00
|
|
|
"When eldoc-function had nay, try again after this amount of time."
|
|
|
|
:group 'lean
|
|
|
|
:type 'number)
|
2014-08-25 18:40:11 +00:00
|
|
|
|
2014-09-09 01:42:49 +00:00
|
|
|
(defcustom lean-show-only-type-in-parens t
|
|
|
|
"Show only types of expression in parens if non-nil. Otherwise,
|
2015-07-30 18:31:43 +00:00
|
|
|
show both of expressions and types."
|
|
|
|
:group 'lean
|
|
|
|
:type 'boolean)
|
2014-09-09 01:42:49 +00:00
|
|
|
|
2014-09-03 07:39:54 +00:00
|
|
|
(defcustom lean-server-retry-time 0.1
|
2015-07-30 18:31:43 +00:00
|
|
|
"Retry interval for event-handler"
|
|
|
|
:group 'lean
|
|
|
|
:type 'number)
|
2014-09-03 07:39:54 +00:00
|
|
|
|
2015-01-16 00:48:24 +00:00
|
|
|
(defcustom lean-server-options nil
|
|
|
|
"Additional command line options for the Lean background
|
|
|
|
process used to perform tasks such as type information and
|
|
|
|
perform auto-completion"
|
|
|
|
:group 'lean)
|
|
|
|
|
2014-09-09 01:42:49 +00:00
|
|
|
(defcustom lean-flycheck-use t
|
|
|
|
"Use flycheck for lean."
|
|
|
|
:group 'lean
|
|
|
|
:type 'boolean)
|
|
|
|
|
2014-08-29 09:48:28 +00:00
|
|
|
(defcustom lean-flycheck-checker-name "linja"
|
2014-08-13 22:06:22 +00:00
|
|
|
"lean-flychecker checker name"
|
|
|
|
:group 'lean
|
|
|
|
:type 'string)
|
|
|
|
|
2014-09-09 01:42:49 +00:00
|
|
|
(defcustom lean-flycheck-max-messages-to-display 100
|
|
|
|
"Maximum number of flycheck messages to displaylean-flychecker checker name
|
|
|
|
(Restart required to be effective)"
|
|
|
|
:group 'lean
|
2014-09-30 01:19:08 +00:00
|
|
|
:type 'number)
|
2014-09-09 01:42:49 +00:00
|
|
|
|
2014-09-15 20:02:45 +00:00
|
|
|
(defcustom lean-default-pp-width 120
|
|
|
|
"Width of Lean error/warning messages"
|
2014-09-09 01:42:49 +00:00
|
|
|
:group 'lean
|
2014-09-30 01:19:08 +00:00
|
|
|
:type 'number)
|
|
|
|
|
|
|
|
(defcustom lean-flycheck-msg-width nil
|
|
|
|
"Width of Lean error/warning messages"
|
|
|
|
:group 'lean
|
|
|
|
:type '(choice (const :tag "Let lean-mode automatically detect this" nil)
|
|
|
|
(integer :tag "Specify the value and force lean-mode to use")))
|
2014-09-09 01:42:49 +00:00
|
|
|
|
|
|
|
(defcustom lean-flycheck-checker-options
|
2014-10-08 20:12:16 +00:00
|
|
|
`("--keep-going" ,(format "%d" 999)
|
|
|
|
"--flycheck"
|
2014-09-09 01:42:49 +00:00
|
|
|
"--flycheck-max-messages" ,(format "%d" lean-flycheck-max-messages-to-display))
|
2014-08-13 22:06:22 +00:00
|
|
|
"lean-flychecker checker option"
|
|
|
|
:group 'lean)
|
|
|
|
|
2014-08-07 15:00:22 +00:00
|
|
|
(defcustom lean-delete-trailing-whitespace nil
|
|
|
|
"Set this variable to true to automatically delete trailing
|
|
|
|
whitespace when a buffer is loaded from a file or when it is
|
|
|
|
written."
|
|
|
|
:group 'lean
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
|
|
(defcustom lean-rule-column 100
|
|
|
|
"Specify rule-column."
|
|
|
|
:group 'lean
|
|
|
|
:type '(choice (integer :tag "Columns")
|
2014-09-09 01:42:49 +00:00
|
|
|
(const :tag "Unlimited" nil)))
|
2014-08-07 15:00:22 +00:00
|
|
|
|
2014-08-07 18:57:46 +00:00
|
|
|
(defcustom lean-rule-color "#cccccc"
|
|
|
|
"Color used to draw the fill-column rule"
|
|
|
|
:group 'fill-column-indicator
|
|
|
|
:tag "Fill-column rule color"
|
|
|
|
:type 'color)
|
|
|
|
|
2014-08-07 15:00:22 +00:00
|
|
|
(defcustom lean-show-rule-column-method nil
|
|
|
|
"If enabled, it highlights column"
|
|
|
|
:group 'lean
|
|
|
|
:type '(choice (const :tag "Disabled" nil)
|
|
|
|
(const :tag "Vertical Line" vline)
|
|
|
|
;;(const :tag "Whole Lines" lines)
|
|
|
|
;;(const :tag "Only Beyond lean-rule-column" lines-tail)
|
|
|
|
))
|
|
|
|
|
2014-09-15 23:40:11 +00:00
|
|
|
(defcustom lean-debug-mode-line '(:eval (lean-debug-mode-line-status-text))
|
|
|
|
"Mode line lighter for Lean debug mode."
|
|
|
|
:group 'lean
|
|
|
|
:type 'sexp
|
|
|
|
:risky t)
|
|
|
|
|
2014-10-14 16:27:25 +00:00
|
|
|
(defcustom lean-show-type-add-to-kill-ring nil
|
|
|
|
"If it is non-nil, add the type information to the kill-ring so
|
|
|
|
that user can yank(paste) it later. By default, it's
|
|
|
|
false (nil)."
|
|
|
|
:group 'lean
|
|
|
|
:type 'boolean)
|
|
|
|
|
2014-10-28 21:05:41 +00:00
|
|
|
(defcustom lean-show-proofstate-in-minibuffer nil
|
|
|
|
"Set this variable to true to show proof state at minibuffer."
|
|
|
|
:group 'lean
|
|
|
|
:type 'boolean)
|
|
|
|
|
feat(emacs/lean-info): add goal visualization options 'lean-proofstate-display-style'
lean-proofstate-display-style:
- 'show-all: Show all goals
a : Prop,
b : Prop,
c : Prop,
H_1 : a,
H_2 : b,
H_3 : c
⊢ id a
a : Prop,
b : Prop,
c : Prop,
H_1 : a,
H_2 : b,
H_3 : c
⊢ b ∧ c
- 'show-first: Show only the first
a : Prop,
b : Prop,
c : Prop,
H_1 : a,
H_2 : b,
H_3 : c
⊢ id a
- 'show-first-and-other-conclusions: Show the first goal, and the
conclusions of all other goals (DEFAULT OPTION)
a : Prop,
b : Prop,
c : Prop,
H_1 : a,
H_2 : b,
H_3 : c
⊢ id a
⊢ b ∧ c
Close #279
2014-10-30 00:05:07 +00:00
|
|
|
(defcustom lean-proofstate-display-style 'show-first-and-other-conclusions
|
|
|
|
"Choose how to display proof state in *lean-info* buffer."
|
|
|
|
:group 'lean
|
|
|
|
:type '(choice (const :tag "Show all goals" show-all)
|
|
|
|
(const :tag "Show only the first" show-first)
|
|
|
|
(const :tag "Show the first goal, and the conclusions of all other goals" show-first-and-other-conclusions)))
|
|
|
|
|
2015-07-30 18:31:43 +00:00
|
|
|
(defcustom lean-follow-changes t
|
|
|
|
"If it's nil, we don't set up after-change-functions and
|
|
|
|
before-change-functions to update the changes to lean-server.
|
|
|
|
A usage is to batch-process .org files to .html files"
|
|
|
|
:group 'lean
|
|
|
|
:type 'boolean)
|
2014-10-30 06:57:54 +00:00
|
|
|
|
2015-07-29 01:10:46 +00:00
|
|
|
(defcustom lean-time-to-restart-server 1
|
|
|
|
"After lean-time-to-kill-server passed, we restart lean-server if
|
2015-07-30 18:31:43 +00:00
|
|
|
the all jobs in the queue are not process."
|
|
|
|
:group 'lean
|
|
|
|
:type 'number)
|
2015-07-29 01:10:46 +00:00
|
|
|
|
2015-07-30 18:31:43 +00:00
|
|
|
(defcustom lean-keybinding-std-exe1 (kbd "C-c C-x")
|
|
|
|
"Lean Keybinding for std-exe #1"
|
|
|
|
:group 'lean-keybinding :type 'key-sequence)
|
|
|
|
(defcustom lean-keybinding-std-exe2 (kbd "C-c C-l")
|
|
|
|
"Lean Keybinding for std-exe #2"
|
|
|
|
:group 'lean-keybinding :type 'key-sequence)
|
|
|
|
(defcustom lean-keybinding-show-key (kbd "C-c C-k")
|
|
|
|
"Lean Keybinding for show-key"
|
|
|
|
:group 'lean-keybinding :type 'key-sequence)
|
|
|
|
(defcustom lean-keybinding-set-option (kbd "C-c C-o")
|
|
|
|
"Lean Keybinding for set-option"
|
|
|
|
:group 'lean-keybinding :type 'key-sequence)
|
|
|
|
(defcustom lean-keybinding-eval-cmd (kbd "C-c C-e")
|
|
|
|
"Lean Keybinding for eval-cmd"
|
|
|
|
:group 'lean-keybinding :type 'key-sequence)
|
|
|
|
(defcustom lean-keybinding-show-type (kbd "C-c C-t")
|
|
|
|
"Lean Keybinding for show-type"
|
|
|
|
:group 'lean-keybinding :type 'key-sequence)
|
|
|
|
(defcustom lean-keybinding-fill-placeholder (kbd "C-c C-f")
|
|
|
|
"Lean Keybinding for fill-placeholder"
|
|
|
|
:group 'lean-keybinding :type 'key-sequence)
|
|
|
|
(defcustom lean-keybinding-server-restart-process (kbd "C-c C-r")
|
|
|
|
"Lean Keybinding for server-restart-process"
|
|
|
|
:group 'lean-keybinding :type 'key-sequence)
|
|
|
|
(defcustom lean-keybinding-find-tag (kbd "M-.")
|
|
|
|
"Lean Keybinding for find-tag"
|
|
|
|
:group 'lean-keybinding :type 'key-sequence)
|
|
|
|
(defcustom lean-keybinding-tab-indent-or-complete (kbd "TAB")
|
|
|
|
"Lean Keybinding for tab-indent-or-complete"
|
|
|
|
:group 'lean-keybinding :type 'key-sequence)
|
|
|
|
(defcustom lean-keybinding-lean-show-goal-at-pos (kbd "C-c C-g")
|
|
|
|
"Lean Keybinding for show-goal-at-pos"
|
|
|
|
:group 'lean-keybinding :type 'key-sequence)
|
|
|
|
(defcustom lean-keybinding-lean-show-id-keyword-info (kbd "C-c C-p")
|
|
|
|
"Lean Keybinding for show-id-keyword-info"
|
|
|
|
:group 'lean-keybinding :type 'key-sequence)
|
2014-08-07 15:00:22 +00:00
|
|
|
(provide 'lean-settings)
|