Commit graph

514 commits

Author SHA1 Message Date
Soonho Kong
5ad312f6ce test(emacs/lean-info-test): add test cases for goal visualization
[skip ci]
2014-10-29 17:09:08 -07:00
Soonho Kong
6973d3e7aa 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-29 17:08:55 -07:00
Leonardo de Moura
b0a7888346 fix(emacs/lean-flycheck): should accept error messages with empty lines 2014-10-29 16:51:06 -07:00
Soonho Kong
854e7ba1be fix(emacs/lean-type): improve displaying proof state messages
- Do not repeat the same message
 - Do not display the empty message
 - Do not display "[stale]" for proof states
2014-10-29 16:02:48 -07:00
Soonho Kong
99f85c8dbc fix(emacs/lean-info): proofstate display problem 2014-10-29 14:33:05 -07:00
Soonho Kong
fe710ac6d0 test(emacs/lean-info-test): add test for proofstate info 2014-10-29 14:33:05 -07:00
Soonho Kong
17455d191b feat(emacs/lean-mode): add lean-info-mode for "*lean-info*" buffer 2014-10-29 14:33:05 -07:00
Soonho Kong
12824c3e27 fix(emacs/lean-syntax): fix Type1, Type2 highlight 2014-10-29 14:33:05 -07:00
Soonho Kong
b0e249ce63 feat(emacs/lean-type): output INFO to *lean-info* buffer in addition to minibuffer
Close #260
2014-10-29 14:33:05 -07:00
Soonho Kong
0d8658d762 feat(emacs/lean-settings): add lean-show-proofstate-in-minibuffer option 2014-10-29 14:33:05 -07:00
Soonho Kong
53f79ec9c2 feat(emacs): extract proof state information attached to "," 2014-10-29 14:33:05 -07:00
Soonho Kong
fdf5f3ff8a feat(emacs/lean-info): add PROOF_STATE info
Close #259
2014-10-29 14:33:05 -07:00
Soonho Kong
cb83eca2f3 feat(emacs/lean-input): add lean-input-export-translations 2014-10-29 14:33:05 -07:00
Leonardo de Moura
e22eb3543c feat(library/tactic): add whnf tactic, closes #270 2014-10-28 23:18:49 -07:00
Leonardo de Moura
08e8161243 feat(emacs/lean-syntax): add 'eassumption' highlight 2014-10-26 15:45:26 -07:00
Leonardo de Moura
50948be66b fix(emacs/lean-syntax): syntax highlight for composite names in declarations 2014-10-26 09:27:17 -07:00
Leonardo de Moura
79d0347721 feat(library/tactic): add generalize tactic, closes #34
Remark: the intros tactic has been added in a different commit: 7d0100a340
2014-10-23 22:40:15 -07:00
Soonho Kong
04b4e36701 doc(emacs/README.md): fix typo
[skip ci]
2014-10-23 14:32:36 -07:00
Leonardo de Moura
c50227ea6e feat(library/tactic): change apply tactic semantics: goals are not reversed; and dependent arguments are not included
This commit also adds the tactic rapply that corresponds to the previous
semantics we have been using.
2014-10-22 18:11:09 -07:00
Leonardo de Moura
e95c7c5f70 refactor(library/tactic/rename_tactic): use new 'tactic.expr' to implement 'intro/intros' tactic
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-10-22 17:29:50 -07:00
Leonardo de Moura
bb953b80aa feat(frontends/lean): reserve notation, closes #95 2014-10-21 15:39:47 -07:00
Leonardo de Moura
92acd9affc chore(emacs): do not highlight arbitrary types 2014-10-20 19:17:02 -07:00
Leonardo de Moura
7d0100a340 feat(library/tactic): add 'intros' tactic 2014-10-20 15:26:16 -07:00
Soonho Kong
4143716311 fix(emacs/lean-util): fix lean-path-list to only include existing dirs
Fix #246
2014-10-14 20:48:56 -07:00
Leonardo de Moura
e6606ef2ac feat(library/tactic): add 'rename' hypothesis tactic 2014-10-14 18:19:34 -07:00
Soonho Kong
343a9a690e feat(emacs/lean-type): add lean-show-type-add-to-kill-ring option
If a customization option 'lean-show-type-add-to-kill-ring' is non-nil
and a user runs 'lean-show-type' by explicitly typing 'C-c C-t',
lean-mode saves the displayed type information message into kill-ring
, which can be pasted by yank (C-y) command.

