I'm test-driving Emacs 25.1 and have noticed that a simple concat
command, which used to work in v.24 (and v.23), doesn't work in v.25.1:
(setq yas-snippet-dirs (concat user-emacs-directory "snippets"))
In v.25.1 I get the following error message:
byte-code: Wrong type argument: listp, "~/Dropbox/emacs/snippets"
To make it work in v.25.1, I need to do call the function thus:
(setq yas-snippet-dirs (concat user-emacs-directory '("snippets")))
So my question is, why doesn't the latter work in Emacs 25.1 anymore? (Or alternatively, is the former the correct way actually?)
(setq yas-snippet-dirs '("~/.emacs.d/elpa/yasnippet-0.8.0/snippets"))
– lawlist Feb 14 '16 at 18:09user-emacs-directory
) with the string "snippets". (I use the same config in different machines with different OSs, so I need to have different dirs in that variable.) – NVaughan Feb 14 '16 at 18:13(cond ((eq system-type 'darwin) (setq yas-snippet-dirs '("~/.emacs.d/elpa/yasnippet-0.8.0/snippets"))) ((eq system-type 'windows-nt) (setq yas-snippet-dirs '("c:/emacs/yasnippet-0.8.0/snippets"))))
And you can even get specific as to what version of Windows if you use different ones -- e.g.,(and (eq system-type 'windows-nt) (equal (w32-version) '(5 1 2600)))
You can also populateyas-snippet-dirs
with more than one path -- it is a list -- so just add more(setq yas-snippet-dirs '("~/.emacs.d/elpa/yasnippet-0.8.0/snippets" "/my/path"))
– lawlist Feb 14 '16 at 18:15user-emacs-directory
. My problem is with the concatenation. – NVaughan Feb 14 '16 at 18:27toggle-debug-on-error
and post the backtrace? I think the error is not triggered by the concatenation at all (and the difference is more likey due to change in yasnippet version than Emacs). By the way, the correct way should be(setq yas-snippet-dirs (list (concat user-emacs-directory "snippets"))
– npostavs Feb 14 '16 at 19:30expand-file-name
instead ofconcat
. – Constantine Feb 14 '16 at 19:32yas-snippet-dirs (list (expand-file-name "snippets" user-emacs-directory))
. – NVaughan Feb 14 '16 at 20:39concat
itself throwing the error, but it's hard to make sense of it due to byte-compilation. Can you loadyasnippet.el
without the elc and redo it? – npostavs Feb 14 '16 at 21:43