-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvdm-snippets.el
52 lines (38 loc) · 1.68 KB
/
vdm-snippets.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
;;; vdm-snippets.el --- YASnippets for VDM mode -*- lexical-binding: t; -*-
;; Copyright (C) 2018 Peter W. V. Tran-Jørgensen
;; Author: Peter W. V. Tran-Jørgensen <peter.w.v.jorgensen@gmail.com>
;; Maintainer: Peter W. V. Tran-Jørgensen <peter.w.v.jorgensen@gmail.com>
;; URL: https://github.com/peterwvj/vdm-mode
;; Created: 29th August 2018
;; Version: 0.0.4
;; Keywords: languages
;; Package-Requires: ((emacs "24") (yasnippet "0.13.0"))
;; This file 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 file 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 file. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; Loads a collection of VDM YASnippets.
;;; Code:
(require 'yasnippet)
(defvar vdm-snippets-root
(file-name-directory (or load-file-name (buffer-file-name)))
"Root directory of VDM snippets.")
;;;###autoload
(defun vdm-snippets-initialize ()
"Initialize VDM snippets such that YASnippet can see them."
(let ((dir (expand-file-name "snippets" vdm-snippets-root)))
(when (boundp 'yas-snippet-dirs)
(add-to-list 'yas-snippet-dirs dir t))
(yas-load-directory dir)))
;;;###autoload
(eval-after-load 'yasnippet
'(vdm-snippets-initialize))
(provide 'vdm-snippets)
;;; vdm-snippets.el ends here