Close #245
2014-10-14 09:27:25 -07:00
Leonardo de Moura
ab90a350b3 fix(emacs/lean-syntax): syntax highlight for declarations with explicit universes 2014-10-13 06:52:36 -07:00
Leonardo de Moura
6a40f80612 fix(emacs/lean-syntax): glitch on syntax highlight 2014-10-11 10:56:28 -07:00
Leonardo de Moura
402a351937 feat(frontends/lean): add 'universes' command 2014-10-10 08:45:59 -07:00
Floris van Doorn
1612070350 feat(lean-input.el): add some new notation 2014-10-08 23:14:44 -07:00
Soonho Kong
24227f0e51 feat(emacs/lean-settings): enable linja '--keep-going' option
Fix #234
2014-10-08 13:12:16 -07:00
Soonho Kong
b6d475c3ac fix(emacs/lean-project): use better prompt message for lean-project-create 2014-10-08 13:04:31 -07:00
Soonho Kong
d542771ba1 doc(emacs/README.md): add 'Unicode' subsection in 'Known Issues' section 2014-10-08 10:43:58 -07:00
Soonho Kong
8c0f01ac34 doc(emacs/README.md): do package-refresh-contents only once
Close #233
2014-10-08 10:41:52 -07:00
Leonardo de Moura
d8572e249d feat(frontends/lean/builtin_cmds): add 'print classes' command 2014-10-07 17:30:57 -07:00
Soonho Kong
78e9854bae fix(emacs): support tabs in a file
Fix #226
2014-10-07 14:42:35 -07:00
Soonho Kong
013cd5640e fix(CMakeLists.txt): rename EMACS_LIB to EMACS_LISP_DIR (default: share/eamcs/site-lisp/lean) 2014-10-07 12:30:39 -07:00
Leonardo de Moura
dc0e6861b7 fix(emacs/lean-mode): wrong pp highlighting, fixes #225 2014-10-07 02:32:59 -07:00
Soonho Kong
286aae933c chore(CMakeLists.txt): add EMACS_LIB option to specify installation path for emacs stuff 2014-10-06 11:20:13 -07:00
Leonardo de Moura
16562adb87 feat(frontends/lean): add 'coercions' and 'instances' to 'print' command, closes #71 2014-10-05 18:50:48 -07:00
Leonardo de Moura
1306d08399 feat(emacs/lean-input): add shortcuts for subscripts 2014-10-05 13:34:05 -07:00
Soonho Kong
7ea9c32ec8 feat(emacs/lean-server): send SYNC command when visiting a modified buffer
Close #201
2014-10-03 10:11:21 -07:00
Soonho Kong
b78043ae24 feat(emacs/lean-mode): add 'clean-cache' to the menu
Related issue: #75
2014-10-03 10:11:21 -07:00
Soonho Kong
fffb4e6019 feat(emacs/lean-server): delete cache file (.clean) after visit/load
fix #75
2014-10-03 10:11:21 -07:00
Soonho Kong
e255b02fca fix(emacs/lean-changes): visit file before process any changes
This solves many instances of the modified buffer problem.
2014-10-03 10:11:21 -07:00
Leonardo de Moura
c0725d1934 refactor(frontends/lean): remove 'including' expressions 2014-10-03 09:09:27 -07:00
Leonardo de Moura
284f300440 feat(frontends/lean): add 'include' and 'omit' commands, closes #184 2014-10-03 07:23:24 -07:00
Leonardo de Moura
4946f55290 refactor(frontends/lean): constant/axiom are top-level commands, parameter/variable/hypothesis/conjecture are section/context-level commands
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-10-02 17:55:34 -07:00
Soonho Kong
91f789c3db feat(emacs/lean-cmd): add SYNC command 2014-10-02 17:30:03 -07:00
Leonardo de Moura
f78d831de3 refactor(frontends/lean): remove hardcoded Type', and define it using notation 2014-10-02 14:29:51 -07:00
Leonardo de Moura
9a75298892 feat(emacs): highlight Type' 2014-10-02 08:04:00 -07:00
Soonho Kong
72beb438e6 fix(emacs/lean-server): merge server-trace-mode to debug-mode 2014-10-01 14:38:23 -07:00
Soonho Kong
3775d07d5f fix(emacs/lean-company): use lean-grab-hname for findp auto-completion
fix #214
2014-10-01 09:53:48 -07:00
Soonho Kong
89a929e9cd feat(emacs/lean-syntax): add more word constituents to syntax table 2014-09-30 15:41:18 -07:00
Soonho Kong
9024cb23fd fix(emacs/lean-util): fix lean-grab-id 2014-09-30 15:41:16 -07:00
Soonho Kong
d5e77c05cb fix(emacs/lean-flycheck): fix error/warning pattern to work on windows 2014-09-30 15:40:57 -07:00
Soonho Kong
41acc10d49 feat(emacs/lean-flycheck): detect and use flycheck error buffer width
Detect the width of flycheck error list buffer and set pp.width when
calling flycheck. It uses the same heuristic that `split-window-sensibly`
function is using.

A user can also set `lean-flycheck-msg-width` custom variable to enforce
a certain width.

