ruby-electric.el (ruby-electric-curlies): Automatically indent "}".

* misc/ruby-electric.el (ruby-electric-curlies): Automatically
  indent closing curly brackets when
  ruby-electric-newline-before-closing-bracket is true.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Fix ruby-electric-curlies.

* misc/ruby-electric.el (ruby-electric-curlies): Fix the bug where
  an open curly is always replaced with a hash sign.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
misc/ruby-electric.el: Avoid electric insertion in some cases.

* misc/ruby-electric.el (ruby-electric-curlies)
  (ruby-electric-matching-char, ruby-electric-bar): Avoid electric
  insertion when there is a prefix argument.

* misc/ruby-electric.el (ruby-electric-insert)
  (ruby-electric-cua-replace-region-p)
  (ruby-electric-cua-replace-region): Avoid electric insertion and
  fall back when cua-mode is enabled and a region is active.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Improve ruby-electric-mode.

* misc/ruby-electric.el (ruby-electric-hash): New electric
  function that expands a hash sign inside a string or regexp to
  "#{}".

* misc/ruby-electric.el (ruby-electric-curlies): Do not insert
  spaces inside when the curly brace is a delimiter of %r, %w,
  etc.

* misc/ruby-electric.el (ruby-electric-curlies): Insert another
  space before a closing curly brace when
  ruby-electric-newline-before-closing-bracket is nil.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove trailing spaces.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
misc/ruby-electric.el: Minor refactoring.

* misc/ruby-electric.el (ruby-electric-insert): Check
  ruby-electric-is-last-command-char-expandable-punct-p here.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
misc/ruby-electric.el: Decrease the excess voltage of automatic matching.

* misc/ruby-electric.el (ruby-electric-closing-char): New
  interactive function bound to closing characters.  Typing one of
  those closing characters right after the matching counterpart
  cancels the effect of automatic closing.  For example, typing
  "{" followed by "}" simply makes "{}" instead of "{ } }".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Replace use of obsolete variable `last-command-char` by @maser [fix GH-290]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e