I have the following snippet for PHP-mode, called Public.

#contributor : ReneFroger
#name : snippet for public 
# --

# --------------------------------------------------
#  Method f${2:name}.
# --------------------------------------------------
/* R.F: $1 

When I load the snippet into the buffer with PHP-mode, and I type a long sentence (the sentence is longer than the lines (----) as above). Then I get an error message from Yasnippet in another buffer:

Warning (yasnippet): Couldn’t find: "[[:space:] ]#[[:space:] ]--------------------------------------------------[[:space:] ]*#[[:space:] ]*Method[[:space:] ]fname\.[[:space:] ]#[[:space:] ]--------------------------------------------------[[:space:] ]/\*[[:space:] ]R\.F:[[:space:] ]\(\)[[:space:] ]*This[[:space:] ]*is[[:space:] ]*an[[:space:] ]*error[[:space:] ]*that[[:space:] ]*gives[[:space:] ]*a[[:space:] ]*weird[[:space:] ]*error[[:space:] ]*in[[:space:] ]*Yasnippet[[:space:] ]*with[[:space:] ]unclear" Warning (yasnippet): Couldn’t find: "[[:space:] ]#[[:space:]

Before the regular packages update from Melpa (with Yasnippet included), I used this snippet a lot of time and never got this kind of error message.

It seems when entering a space, cause an error with Yasnippet. I googled around, but I couldn't find any explanation why spaces gives troubles with Yasnippet.

Anyone feeling to try this?

  • Sounds like yasnippet/issues#794. What yasnippet version are you using? Do you have auto-fill-mode enabled? – npostavs Apr 23 '17 at 22:18
  • Disabling auto-fill-mode for PHP-mode helped, I don't get any error messages. Is it possible to combine Yasnippet with auto-fill-mode as in the past? I use Yasnippet version 0.11 by the way. . – ReneFroger Apr 26 '17 at 22:40
  • You install from MELPA right? What timestamp does the package have? Does updating help? – npostavs Apr 26 '17 at 22:49
  • (advice-add 'yas--auto-fill-wrapper :override #'ignore) solved my problem. I install from MELPA, indeed. To be sure, I removed the directory Yasnippet and installed it again from MELPA. And I get still the same problem as described above without the advice. Timestamp of yasnippet package is yasnippet-20170418.351. – ReneFroger Apr 27 '17 at 13:00

Your Answer

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

Browse other questions tagged or ask your own question.