Close #205.
2014-09-30 05:54:46 -07:00
Soonho Kong
b538b3e0bf fix(emacs/lean-company): handle singleton candidate case
If we have a singleton auto-complete candidate (e.g. proof_irrel) and it
does not matched with input prefix (e.g. foo), we add the input
prefix (foo) as an extra candidate to prevent the
candidate (proof_irrel) from being automatically selected and completed.
2014-09-29 17:06:01 -07:00
Soonho Kong
7ab8b8acb7 fix(emacs/lean-company): respect lean syntax to extract findp prefix
close #207
2014-09-29 16:00:00 -07:00
Soonho Kong
6c2e576dff fix(emacs/lean-mode): trigger eri-indent only at the beginning of line 2014-09-29 12:53:22 -07:00
Soonho Kong
f7ab2f7903 feat(emacs/lean-company): add auto-completion for option names 2014-09-29 12:32:46 -07:00
Soonho Kong
51a0d154d1 fix(emacs/lean-company): always allow typing for FIND_P 2014-09-29 12:32:46 -07:00
Soonho Kong
106399179f fix(emacs/lean-syntax): use word-boundary instead of symbol-boundary 2014-09-29 12:32:46 -07:00
Leonardo de Moura
397395bbc9 feat(frontends/lean): allow user to associate priorities to class-instances, closes #180 2014-09-28 12:20:42 -07:00
Leonardo de Moura
23960da532 feat(emacs/lean-input): shortcut for long arrow 2014-09-26 17:50:33 -07:00
Soonho Kong
4b60499f7d fix(emacs/lean-company): take out '@' from prefix for findp
fix #207
2014-09-26 08:53:48 +02:00
Soonho Kong
ee4255eb3d fix(emacs/lean-type): disable eldoc at flycheck error/warning
fix #204
2014-09-20 10:20:47 -07:00
Soonho Kong
3e4755db25 fix(emacs/lean-tags): support windows 2014-09-20 10:06:42 -07:00
Soonho Kong
af4e18dd44 fix(emacs/lean-flycheck): support windows
In windows, we need to first call python interpreter to call linja.
2014-09-20 10:06:42 -07:00
Leonardo de Moura
e430dc8bab feat(frontends/lean): add 'irreducible' as syntax sugar for 'reducible [off]' 2014-09-19 15:54:32 -07:00
Leonardo de Moura
4e2377ddfc refactor(frontends/lean): replace '[protected]' modifier with 'protected definition' and 'protected theorem', '[protected]' is not a hint.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-19 15:54:32 -07:00
Leonardo de Moura
5d8c7fbdf1 refactor(frontends/lean): replace '[private]' modifier with 'private
definition' and 'private theorem', '[private]' is not a hint.
2014-09-19 15:54:32 -07:00
Leonardo de Moura
97b1998def refactor(frontends/lean): replace '[opaque]' modifier with 'opaque
definition', '[opaque]' is not a hint, but a kind of definition
2014-09-19 15:54:32 -07:00
Leonardo de Moura
08ccd58eb6 feat(frontends/lean): add 'reducible' modifier for controlling which
definitions are unfolded during elaboration

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-19 15:54:32 -07:00
Leonardo de Moura
baf4c01de8 feat(frontends/lean): definitions are opaque by default 2014-09-19 15:54:32 -07:00
Leonardo de Moura
93c2c30310 feat(frontends/lean): allow transient coercions, i.e., coercions that
are not saved in .olean files
2014-09-19 15:54:32 -07:00
Soonho Kong
9161a6a210 fix(emacs/lean-type): change where to trigger eldoc
Previously, eldoc is triggered regardless of current position.
Now, it is triggered:

 - *NOT* looking-at whitespace or
 - looking-back end-parens such as ')', '}', ']', etc
