murtaza52
murtaza52

Reputation: 47431

unable to make ruby-electric.el work in emacs

I have installed ruby-electric.el to enable autopairing for def and end. I have required it in the .emacs file and evaluated the buffer.

However when I type 'def' in the buffer I dont see a corresponding 'end' block being added. How do I test what I am doing wrong ?

Upvotes: 0

Views: 110

Answers (1)

Dmitry
Dmitry

Reputation: 3665

You need to enable it in ruby-mode buffers. For example, this way:

(add-hook 'ruby-mode-hook 'ruby-electric-mode)

The end keyword should be added when you type Space after def.

BTW, if you're using the version from this repository, you don't need to do the above, it already adds the hook in an autoload form. This is also the version that's packaged in Tromey's ELPA repository.

Upvotes: 0

Related Questions