]> code.delx.au - gnu-emacs-elpa/blob - packages/sotlisp/README.md
Merge commit '0cda39255827f283e7578cd469ae42daad9556a2' from js2-mode
[gnu-emacs-elpa] / packages / sotlisp / README.md
1 # speed-of-thought-lisp
2 Write emacs-lisp at the speed of thought.
3
4 This defines a new global minor-mode `speed-of-thought-mode`, which
5 activates locally on any supported buffer. Currently, only
6 `emacs-lisp-mode` buffers are supported.
7
8 The mode is quite simple, and is composed of two parts:
9
10 ## Abbrevs
11
12 A large number of abbrevs which expand function
13 initials to their name. A few examples:
14
15 - `wcb` -> `with-current-buffer`
16 - `i` -> `insert`
17 - `r` -> `require '`
18 - `a` -> `and`
19
20 However, these are defined in a way such that they ONLY expand in a
21 place where you would use a function, so hitting SPC after `(r`
22 expands to `(require '`, but hitting SPC after `(delete-region r` will
23 NOT expand the `r`, because that's obviously not a function.
24 Furtheromre, `#'r` will expand to `#'require` (note how it ommits that
25 extra quote, since it would be useless here).
26
27 ## Commands
28
29 It also defines 4 commands, which really fit into this "follow the
30 thought-flow" way of writing. The bindings are as follows, I
31 understand these don't fully adhere to conventions, and I'd
32 appreaciate suggestions on better bindings.
33
34 - `M-RET` :: Break line, and insert "()" with point in the middle.
35 - `C-RET` :: Do `forward-up-list', then do M-RET.
36
37 Hitting RET followed by a `(' was one of the most common key sequences
38 for me while writing elisp, so giving it a quick-to-hit key was a
39 significant improvement.
40
41 - `C-c f` :: Find function under point. If it is not defined, create a
42 definition for it below the current function and leave point inside.
43 - `C-c v` :: Same, but for variable.
44
45 With these commands, you just write your code as you think of it. Once
46 you hit a "stop-point" of sorts in your tought flow, you hit `C-c f/v`
47 on any undefined functions/variables, write their definitions, and hit
48 `C-u C-SPC` to go back to the main function.
49
50 ## Small Example
51
52 With the above (assuming you use something like paredit or
53 electric-pair-mode), if you write:
54
55 ( w t b M-RET i SPC text
56
57 You get
58
59 (with-temp-buffer (insert text))