2014-09-17 00:24:30 -07:00
Leonardo de Moura
e3e2370a38 feat(frontends/lean): split 'opaque_hint' command into 'opaque' and 'transparent'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-16 18:03:40 -07:00
Soonho Kong
2a8ddf055b fix(emacs/lean-option): fix lean-get-options 2014-09-15 17:44:24 -07:00
Soonho Kong
aa9fe958a9 feat(emacs/lean-debug): add lean-debug minor-mode
close #177
2014-09-15 16:50:35 -07:00
Soonho Kong
18e6481ce3 test(emacs/lean-option-test): add lean-test-update-string-alist-default 2014-09-15 13:04:53 -07:00
Soonho Kong
b650793b33 feat(lean-option): handle default pp.width option value 2014-09-15 13:04:53 -07:00
Soonho Kong
254d861970 feat(bin/linja): pass -D config option to lean
Close #196
2014-09-15 13:04:13 -07:00
Soonho Kong
2bdc415a34 fix(emacs/lean-option): handle lean-option-string when it's nil 2014-09-15 11:26:53 -07:00
Soonho Kong
11ff7b5d33 feat(lean-mode): enable mmm-parse-when-idle
Related issue: #74
2014-09-15 10:23:38 -07:00
Soonho Kong
f94e28ce39 fix(emacs/lean-mode): disable flycheck-lua inside of lean-mode
Related issue: #74
2014-09-15 10:23:31 -07:00
Soonho Kong
c3d39938ac test(emacs): add lean-option-test 2014-09-15 09:48:33 -07:00
Soonho Kong
4bbfe4ec79 feat(emacs/lean-tags): add lean-global-search
close #170
2014-09-15 09:48:33 -07:00
Soonho Kong
ff6862f587 fix(emacs/lean-mode): pass lean-options to lean-execute
Related issue: #196
2014-09-15 09:48:26 -07:00
Soonho Kong
75ab5e07d6 feat(emacs/lean-option): save lean-options to lean-global-option-alist 2014-09-15 09:46:06 -07:00
Soonho Kong
f25f9a8fab fix(emacs/lean-mmm-lua): add 'insert' for mmm-insert-region (C-c % l)
Related issue: #74, https://github.com/flycheck/flycheck/issues/349, https://github.com/purcell/mmm-mode/issues/32
2014-09-15 00:03:21 -07:00
Soonho Kong
1527efb108 fix(emacs/lean-mode): run company-lean--check-prefix before auto-complete
fix #191
2014-09-14 23:15:24 -07:00
Soonho Kong
27b20c5585 fix(emacs/lean-company): fix auto-complete behavior after tab
fix #192
2014-09-14 23:15:24 -07:00
Soonho Kong
81ecbb4c94 fix(emacs/lean-company): import auto complete bug
fix #189
2014-09-14 23:15:24 -07:00
Soonho Kong
d424cdd336 feat(emacs/lean-company): add custom-variable lean-company-type-foreground
Close #190
2014-09-14 23:15:24 -07:00
Soonho Kong
87ad568ae6 fix(emacs/CMakeLists.txt): add all *.el files when install 2014-09-14 23:15:24 -07:00
Soonho Kong
50213fc664 fix(emacs/Makefile): add missing Makefile 2014-09-14 23:14:42 -07:00
Soonho Kong
df588d6ba0 fix(lean-flycheck): make column optional when detecting error/messages
fix #194
2014-09-14 23:14:42 -07:00
Soonho Kong
2d29d6d319 feat(emacs/lean-company): auto-completion for import
Close #126
2014-09-14 00:00:25 -07:00
Soonho Kong
bf9ff192ca chore(emacs/README.md): add 'f' as a required package for lean-mode 2014-09-13 23:35:38 -07:00
Soonho Kong
563cfa73ec feat(emacs/lean-changes): handle before/after-revert 2014-09-12 14:25:08 -07:00
Soonho Kong
27ae03878c refactor(emacs/lean-server): rename flush-changed-lines to server-flush-changed-lines 2014-09-12 14:25:08 -07:00
Soonho Kong
c034c54f50 refactor(emacs/debug): rename lean-server-debug to lean-debug 2014-09-12 14:25:08 -07:00
Leonardo de Moura
010ecebfea feat(frontends/lean): add proof-qed expression
Remark: we still have to add support to it in the elaborator.
Right now, it is just an embellished parenthesis.
2014-09-11 18:14:49 -07:00
Soonho Kong
b31edb2cee fix(emacs/lean-company): pass dummy continuation for WAIT 2014-09-11 13:46:07 -07:00
Soonho Kong
0b507777f9 fix(emacs/lean-company): repaint background in the candidate only when required 2014-09-11 13:44:54 -07:00
Soonho Kong
389fe02597 fix(emacs/lean-server): handle modified buffer only when process start 2014-09-11 12:40:10 -07:00
Soonho Kong
733c0e4a77 chore(emacs/lean-server): make trace-mode and debug-mode non-local vars 2014-09-11 12:34:23 -07:00
Soonho Kong
89f38b3945 test(emacs/features): add ecukes template 2014-09-11 12:33:49 -07:00
Soonho Kong
2ba43f1432 refactor(emacs): move tests in *.el files to 'test' directory 2014-09-11 12:29:32 -07:00
Soonho Kong
45b7327d63 doc(emacs/README.md): add contribution section 2014-09-11 12:29:00 -07:00
Soonho Kong
c879b2ce6d chore(emacs/Cask): add ert-runner, ecukes 2014-09-11 11:12:05 -07:00
Soonho Kong
4b556a41ed feat(emacs/lean-server): async task queue holds type of cmds as well 2014-09-11 04:09:21 -07:00
Soonho Kong
565402f3d6 feat(lean-server): handle signals (error/quit) in continuations
Related with #158
2014-09-11 04:07:50 -07:00
Soonho Kong
5b28480809 chore(emacs/lean-server): send signal info to lean-server-trace 2014-09-11 04:04:20 -07:00
Soonho Kong
92f8a22ea1 fix(emacs/lean-company): send dummy continuation when send wait 2014-09-11 04:03:23 -07:00
Soonho Kong
63c0510a05 feat(emacs/lean-tags): detect and support multiple TAGS
Close #170
2014-09-10 16:38:36 -07:00
Soonho Kong
1ea8b66a39 fix(emacs/lean-company): enable auto-complete when prefix length >= 1
[skip ci]
2014-09-10 16:21:44 -07:00
Soonho Kong
1c5497e632 feat(emacs/lean-project): add lean-project-create to imenu
Related with #170
2014-09-10 15:19:11 -07:00
Soonho Kong
b05ca1db0f fix(emacs/lean-tags): handle exceptions from find-tag 2014-09-10 14:14:42 -07:00
Soonho Kong
b51e8dd1b9 fix(emacs/lean-server): respect order of messages in check-buffer-and-partition 2014-09-10 14:14:42 -07:00
Soonho Kong
7c4debd1d1 feat(emacs/lean-server): handle modified buffer when send VISIT cmd
Close #159
2014-09-10 14:14:42 -07:00
Soonho Kong
cab1811927 feat(emacs/lean-server): print out signal event to debug buffer 2014-09-10 09:07:16 -07:00
Soonho Kong
27fa0d0ae3 doc(emacs/README.md): update required/optional packages 2014-09-09 15:11:58 -07:00
Soonho Kong
60d14b50ab feat(emacs/lean-require): check lean-mode dependencies in initialization
Close #91
2014-09-09 15:11:57 -07:00
Soonho Kong
961dccf279 feat(emacs/Cask): add Cask file
Close #92
2014-09-09 15:11:57 -07:00
Soonho Kong
ba6dc59d5f fix(emacs/lean-server): missing 'rx' at the beginning of regex 2014-09-09 13:47:09 -07:00
Soonho Kong
70dcc2e122 fix(emacs): use looking-at instead of char-after 2014-09-09 13:22:58 -07:00
Soonho Kong
85bd112a37 fix(emacs/lean-company): color problem when showing auto-complete candidates 2014-09-09 13:22:58 -07:00
Soonho Kong
c26f39b86e feat(emacs/lean-company): "c-u TAB" asks filter for FINDG 2014-09-09 13:22:58 -07:00
Soonho Kong
b460c02017 feat(emacs/lean-mode): add imenu support
Close #97
2014-09-09 09:04:31 -07:00
Soonho Kong
4eb8a9b192 feat(emacs/lean-flycheck): "real" .clean file instead of "flycheck_real.clean"
Fix #140
2014-09-08 23:49:02 -07:00
Soonho Kong
a9be084b1c feat(emacs/lean-settings): add lean-flycheck-pp-width and lean-flycheck-max-messages-to-display 2014-09-08 18:44:22 -07:00
Soonho Kong
3682ca32d2 feat(emacs/lean-company): call FINDG if cursor is at "_" 2014-09-08 16:04:20 -07:00
Soonho Kong
4f604544c4 feat(emacs/lean-cmd): add WAIT command 2014-09-08 16:04:19 -07:00
Soonho Kong
bc640510aa feat(emacs/lean-cmd): add FINDG cmd 2014-09-08 16:04:19 -07:00
Soonho Kong
0ac1ec1de3 feat(emacs/lean-settings): add lean-show-only-type-in-parens
Fix #135
2014-09-08 11:39:40 -07:00
Soonho Kong
a40894a712 fix(emacs/lean-tags): pass lean-flycheck-checker-options properly
Fix #153
2014-09-08 11:27:04 -07:00
Soonho Kong
c365f6b9ab fix(emacs/lean-company): only activate auto-completion when TAB is pressed 2014-09-08 10:52:22 -07:00
Soonho Kong
6c483467dd feat(emacs/lean-company): replace ?M in AC candidate with M and colorize
close #149
2014-09-08 09:47:51 -07:00
Leonardo de Moura
b4793df653 feat(frontends/lean): rename '[fact]' to '[visible]'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-08 07:47:42 -07:00
Soonho Kong
5c89e70a23 fix(emacs/lean-server): use process-query-on-exit-flag to kill
lean-server automatically on exit

