I've been updating my emacs config with the use of Rsense to allow for an autocomplete drop down box to appear whilst typing code. This works well in most files except I've found it doesn't allow me to select an answer from the table when I'm editing some code in my ruby on rails project.
Here is my setup: https://github.com/map7/simple_emacs
I'm using this under Ubuntu 10.04.
For simple ruby script files it works great. I can open up a new file and type.
"test".up...
Just as I type the 'p' character in up a list of options appear and I can go up and down the list with arrow keys and select one (eg: upcase) with the enter key.
What doesn't work is when I do the exact same test but within a rails project's base directory.
Update:
Found that the problem is with (require 'rails), so it's something in the emacs-rails plugin that the autocomplete doesn't like.
Update:
It's within emacs-rails -> rails-project.el. If I comment this macro out then autocomplete works, otherwise it doesn't:
(defmacro* rails-project:with-root ((root) &body body)
"If you use `rails-project:root' or functions related on it
several times in a block of code, you can optimize your code by
using this macro. Also, blocks of code will be executed only if
rails-root exist.
(rails-project:with-root (root)
(foo root)
(bar (rails-core:file \"some/path\")))
"
`(let ((,root (rails-project:root)))
(when ,root
(flet ((rails-project:root () ,root))
,@body))))
Can someone explain why this breaks autocomplete?