Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Improved ruby-electric mode
Emacs Lisp
branch: master

This branch is 11 commits ahead, 25 commits behind qoobaa:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
LICENSE
README.org
ruby-electric.el

README.org

ruby-electric.el

Due credit: this work was inspired by a code snippet posted by Frederick Ros at http://rubygarden.org/ruby?EmacsExtensions.

This is a fork of https://github.com/qoobaa/ruby-electric, intended to focus on only uniquely rubyish electric logic. All the characters removed (“, ‘, {}, [], and ()) are better handled by autopair.el (http://code.google.com/p/autopair/)

Following improvements were added:

  • more picky about inserting end symbols
  • proper closing of pipes for specifying arguments to blocks
  • remove all generally syntactically significant characters
  • handling of strings of type ‘here document’
  • more keywords, with special handling for ‘do’
  • packaged into a minor mode

Usage:

  1. copy ruby-electric.el into directory where emacs can find it.
  2. modify your startup file (.emacs or whatever) by adding following line:

    (require ‘ruby-electric)

  3. toggle Ruby Electric Mode on/off with ruby-electric-mode.

Changelog:

2005/Jan/14: inserts matching pair delimiters like {, [, (, ‘, “, ’ and | .

2005/Jan/14: added basic Custom support for configuring keywords with electric closing.

2005/Jan/18: more Custom support for configuring characters for which matching expansion should occur.

2005/Jan/18: no longer uses ‘looking-back’ or regexp character classes like [:space:] since they are not implemented on XEmacs.

2005/Feb/01: explicitly provide default argument of 1 to ‘backward-word’ as it requires it on Emacs 21.3

2005/Mar/06: now stored inside ruby CVS; customize pages now have ruby as parent; cosmetic fixes.

2011/Jun/10: remove pair delimeters, more pessimistically insert ‘|’ and ‘end’

Something went wrong with that request. Please try again.