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)
|
|
|
|
|
2014-08-07 15:00:22 +00:00
|
|
|
(defgroup lean nil "Lean mode" :prefix 'lean :group 'languages)
|
|
|
|
|
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
|
2014-08-25 18:40:11 +00:00
|
|
|
"When eldoc-function had nay, try again after this amount of time.")
|
|
|
|
|
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,
|
|
|
|
show both of expressions and types.")
|
|
|
|
|
2014-09-03 07:39:54 +00:00
|
|
|
(defcustom lean-server-retry-time 0.1
|
|
|
|
"Retry interval for event-handler")
|
|
|
|
|
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)))
|
|
|
|
|
2014-10-30 06:57:54 +00:00
|
|
|
(defcustom lean-follow-changes 't
|
|
|
|
"Disable this if we don't need to keep track of the changes. A usage
|
|
|
|
is to batch-process .org files to .html files")
|
|
|
|
|
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
|
|
|
|
the all jobs in the queue are not process.")
|
|
|
|
|
2014-08-07 15:00:22 +00:00
|
|
|
(provide 'lean-settings)
|