[前][次][番号順一覧][スレッド一覧]

ruby-changes:30972

From: knu <ko1@a...>
Date: Thu, 26 Sep 2013 16:50:27 +0900 (JST)
Subject: [ruby-changes:30972] knu:r43051 (trunk): * misc/ruby-electric.el: Avoid use of the interactive function

knu	2013-09-26 16:50:19 +0900 (Thu, 26 Sep 2013)

  New Revision: 43051

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43051

  Log:
    * 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.

  Modified files:
    trunk/ChangeLog
    trunk/misc/ruby-electric.el
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43050)
+++ ChangeLog	(revision 43051)
@@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Sep 26 16:43:42 2013  Akinori MUSHA  <knu@i...>
+
+	* 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@r...>
 
 	* insns.def (opt_regexpmatch1): check Regexp#=~ is not defined before
Index: misc/ruby-electric.el
===================================================================
--- misc/ruby-electric.el	(revision 43050)
+++ misc/ruby-electric.el	(revision 43051)
@@ -131,7 +131,7 @@ strings. Note that you must have Font Lo https://github.com/ruby/ruby/blob/trunk/misc/ruby-electric.el#L131
 
 (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 Lo https://github.com/ruby/ruby/blob/trunk/misc/ruby-electric.el#L198
          ((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 Lo https://github.com/ruby/ruby/blob/trunk/misc/ruby-electric.el#L294
     (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 ?})) ;; {}

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]