To fix a problem mentioned in #147
2014-09-07 22:29:09 -04:00
Soonho Kong
fc2fbc41bb chore(emacs/lean-info): fix a bug passing a wrong argument 2014-09-07 18:44:11 -07:00
Leonardo de Moura
c378a58cc2 feat(frontends/lean): add [class] modifier for inductive datatypes as a shortcut for 'class' command. 2014-09-07 18:16:33 -07:00
Soonho Kong
ba35ca5300 feat(emacs/lean-company): add company-lean--need-autocomplete
This one partially addresses #150.
2014-09-07 17:32:06 -07:00
Soonho Kong
6b5e67e063 fix(emacs/lean-info): fix eldoc-error at end of buffer 2014-09-07 11:40:28 -07:00
Leonardo de Moura
d6491399b9 fix(emacs/lean-syntax): weird syntax-hightlight problem" 2014-09-06 10:49:16 -07:00
Soonho Kong
6b5831d894 feat(emacs/lean-info): show extra-type info for expr in parens
Close #135
2014-09-06 09:26:11 -07:00
Soonho Kong
d793b09c0f feat(emacs/lean-cmd): extend info to have column-number 2014-09-06 09:26:11 -07:00
Leonardo de Moura
3bbbd43b03 chore(emacs): minor adjustments to synthax hightlight and input mode
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-06 08:32:05 -07:00
Soonho Kong
303b86e165 refactor(emacs/lean-flycheck): clean up unused code 2014-09-05 23:08:19 -07:00
Soonho Kong
0476591992 fix(emacs/lean-company): override company--window-width
Override 'company--window-width' to be 0.95 * window-body-width.
This partially solves the problem of issue #137.
2014-09-05 23:08:19 -07:00
Soonho Kong
bd17d07ebc fix(emacs/lean-server): limit the number of NAY retries
Also, only retry when there is no continuation other than the current
one.
2014-09-05 23:08:19 -07:00
Soonho Kong
e4a687c5ea fix(emacs/lean-tags): use the same linja option for tags-gen and flycheck 2014-09-05 19:11:49 -07:00
Leonardo de Moura
8610330cc4 chore(emacs/lean-syntax): highlight 'import/section/end/namespace/open' arguments
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-05 18:38:41 -07:00
Soonho Kong
f958e534bd feat(emacs/lean-settings): pass 'pp.width' to lean via linja
Close #28
2014-09-05 16:35:01 -07:00
Soonho Kong
50f16ad591 feat(emacs/lean-flycheck): delete flycheck temporaries after check
Close #140
2014-09-05 16:09:45 -07:00
Soonho Kong
a1e00bb216 refactor(emacs/lean-server): restructure async queue handling routine 2014-09-05 16:09:45 -07:00
Soonho Kong
a72df90022 feat(emacs/lean-server): add debug-mode, trace-mode 2014-09-05 15:33:59 -07:00
Soonho Kong
70ac5ec15e feat(emacs/README.md): add instruction for unicode font 2014-09-05 15:33:59 -07:00
Soonho Kong
e77966932d feat(emacs/lean-server): scroll debug buffer 2014-09-05 15:33:59 -07:00
Soonho Kong
db60a56056 feat(emacs/lean-company): truncate string if it's longer than 90% of window-width
Also add "..." in the end

