-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathtree-edit-elisp.el
70 lines (60 loc) · 1.47 KB
/
tree-edit-elisp.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
;;; tree-edit-elisp.el --- Description -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2021 Ethan Leba
;; Author: Ethan Leba <[email protected]>
;; SPDX-License-Identifier: GPL-3.0-or-later
;; Version: 0.1.0
;; Package-Requires: ((emacs "27.0"))
;; Homepage: https://github.com/ethan-leba/tree-edit
;;
;; This file is not part of GNU Emacs.
;;
;;; Commentary:
;;
;; This file contains key bindings and other configuration for `tree-edit' to
;; work with Elisp.
;;
;;
;;
;; This file is not part of GNU Emacs.
;;
;;; Commentary:
;;
;;; Code:
(require 'tree-edit)
(tree-edit--set-parser-local-vars
'elisp
tree-edit-placeholder-node-type
'symbol
tree-edit-syntax-snippets
((list . ("(" symbol ")"))
(vector . ("[" "]"))
(quote . ("'" symbol))
(unquote . ("," symbol))
(symbol . ("TREE")))
tree-edit-whitespace-rules
((nil (comment nil (:newline))))
tree-edit-node-deletion-override
((source_file . tree-edit-simple-delete-override))
tree-edit-node-replacement-override
((source_file . tree-edit-simple-insertion-replacement-override))
tree-edit-node-insertion-override
((source_file . tree-edit-simple-insertion-replacement-override))
tree-edit-nodes
((:type list
:key "l"
:wrap-override '((list . ("(" symbol ")"))))
(:type symbol
:key "s")
(:type vector
:key "v")
(:type hash_table
:key "h")
(:type quote
:key "q")
(:type unquote
:key "u")
(:type unquote_splice
:key "U")))
(provide 'tree-edit-elisp)
;;; tree-edit-elisp.el ends here