5

When I use yasnippet, I keep getting this error:

Warning (yasnippet): `foo-snippet' modified buffer in a backquote expression.
To hide this warning, add (yasnippet backquote-change) to `warning-suppress-types'.

I added this line to my config:

(setq warning-suppress-types (quote ((\(yasnippet\ backquote-change\))))) 

But it doesn't seem to have worked.

6

warning-suppress-types is a list defined in the warnings package. You first need to load this package with:

(require 'warnings)

and after this, add the warning using add-to-list:

(add-to-list 'warning-suppress-types '(yasnippet backquote-change))
  • 1
    I added that line but I'm getting an error: dixit.ca/stackexchange/backquote.html – incandescentman Jul 11 '16 at 19:42
  • 1
    This is the error I get: Debugger entered--Lisp error: (void-variable warning-suppress-types) (member (quote (yasnippet backquote-change)) – incandescentman Jul 12 '16 at 4:20
  • What version of emacs are you on? – Gastove Jul 13 '16 at 16:46
  • 2
    Apologies, I have no idea what's causing that for you -- that variable should be baked in to Emacs after 22.1, by my understanding. What do you get if you remove that erroring line, start Emacs, and do M-x describe-variable <ret> warning-suppress-types <ret>? – Gastove Jul 15 '16 at 17:00
  • 1
    I think this should be wrapped in (eval-after-load 'warnings ...), or needs a (require 'warnings) first. – npostavs Jun 14 '17 at 17:50
1

Alternate answer is to fix foo-snippet so that it no longer modifies the buffer in backquote expression. See https://emacs.stackexchange.com/a/24062/5296 for some examples.

Also note that there was a bug causing yasnippet to issue this warning even when other buffers were being modified, so make sure you have the latest yasnippet (or else the current stable release (0.10) which doesn't have this warning at all). See https://github.com/joaotavora/yasnippet/issues/716

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.