I am new to elisp but I am trying to spice up my .emacs a little.
I am trying to define some paths, but having problems with creating a list of paths (and setting the list for YaSnippet more specifically).
When I evaluate the list I get a list of the symbol name (and not the symbol values as yassnippet want).
I got the code working but have feeling that there is a better way to do this?
Here is the working code:
;; some paths
(setq my-snippets-path "~/.emacs.d/snippets")
(setq default-snippets-path "~/.emacs.d/site-lisp/yasnippet/snippets")
;; set the yas/root-directory to a list of the paths
(setq yas/root-directory `(,my-snippets-path ,default-snippets-path))
;; load the directories
(mapc 'yas/load-directory yas/root-directory)
If you evaluate a list of strings, the result depends on the value of the list items. The best way to test that is to launch the ielm repl (M-x ielm), and enter:
The quoted list of string evaluates to the list value. If you store the value of the list in a variable, and then evaluate the variable, ELisp will complain that the function abc is unknown.
For the yasnippet directory configuration, you should just set yas-snippet-dir instead, e.g.
Edit:
The use of yas/root-directory has been deprecated. From the documentation of yasnippet.el