Pregunta

I setup python support for emacs using rope and yasnippet by following the tutorial given at http://www.enigmacurry.com/2009/01/21/autocompleteel-python-code-completion-in-emacs/#disqus_thread. I declared a string variable a_str="Hello". Now when i type a_str. and press tab, i get the following message in the minibuffer

Symbol's function definition is void: yas/snippet-table

I was getting a drop-down earlier but suddenly this has stopped working. Any reason why this could be happening ?

Also,i would like to know the meaning of the line

(setq yas/trigger-key (kbd "C-c <kp-multiply>"))

Please Help Thank You

¿Fue útil?

Solución

(setq yas/trigger-key (kbd "C-c <kp-multiply>"))

means: generate the internal representation for the key binding described by the string C-c <kp-multiply>, and assign that value to the variable yas/trigger-key.

(<kp-multiply> would generally be the * key on the keypad.)

You could then subsequently use yas/trigger-key in key-bindings. e.g.:

(local-set-key yas/trigger-key 'some-function)

As for your main error, either something is not being loaded correctly (such that yas/snippet-table does exist in code, but isn't being loaded before it's used), or else there is an incompatibility between Yasnippet and another library which is trying to use it (presumably autocomplete in this case).

I see at the bottom of the comments thread you linked to that there was discussion at the time about a similar error being caused by changes in autocomplete 0.2 over 0.1. I also see that the tutorial author links to his git repository for his own Emacs config, and is still using version 0.1 of autocomplete there.

So I'd suggest checking your versions of each library first. The tutorial uses:

  • pymacs 0.23
  • yasnippet 0.5.9
  • autocomplete 0.1

The Rope version is unclear, and described only as "the very latest development version (as of December '08)"

Alternatively, you might prefer to grab the versions directly from that git repository (especially as the version of yasnippet in the repo says that it's version 0.2.2, not 0.5.9).

If you get it working with those, you could then try upgrading things (and perhaps adding a comment to that thread listing a set of compatible versions, if you come up with a working combination which is more recent).

Failing that, here's another git repository which might be useful:

https://github.com/gabrielelanaro/emacs-for-python/

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top