Commit graph

164 commits

Author SHA1 Message Date
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
Soonho Kong
05b2f93d14 fix(emacs/lean-flycheck): fix eval-after-load to use library name 2014-08-15 09:07:50 -07:00
Soonho Kong
b18124e1a2 feat(emacs): replace metavar '?M_n' with '_' in synthed expr 2014-08-14 18:21:58 -07:00
Soonho Kong
a4e8389695 feat(emacs): add lean-fill-placeholder (C-c C-f) 2014-08-14 17:12:23 -07:00
Soonho Kong
74dafe76bb feat(emacs): use --permissive lmake option for flycheck
close #42
2014-08-14 15:06:30 -07:00
Soonho Kong
24220a5f9e feat(emacs): show synth information 2014-08-14 13:22:24 -07:00
Soonho Kong
99e77db8ad feat(emacs/lean-flycheck): override flycheck-try-parse-error-with-pattern
For lean-mode, we override flycheck-try-parse-error-with-pattern to
increase column number by 1. It uses defadvice.
2014-08-14 11:21:09 -07:00
Soonho Kong
a0a73463cc feat(emacs/lean-server.el): add lean-server-{kill,restart}-process
[skip ci]
2014-08-14 08:56:46 -07:00
Soonho Kong
c19bcad845 fix(emacs): add and use lean-string-join 2014-08-14 08:42:52 -07:00
Leonardo de Moura
ced0ed0eca fix(emacs): add missing 'require'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-14 08:21:42 -07:00
Soonho Kong
243cf2abb0 feat(emacs): show overload information 2014-08-14 07:23:15 -07:00
Soonho Kong
28d23390a6 feat(emacs): implement lean-show-type 2014-08-13 17:02:49 -07:00
Soonho Kong
d2ef577a14 feat(emacs/lean-flycheck): customize checker name and options 2014-08-13 15:07:12 -07:00
Soonho Kong
3cd381b0f7 fix(emacs): remove lean-get-this-if-true-or-that 2014-08-13 15:07:12 -07:00
Soonho Kong
88ef5d68f9 feat(emacs): add lean-flycheck-turn-on/off/toggle 2014-08-07 14:03:08 -07:00
Soonho Kong
b684af5cdb feat(emacs): provide an option to disable lean-flycheck 2014-08-07 14:03:08 -07:00
Soonho Kong
209ecfd792 feat(emacs/lean-setting.el): add lean-rule-color custom-var 2014-08-07 14:03:08 -07:00
Soonho Kong
b6b40bb4ab feat(emacs): use optional package when required 2014-08-07 11:59:59 -07:00
Soonho Kong
5ecc872278 fix(emacs): use cl-case, require cl-lib 2014-08-07 11:59:59 -07:00
Soonho Kong
07e188acdb feat(emacs/README.md): add instr. for MELPA; add whitespace-cleanup-mode 2014-08-07 11:59:59 -07:00
Soonho Kong
a2867b3d06 feat(emacs/README.md): add README.md 2014-08-07 09:59:15 -07:00
Soonho Kong
f523c25c52 feat(emacs/lean-mode.el): use whitespace-cleanup-mode to fci-mode 2014-08-07 09:59:15 -07:00
Soonho Kong
f9f8c09143 refactor(emacs/lean-mode.el): clean up, add license 2014-08-07 09:59:15 -07:00
Soonho Kong
61f3897b0d feat(emacs/lean-util.el): add lean-util.el 2014-08-07 09:59:15 -07:00
Soonho Kong
164eab5574 feat(emacs/lean-settings.el): add customization-settings file 2014-08-07 09:59:15 -07:00
Soonho Kong
977ccc4631 feat(emacs/lean-flycheck.el): add lean-flycheck.el 2014-08-07 09:59:15 -07:00
Leonardo de Moura
6ca80b5000 feat(frontends/lean): add 'sorry'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-31 18:35:57 -07:00
Leonardo de Moura
d5d2c1d069 fix(emacs): syntax highlight issues reported by Jeremy
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-31 16:49:19 -07:00
Leonardo de Moura
c0039735f4 feat(emacs): add shortcut for using --hott option
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-29 10:57:52 -07:00
Leonardo de Moura
33c77afc29 feat(frontends/lean/structure): add 'structure' command skeleton
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-28 19:59:38 -07:00
Leonardo de Moura
bc0a8b8da4 feat(emacs): make lean-mode org-mode friendly
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-27 17:03:06 -07:00
Leonardo de Moura
cd522ff670 feat(emacs): improve font highlighting in emacs mode
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-25 10:54:06 -07:00
Leonardo de Moura
2fae6ebc3a feat(emacs): add missing keywords
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-24 08:50:18 -07:00
Leonardo de Moura
5eaf04518b refactor(*): rename Bool to Prop
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-22 09:43:18 -07:00
Leonardo de Moura
4c98686d4f fix(emacs): syntax highlight bug
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-17 20:48:06 +01:00
Leonardo de Moura
359bfe93d5 feat(library/hott): add basic HoTT definitions and theorems
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-15 21:46:33 +01:00
Leonardo de Moura
cf34f75ab5 feat(frontends/lean): add 'obtains' expression
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-11 04:08:51 +01:00
Leonardo de Moura
a3be63af73 feat(frontends/lean): add tactic_hint command
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-08 15:08:13 -07:00
Leonardo de Moura
55894f01e3 feat(frontends/lean): add 'opaque_hint' command
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-05 18:58:20 -07:00
Leonardo de Moura
6ea7bb3ea4 feat(frontends/lean/builtin_exprs): add 'including' expression
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-04 18:37:09 -07:00
Leonardo de Moura
079672f6f9 feat(frontends/lean): add 'class' and 'instances' infrastructure
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-04 14:28:09 -07:00
Leonardo de Moura
ce282a549a feat(frontends/lean): add 'prefix' notation declaration command
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 21:37:56 -07:00
Leonardo de Moura
5527955ba8 feat(frontends/lean): add 'proof-qed' notation
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 19:30:48 -07:00
Leonardo de Moura
c3abf81382 chore(emacs): update emacs mode
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 18:37:53 -07:00
Leonardo de Moura
4da9c2a2cb fix(emacs): modify emacs mode to reflect recent changes
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-22 17:56:53 -07:00
Leonardo de Moura
bdab979e09 feat(frontends/lean): add inductive_cmd
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-18 16:00:59 -07:00
Leonardo de Moura
f6dc6e6504 feat(emacs): add new calc commands to lean emacs mode
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-17 13:36:35 -07:00
Leonardo de Moura
77b0e9d05d feat(emacs): add 'abbreviation' in the list of keywords
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-16 10:54:04 -07:00
Leonardo de Moura
249168ce0b feat(emacs): add 'postfix' in the list of keywords
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-16 10:03:36 -07:00
Leonardo de Moura
e7019ec840 feat(frontends/lean): add infixl/infixr/postfix/precedence commands, add support for storing notation in .olean files, add support for organizing notation into namespaces
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-14 22:13:25 -07:00
Leonardo de Moura
a65c43c0db feat(frontends/lean/builtin_cmds): add definition command family
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-13 17:30:35 -07:00