/
tempo-extra-elisp.el
73 lines (55 loc) · 1.94 KB
/
tempo-extra-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
71
72
73
;;; tempo-extra-elisp.el --- Tempo templates for elisp -*- lexical-binding: t; -*-
;; Copyright (C) 2023 Valeriy Litkovskyy
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; Tempo templates for elisp
;;; Code:
(require 'tempo-extra-lisp)
(define-abbrev-table (abbrev-hook-abbrev-table 'emacs-lisp-mode)
nil :enable-function #'te-lisp-enable)
(te-define "defvar" 'emacs-lisp-mode
'((:with-parens
"defvar " :elisp-prefix p n>
r> n>
"\"" p "\"")))
(te-define "defun" 'emacs-lisp-mode
'((:with-parens
"defun " :elisp-prefix p " (" p ")" n>
"\"" p "\"" n>
r>)))
(te-define "defgroup" 'emacs-lisp-mode
'((:with-parens
"defgroup " :elisp-group " nil" n>
"\"" p "\"" n>
":group " p "nil")))
(te-define "defcustom" 'emacs-lisp-mode
'((:with-parens
"defcustom " :elisp-prefix p n>
r> n>
"\"" p "\"" n>
":type " p "nil" n>
":group '" :elisp-group)))
(te-define "defface" 'emacs-lisp-mode
'((:with-parens
"defface " :elisp-prefix p n>
"'((t :inherit " p "nil))" n>
"\"" p "\"" n>
":group '" :elisp-group)))
(te-define "ert-deftest" 'emacs-lisp-mode
'((:with-parens
"ert-deftest " :elisp-prefix p " ()" n>
r>)))
(provide 'tempo-extra-elisp)
;; Local Variables:
;; read-symbol-shorthands: (("te-" . "tempo-extra-"))
;; End:
;;; tempo-extra-elisp.el ends here