Close #137
2014-09-05 08:49:05 -07:00
Soonho Kong
3b574ef31d feat(emacs/lean-server): kill the server before emacs exit
Close #138
2014-09-05 07:49:19 -07:00
Soonho Kong
37e514e114 feat(emacs/lean-tags): block emacs until ltags finishes 2014-09-05 06:59:02 -07:00
Soonho Kong
fc364566bf feat(emacs/lean-company): truncate type info in auto-complete
Close #137
2014-09-05 06:59:02 -07:00
Soonho Kong
64bae94d3a fix(emacs/lean-company): enable auto-complete if prefix has '.' or '_' 2014-09-05 06:59:02 -07:00
Soonho Kong
3ba4e553fe refactor(emacs/lean-server): clean up 2014-09-05 06:59:01 -07:00
Soonho Kong
0652198eca feat(emacs/lean-server): add sync/async send-cmd 2014-09-04 16:32:08 -07:00
Soonho Kong
cc89cd051a feat(emacs/lean-company): add lean-company 2014-09-04 16:32:07 -07:00
Soonho Kong
e7f6228001 feat(emacs): use lean-server-send-cmd-async 2014-09-04 16:32:07 -07:00
Soonho Kong
677f4af801 feat(emacs/lean-server): add debug print 2014-09-04 16:32:07 -07:00
Soonho Kong
2fa8c1c709 chore(emacs/lean-info): fix indentation 2014-09-04 16:32:07 -07:00
Soonho Kong
cae2ab7dfb feat(emacs/lean-cmd): add FINDP cmd 2014-09-04 16:32:07 -07:00
Leonardo de Moura
b94ec07b29 feat(frontends/lean): associate type information with left '('
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-04 09:56:27 -07:00
Leonardo de Moura
f9a90b9920 feat(frontends/lean): add 'export' command
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-03 18:37:01 -07:00
Leonardo de Moura
5e18e6609c feat(frontends/lean): add 'as' clause to 'open' command
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-03 17:37:02 -07:00
Leonardo de Moura
e51c4ad2e9 feat(frontends/lean): rename 'using' command to 'open'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-03 16:00:38 -07:00
Leonardo de Moura
6a6f6ed439 feat(emacs/lean-syntax): add syntax-highlight for declaration modifiers
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-03 15:26:21 -07:00
Leonardo de Moura
5a203d1c75 feat(frontends/lean): add '?' for inspecting the type of any expression, it produces a EXTRA_TYPE info entry
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-03 11:54:42 -07:00
Soonho Kong
327e3a58bf fix(emacs/lean-info): print stale when info is available
fix #127
2014-09-03 10:28:37 -07:00
Soonho Kong
25a48be470 feat(emacs/lean-info): improve coercion display
close #124
2014-09-03 10:12:18 -07:00
Soonho Kong
fdc20800ca chore(emacs/lean-server): clean up debugging message 2014-09-03 10:12:17 -07:00
Soonho Kong
e802883b03 feat(emacs/lean-option): show the current value of an option
close #125
2014-09-03 08:09:41 -07:00
Soonho Kong
975841e53b feat(emacs): use lexical scope for lean-info and lean-server 2014-09-03 00:54:42 -07:00
Soonho Kong
b25288545e feat(emacs/lean-info): add coercion and stale in type info
Close #124
2014-09-03 00:50:31 -07:00
Soonho Kong
88410bf278 feat(emacs/lean-server): support SHOW and VALID
Implement lean-server-show and lean-server-valid functions.

Close #116
2014-09-03 00:50:31 -07:00
Soonho Kong
72e1dfa296 feat(emacs): implement non-blocking communication
The key idea is to pass a continuation function when we call
lean-server-send-cmd function. The passed continuation function is
called by lean-server-event-handler. Until the buffer is ready, the
event handler will be called in interval (lean-server-retry-time, 0.1
sec by default). When we have 'NAY' for INFO command, it will re-send
INFO commands to lean-server until we have one without 'NAY'.

