Fix detection of current file name (#209)

Fixes #208
This commit is contained in:
Philipp 2017-09-03 17:57:16 +02:00 committed by Andrea Crotti
parent 77db04c75a
commit a0bd5a05a7
1 changed files with 8 additions and 2 deletions

View File

@ -31,8 +31,14 @@
(require 'yasnippet)
(setq yasnippet-snippets-dir (file-name-directory (or (buffer-file-name)
load-file-name)))
(setq yasnippet-snippets-dir
(file-name-directory
;; Copied from f-this-file from f.el.
(cond
(load-in-progress load-file-name)
((and (boundp 'byte-compile-current-file) byte-compile-current-file)
byte-compile-current-file)
(:else (buffer-file-name)))))
;;;###autoload
(defun yasnippet-snippets-initialize ()