yas-mode-symbol error visiting erb files #312

ChasManRors opened this Issue Sep 29, 2012 · 3 comments

3 participants


I translated Dr Nic's ruby on rails snippets using your instructions
in (~/.emacs.d/plugins/yasnippet/README.mdown) as of yesterday (today
is Sat Sep 29 10:21:53 2012) I freshly cloned yasnippet

Using Emacs version "24.1.1"

I kept getting an error when I did a find file on an rhtml file

The error was something like unknown sysmbol yas-mode-symbol.

So I changed the following code in .yas-setup.el.


(defvar yas-html-just-like-tm nil
"Html-mode snippets behave as close to TextMate as possible.")

;; (defun yas-html-activate ()
;; (add-to-list (make-local-variable 'yas-mode-symbol) 'html-mode))

;; (add-hook 'nxml-mode-hook 'yas-html-activate)
;; (add-hook 'rhtml-mode-hook 'yas-html-activate)

(add-hook 'nxml-mode-hook 'html-mode)
(add-hook 'rhtml-mode-hook 'html-mode)

I have no idea if what I did was a reasonable thing to do or not but I was getting tired of seeing the error ;)

Thanks in advance for your consideration ;)


After that I restored the original file and restarted emacs. Now I do not see any rails-mode snippets in the pull-down menu for YASnippet>rails-mode


(add-hook 'nxml-mode-hook 'html-mode)

Nothing reasonable here: a major mode function doesn't make sense in a hook.


I'm sorry for the ongoing delay in analysing this, I have very little time to work on yasnippet lately. I agree with @dgutov, though. The problem I think (but I did not test it) is that yas-mode-symbol does not exist at all.yas/mode-symbol still exists but was deprecated and has been replaced by yas-extra-modes (see rails-mode's .yas-setup.el, for example). So that is the problem, i'll commit a fix soon, please test and report back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment