Skip to content

Commit 0f80fec

Browse files
committed
Determine yasnippet directory path in the correct load context
See #355
1 parent da2bea8 commit 0f80fec

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

haskell-yas.el

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,14 @@
5151
(defun haskell-yas-complete (&rest args)
5252
(apply haskell-yas-completing-function args))
5353

54+
(defconst haskell-snippets-dir
55+
(expand-file-name "snippets" (file-name-directory (or (buffer-file-name) load-file-name))))
56+
5457
;;;###autoload
5558
(defun haskell-snippets-initialize ()
5659
"Register haskell snippets with yasnippet."
57-
(let* ((this-dir (file-name-directory (or (buffer-file-name) load-file-name)))
58-
(haskell-snippets-dir (expand-file-name "snippets" this-dir)))
59-
(add-to-list 'yas-snippet-dirs haskell-snippets-dir t)
60-
(yas-load-directory haskell-snippets-dir)))
60+
(add-to-list 'yas-snippet-dirs haskell-snippets-dir t)
61+
(yas-load-directory haskell-snippets-dir))
6162

6263
;;;###autoload
6364
(eval-after-load 'yasnippet

0 commit comments

Comments
 (0)