aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-26 07:50:19 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-26 07:50:19 +0000
commit26f7f7da272cfa4ad4a81758d4caef6528b6efbd (patch)
tree411dc6b87838249835c97249e9b24167b56842f4
parentb18151cf537680862dec24899a3dee469356db57 (diff)
downloadruby-26f7f7da272cfa4ad4a81758d4caef6528b6efbd.tar.gz
* misc/ruby-electric.el: Avoid use of the interactive function
`self-insert-command` which fires `post-self-insert-hook` and `post-command-hook`, to make the ruby-electric commands work nicely with those minor modes that make use of them to do similar input assistance, such as electric-pair-mode, autopair-mode and smartparens-mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog9
-rw-r--r--misc/ruby-electric.el8
2 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 6e9917c0d6..f493fe332e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Thu Sep 26 16:43:42 2013 Akinori MUSHA <knu@iDaemons.org>
+
+ * misc/ruby-electric.el: Avoid use of the interactive function
+ `self-insert-command` which fires `post-self-insert-hook` and
+ `post-command-hook`, to make the ruby-electric commands work
+ nicely with those minor modes that make use of them to do
+ similar input assistance, such as electric-pair-mode,
+ autopair-mode and smartparens-mode.
+
Thu Sep 26 16:24:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
* insns.def (opt_regexpmatch1): check Regexp#=~ is not defined before
diff --git a/misc/ruby-electric.el b/misc/ruby-electric.el
index 632bc4fb76..04eb1494dc 100644
--- a/misc/ruby-electric.el
+++ b/misc/ruby-electric.el
@@ -131,7 +131,7 @@ strings. Note that you must have Font Lock enabled."
(defun ruby-electric-space (arg)
(interactive "P")
- (self-insert-command (prefix-numeric-value arg))
+ (insert (make-string (prefix-numeric-value arg) last-command-event))
(if (ruby-electric-space-can-be-expanded-p)
(save-excursion
(ruby-indent-line t)
@@ -198,11 +198,11 @@ strings. Note that you must have Font Lock enabled."
((and
(null ,arg)
(ruby-electric-is-last-command-char-expandable-punct-p))
- (self-insert-command 1)
+ (insert last-command-event)
,@body)
(t
(setq this-command 'self-insert-command)
- (self-insert-command (prefix-numeric-value ,arg)))))
+ (insert (make-string (prefix-numeric-value ,arg) last-command-event)))))
(defun ruby-electric-curlies(arg)
(interactive "P")
@@ -294,7 +294,7 @@ strings. Note that you must have Font Lock enabled."
(ruby-electric-cua-replace-region))
(arg
(setq this-command 'self-insert-command)
- (self-insert-command (prefix-numeric-value arg)))
+ (insert (make-string (prefix-numeric-value arg) last-command-event)))
((and
(eq last-command 'ruby-electric-curlies)
(= last-command-event ?})) ;; {}