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")
|
|
|
|
|
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-09-15 20:02:45 +00:00
|
|
|
`("--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-08-07 15:00:22 +00:00
|
|
|
(provide 'lean-settings)
|