Close #123
2014-09-03 00:50:31 -07:00
Soonho Kong
53390faebc chore(emacs/lean-mode): remove lean-tab function 2014-09-03 00:50:31 -07:00
Soonho Kong
78437331c2 fix(emacs/lean-syntax.el): highlight "parameter (" properly
fix #122
2014-09-02 15:09:49 -07:00
Leonardo de Moura
0f9478d91e feat(frontends/lean): add 'class' command back
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-02 15:04:23 -07:00
Soonho Kong
b05aeb112b fix(emacs/lean-mode): Bind TAB with lean-tab-indent-or-compliete 2014-09-02 17:02:35 -04:00
Soonho Kong
b4a80f83af feat(emacs/lean-server): accept "BEGININFO .*" pattern 2014-09-02 10:37:03 -07:00
Soonho Kong
cec2f8e466 feat(emacs/lean-mmm-lua.el): add mmm-mode to syntax-highlight lua code
in lean-mode

Close #74
2014-09-02 10:37:03 -07:00
Soonho Kong
a08ad99dba feat(emacs/lean-cmd): add lean-clear-cache
Close #99
2014-09-01 22:58:52 -07:00
Soonho Kong
50465a2d06 feat(emacs/lean-option): provide candidates and validation for lean-set-option
Close #106
2014-09-01 18:31:12 -07:00
Soonho Kong
fc2cbbe216 chore(emacs/lean-mode): add package info 2014-09-01 18:28:15 -07:00
Soonho Kong
246d4224bc feat(emacs/lean-tags): call "linja TAGS" to make TAGS
fix #117
2014-08-30 14:58:48 -07:00
Soonho Kong
26d548a069 feat(emacs/lean-mode): add lean-tab-indent-or-complete
Close #105
2014-08-30 14:57:34 -07:00
Soonho Kong
d393771d8a feat(emacs/eri.el): add eri.el (from agda mode) 2014-08-30 14:57:34 -07:00
Soonho Kong
a47dada27f feat(emacs/lean-server): add 'SLEEP ms' for trace 2014-08-30 07:51:53 -07:00
Soonho Kong
ad1111cb21 feat(emacs/lean-server): add *lean-server-trace* buffer
Fix #115.
2014-08-30 07:38:12 -07:00
Soonho Kong
543fdf840e fix(emacs/lean-mode): add comment-start "--"
fix #113
2014-08-29 20:12:22 -07:00
Soonho Kong
36c632f48d doc(emacs/README.md): clean up
[skip ci]
2014-08-29 15:22:06 -07:00
Soonho Kong
e966aa3145 feat(emacs/lean-settings): use linja for flycheck 2014-08-29 10:31:16 -07:00
Leonardo de Moura
d9fa9f1039 feat(src/emacs/lean-syntax.el): add commonly used operators
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-28 13:03:22 -07:00
Leonardo de Moura
f98ab2a8ff fix(src/emacs/lean-syntax.el): remove obsolete command set_opaque
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-28 11:16:29 -07:00
Leonardo de Moura
b3615d5c8b fix(src/emacs): add 'begin' reserved keyword
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-28 09:33:09 -07:00
Soonho Kong
f8d2ed7936 feat(emacs/lean-type): maintain nay-retry timer 2014-08-27 00:48:55 -07:00
Soonho Kong
224a4feba2 fix(emacs/lean-type): problem with lean-eldoc-nay-retry-time
If (current-idle-time) is non-zero, we need to set a timer to run
eldoc-documentation-function again when idle-time = (current-idle-time)
+ retry-delay.
2014-08-26 23:58:02 -07:00
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
Soonho Kong
b9c1b1e186 fix(emacs/lean-info): type of a symbol at the end of buffer 2014-08-26 22:32:57 -07:00
Soonho Kong
1de515f693 feat(emacs/lean-mode): clean up old generic-mode 2014-08-26 17:16:16 -07:00
Soonho Kong
665a8f3ecb feat(emacs/lean-server): handle signal 2014-08-26 17:16:16 -07:00
Soonho Kong
0426d04cb9 feat(emacs/README.md): add elisp which installs required packages 2014-08-26 17:16:16 -07:00
Soonho Kong
83f05e104a fix(emacs/lean-server): fix ERROR regex pattern 2014-08-26 16:22:32 -07:00
Soonho Kong
682b13a906 feat(emacs/lean-mode): run eldoc-documentation-function at openning 2014-08-26 16:22:32 -07:00
Soonho Kong
c77e5c6b34 feat(emacs/lean-tags): try to find TAGS file upward and use it without asking 2014-08-26 16:22:32 -07:00
Soonho Kong
dfab827d22 feat(emacs/lean-tags): attach advice to tag functions to run ltags 2014-08-26 16:22:32 -07:00
Soonho Kong
1f0bfb67b0 feat(emacs/lean-tags): use full-name to look up tags 2014-08-26 16:22:32 -07:00
Soonho Kong
3d3669e45e feat(emacs/lean-mode): add key-bindings, deps 2014-08-26 16:22:32 -07:00
Soonho Kong
dd5231d6a7 fix(emacs/lean-server): check current-file before send EVAL 2014-08-26 16:22:32 -07:00
Soonho Kong
f7ff5ec3d6 fix(emacs/lean-server): when handle dead lean-server 2014-08-26 16:22:32 -07:00
Soonho Kong
5965bcc10b refactor(emacs/lean-server): lean-server-check-current-file takes file-name 2014-08-26 16:22:31 -07:00
Soonho Kong
cc1d44e541 feat(emacs/lean-type): implement lean-set-option and lean-eval-cmd
close #55
2014-08-26 16:22:31 -07:00
Soonho Kong
50063b659b refactor(lean-variable): init server-buffer and current-file-name with nil 2014-08-26 16:22:31 -07:00
Soonho Kong
f82f0377ff feat(emacs/lean-cmd): add cmd-to-string for SET/EVAL 2014-08-26 16:22:31 -07:00
Soonho Kong
292750c4c9 feat(emacs/lean-type): add SET/EVAL commands 2014-08-26 16:22:31 -07:00
Soonho Kong
679a034277 feat(emacs/lean-mode): use define-derived-mode 2014-08-26 16:22:31 -07:00
Soonho Kong
c1ed9b1293 refactor(emacs/lean-type): clean up eldoc-function and fill-placeholder 2014-08-26 16:22:31 -07:00
Soonho Kong
7ea5c9541d feat(emacs/lean-info): use cl-struct lean-info-record 2014-08-26 16:22:31 -07:00
Soonho Kong
ccc1f89f61 refactor(emacs/lean-server): use global-server-message-to-process
We are using asynchronous process mechanism to communicate between
lean-server and emacs. A sender function like
lean-eldoc-documentation-function sends a command and waits until
lean-global-server-message-to-process is non-nil. When a message is
received from lean-server, a filter function lean-server-output-filter
is triggered. This filter function concatenates a received message to
the buffer until it sees the end of message markers (--
END[INFO|SET|EVAL]). When it sees a marker, it splits the buffer
messages into pre, body, and post parts. Then it assembles a message to
process and attaches the message to
lean-global-server-message-to-process variable. A sender function which
is watching for the variable will recognize it, exit the polling, and
process the message.
2014-08-26 16:22:31 -07:00
Soonho Kong
fc44c7242c feat(emacs/lean-settings): add eldoc-use and eldoc-nay-retry-time
close #51
2014-08-26 16:22:31 -07:00
Soonho Kong
10fb60e4dd refactor(emacs/lean-util): remove unused functions
- take-first-n/last-n => use -take, -drop (from dash.el)
 - string-join => use one in flycheck
 - remove other unused functions
