summaryrefslogtreecommitdiff
path: root/misc/ruby-electric.el
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-26 09:06:54 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-26 09:06:54 +0000
commit210357fad0bf18d55e044b97c2ad7da422219a8c (patch)
tree87edbf0be8ad2f5ef70a0f7d4efef06557cd0ec2 /misc/ruby-electric.el
parentec723e30bc56f098741e1196a70c73096e7ab010 (diff)
* misc/ruby-electric.el: Import version 2.2.2 from
https://github.com/knu/ruby-electric.el. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'misc/ruby-electric.el')
-rw-r--r--misc/ruby-electric.el21
1 files changed, 14 insertions, 7 deletions
diff --git a/misc/ruby-electric.el b/misc/ruby-electric.el
index e6fb90d..2d84954 100644
--- a/misc/ruby-electric.el
+++ b/misc/ruby-electric.el
@@ -10,7 +10,7 @@
;; URL: https://github.com/knu/ruby-electric.el
;; Keywords: languages ruby
;; License: The same license terms as Ruby
-;; Version: 2.2.1
+;; Version: 2.2.2
;;; Commentary:
;;
@@ -161,11 +161,6 @@ cons, ACTION can be set to one of the following values:
"$"))))
:group 'ruby-electric)
-(defcustom ruby-electric-simple-keywords-re nil
- "Obsolete and ignored. Customize `ruby-electric-keywords-alist'
-instead."
- :type 'regexp :group 'ruby-electric)
-
(defvar ruby-electric-mode-map
(let ((map (make-sparse-keymap)))
(define-key map " " 'ruby-electric-space/return)
@@ -274,7 +269,7 @@ enabled."
(ruby-indent-line)
(save-excursion
(newline)
- (ruby-insert-end)))
+ (ruby-electric-end)))
((eq action 'reindent)
(ruby-indent-line)))
(ruby-electric-space/return-fallback)))
@@ -542,6 +537,18 @@ enabled."
(delete-char 1))))
(delete-char (- arg)))
+(put 'ruby-electric-delete-backward-char 'delete-selection 'supersede)
+
+(defun ruby-electric-end ()
+ (interactive)
+ (if (eq (char-syntax (preceding-char)) ?w)
+ (insert " "))
+ (insert "end")
+ (save-excursion
+ (if (eq (char-syntax (following-char)) ?w)
+ (insert " "))
+ (ruby-indent-line t)))
+
(provide 'ruby-electric)
;;; ruby-electric.el ends here