diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | misc/ruby-electric.el | 8 |
2 files changed, 13 insertions, 4 deletions
@@ -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 ?})) ;; {} |