Ruby Electric Minor Mode

D

Dee Zsombor

Greetings Everyone!

I've have implemented a simple Emacs/XEmacs minor mode for editing Ruby
files with following capabilities:

(*) automatic insertion of 'end' after block level keywords like
'module', 'class', 'def', 'if' (...). Conditional statement modifiers
as well as 'do' are handled correctly.

(*) matching pair completion for delimiters {|(["'`. Matching does not
happen inside strings or comments. Except for curly braces that are
completed whenever using value substitution with the "#{expression}"
syntax.

(*) provides custom support to enable/disable particular completions.

You can download it from
http://shylock.uw.hu/Emacs/ruby-electric.el

Suggestions are welcomed,
Zsombor

My blog: http://deezsombor.blogspot.com
 
B

Brian Schröder

Greetings Everyone!

I've have implemented a simple Emacs/XEmacs minor mode for editing Ruby
files with following capabilities:

(*) automatic insertion of 'end' after block level keywords like
'module', 'class', 'def', 'if' (...). Conditional statement modifiers
as well as 'do' are handled correctly.

(*) matching pair completion for delimiters {|(["'`. Matching does not
happen inside strings or comments. Except for curly braces that are
completed whenever using value substitution with the "#{expression}"
syntax.

(*) provides custom support to enable/disable particular completions.

You can download it from
http://shylock.uw.hu/Emacs/ruby-electric.el

Suggestions are welcomed,
Zsombor

My blog: http://deezsombor.blogspot.com

Thanks a lot, I searched for this just last week.

Regards,

Brian
 
G

Guillaume Marcais

Hi Guillaume!

First of all thanks for reporting this miss beahavioure.

Thanks to you for the code and the fix. It works now :)


I am not an emacs elisp expert by any stretch, but how hard would it be
to add the highlighting of if/def/class when the cursor is on the
matching end (and conversely)? The same way as it is done for the braces
{}. I would love to see this happening one day.

Guillaume.
It seems to load OK, but when I type class or module or any other
keyword asking for end, I get the following error in the minibuffer:

Wrong number of arguments: #[(arg) "^[v\207" [arg] 1 1345670 "p"], 0

$ emacs --version
GNU Emacs 21.3.2

Any suggestion?

Guillaume.

Greetings Everyone!

I've have implemented a simple Emacs/XEmacs minor mode for editing Ruby
files with following capabilities:

(*) automatic insertion of 'end' after block level keywords like
'module', 'class', 'def', 'if' (...). Conditional statement modifiers
as well as 'do' are handled correctly.

(*) matching pair completion for delimiters {|(["'`. Matching does not
happen inside strings or comments. Except for curly braces that are
completed whenever using value substitution with the "#{expression}"
syntax.

(*) provides custom support to enable/disable particular completions.

You can download it from
http://shylock.uw.hu/Emacs/ruby-electric.el

Suggestions are welcomed,
Zsombor

My blog: http://deezsombor.blogspot.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top