2014-08-26 16:22:31 -07:00
Soonho Kong
812934f31f refactor(emacs/lean-flycheck): remove lean-flycheck-initialized 2014-08-26 16:22:31 -07:00
Soonho Kong
495809d86d feat(emacs/lean-syntax): support multi-line comments /- ... -/ 2014-08-26 16:22:30 -07:00
Soonho Kong
c0762333bd feat(emacs/lean-cmd): add set and eval cmds 2014-08-26 16:22:30 -07:00
Leonardo de Moura
2f699fa53a feat(*): make sections 'permanent', and add 'transient' contexts, closes #88
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-23 15:45:15 -07:00
Soonho Kong
f4dfec548d fix(emacs/lean-mode): add missing flycheck-init 2014-08-21 10:05:14 -07:00
Soonho Kong
39f9826dca fix(emacs/lean-mode): enable company-etags in lean-mode 2014-08-21 10:05:14 -07:00
Soonho Kong
272c463182 fix(emacs/lean-info): temporary fix for NAY problem 2014-08-21 10:05:14 -07:00
Soonho Kong
09b6fb4f7c fix(emacs): roll back to generic mode 2014-08-21 10:05:14 -07:00
Soonho Kong
51b86b219b feat(emacs/lean): add multi-line comments
This is related with issue #63.

There are two known issues:

 - Emacs behaves as if the multi-line comment start/end symols are "(-"
   and "-)" instead of "(--" and "--)". As a result, it shows all the
   correct lean comments as it is. However, it will show some examples
   such as "(-5)" as a part of comment even if Lean doesn't interpret it
   as it is. Technically, it's because we are using a syntax-table based
   method to define comments. For more information read a documentation
   of 'modify-syntax-entry' function.

 - Somehow, the matching parens are broken. When we type "--)" to close
   a multi-line comment. Emacs warns "Mismatched Parentheses".
2014-08-19 15:03:51 -07:00
Soonho Kong
c27a379f28 feat(emacs): add company mode (via etags) 2014-08-19 15:03:51 -07:00
Soonho Kong
608b66c323 fix(emacs/lean-server): check buffer-modified-p before create a process
fix #57
2014-08-18 14:18:11 -07:00
Soonho Kong
7a8796a4ca feat(emacs/lean-info): add identifier/symbol/nay 2014-08-18 14:17:44 -07:00
Soonho Kong
ea4cfe5e7d refactor(emacs/lean-type): clean up 2014-08-18 13:34:13 -07:00
Soonho Kong
46013b6ad2 feat(emacs): define lean-mode as a derived-mode of prog-mode
Fix #52
2014-08-18 13:32:58 -07:00
Soonho Kong
5fa2b9c057 fix(emacs/lean-util): add missing 'cl-' prefix 2014-08-17 18:09:01 -07:00
Soonho Kong
030eec1d06 feat(emacs): add lean-complete-tag (tab) 2014-08-15 21:30:47 -07:00
Soonho Kong
483bae0b97 feat(emacs): add lean-find-tag (M-.) 2014-08-15 21:24:34 -07:00