7
7
Lambdapi source code can be edited with the `emacs `_ editor with the major
8
8
mode ``lambdapi-mode ``. It requires Emacs 26.1 or higher and provides:
9
9
10
- * Syntax highlighting for Lambdapi (``*.lp `` files) and Dedukti2 (``*.dk ``
11
- files)
10
+ * Syntax highlighting for Lambdapi (``*.lp `` files) and Dedukti (``*.dk `` files)
12
11
* Auto indentation for Lambdapi
13
12
* Easier unicode input
14
13
* Completion for Lambdapi
15
14
* Typing of symbol at point (in minibuffer)
16
15
* Type checking declarations
17
16
17
+ List of short-cuts
18
+ ------------------
19
+
20
+ * ``C-c C-c ``: jump to cursor position
21
+ * ``C-c C-n `` or button "Next": next tactic or command
22
+ * ``C-c C-p `` or button "Prev": previous tactic or command
23
+ * ``C-c C-f ``: next proof
24
+ * ``C-c C-b ``: previous proof
25
+ * ``C-c C-e ``: toggle electric mode
26
+ * ``M-; `` : (un)comment region
27
+ * ``C-x RET C-\ ``: enter unicode characters in minibuffer using LaTeX
28
+ * ``M-x customize-group lambdapi ``: customize window layout
29
+ * ``C-c C-r ``: refresh window layout
30
+ * Click on a symbol to discover its type in the bottom line
31
+
32
+ As always with emacs, if you were to be dissatisfied with these
33
+ keybindings, you can change them easily!
34
+
18
35
Installation
19
36
------------
20
37
99
116
Commenting regions
100
117
^^^^^^^^^^^^^^^^^^
101
118
102
- Lambdapi handles only single-line comments with ``// ``. To comment a
103
- region in Emacs, select it and use ``M-; ``.
119
+ Lambdapi handles single-line and multi-line comments with ``// `` and
120
+ ``/* ... */ `` respectively. To comment a region in Emacs, select it and use
121
+ ``M-; ``.
104
122
105
123
Entering unicode
106
124
^^^^^^^^^^^^^^^^
@@ -156,45 +174,38 @@ LSP server
156
174
Navigating goals
157
175
''''''''''''''''
158
176
159
- On lambdapi-mode startup, a window showing the goals at the current line
160
- is open.
161
-
162
- You can toggle the interactive mode with ``C-c C-i ``. If you were to do
163
- so, you still can navigate the proofs with ``C-c C-p `` and ``C-c C-n ``,
164
- jump between proofs with ``C-c C-b `` and ``C-c C-f ``, and show the goals
165
- at the current line with ``C-c C-c ``. As always with emacs, if you were
166
- to be dissatisfied with these keybindings, you can change them easily!
177
+ On lambdapi-mode startup, the window is split into three buffers:
167
178
168
- Clicking on the ``i ``-th goal of the ``*Goals* `` buffer puts the focus on it
169
- by inserting a ``focus i `` tactic in the proof script.
179
+ * the top buffer contains the Lambdapi file,
180
+ * the middle ``*Goals* `` buffer is where goals are displayed,
181
+ * the bottom ``*lp-logs* `` buffer is where Lambdapi messages are displayed.
170
182
171
- CPU usage and deactivation
172
- ''''''''''''''''''''''''''
173
-
174
- If for any reason the LSP server consumes too much power (e.g. if a
175
- non-terminating rewrite system is edited), it can be disabled with
176
- ``M-x eglot-shutdown ``.
183
+ It is possible to print the goals to solve at some point in the file by
184
+ using the following sort-cuts or the navigation buttons "Prev" and "Next":
177
185
178
- Pseudo interactive proof mode
179
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
186
+ * ``C-c C-c ``: jump to cursor position
187
+ * ``C-c C-n `` or button "Next": next tactic or command
188
+ * ``C-c C-p `` or button "Prev": previous tactic or command
189
+ * ``C-c C-f ``: next proof
190
+ * ``C-c C-b ``: previous proof
180
191
181
- One can use `quickrun `_ to call lambdapi while editing a buffer. It can be
182
- configured for lambdapi with
192
+ The part of the file up to the current goal is displayed with a green
193
+ background. In case of error, the background gets red. If an edition
194
+ occurs in the green zone, the green zone is automatically shrinked and
195
+ the goals buffer updated.
183
196
184
- .. code :: emacs-lisp
197
+ It is possible to make the green zone expand automatically each time a
198
+ new command is typed by toggling the electric mode with ``C-c C-e ``.
185
199
186
- (quickrun-add-command "lambdapi"
187
- '((:command . "lambdapi check")
188
- (:exec . ("%c %s")))
189
- :mode 'lambdapi-mode)
190
- (add-hook 'lambdapi-mode-hook
191
- (lambda () (define-key lambdapi-mode-map (kbd "C-c r") #'quickrun)))
200
+ Clicking on the ``i ``-th goal of the ``*Goals* `` buffer puts the focus
201
+ on it by inserting a ``focus i `` tactic in the proof script.
192
202
193
- to run lambdapi on the edited buffer with ``C-c r ``. It can be used to
194
- display goals while doing a proof. To display the result of ``compute ``,
195
- ``type ``, and simlar commmand as well, write ``"%c --verbose 1 %s" ``
196
- instead of ``"%c %s" ``.
203
+ Electric Terminator mode
204
+ ''''''''''''''''''''''''
197
205
206
+ You can toggle electric terminators either from the toolbar or
207
+ using ``C-c C-e ``. This will evaluate the region till the
208
+ cursor whenever you type the ``; `` terminator or ``begin ``.
198
209
199
210
Customize window layout
200
211
'''''''''''''''''''''''
@@ -203,7 +214,12 @@ The window layout can be customized in the LambdaPi customization group
203
214
(Do ``M-x customize-group lambdapi ``).
204
215
The layout can be refreshed with ``C-c C-r ``.
205
216
217
+ CPU usage and deactivation
218
+ ''''''''''''''''''''''''''
206
219
220
+ If for any reason the LSP server consumes too much power (e.g. if a
221
+ non-terminating rewrite system is edited), it can be disabled with
222
+ ``M-x eglot-shutdown ``.
207
223
208
224
Other relevant packages
209
225
-----------------------
0 commit comments