emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115697: * lisp/progmodes/ruby-mode.el (ruby--electr


From: Dmitry Gutov
Subject: [Emacs-diffs] trunk r115697: * lisp/progmodes/ruby-mode.el (ruby--electric-indent-p): Improve the
Date: Sun, 22 Dec 2013 20:38:32 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115697
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Gutov <address@hidden>
branch nick: trunk
timestamp: Sun 2013-12-22 22:38:26 +0200
message:
  * lisp/progmodes/ruby-mode.el (ruby--electric-indent-p): Improve the
  comments.  Handle electric indent after typing `?' and `!'.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/ruby-mode.el    
rubymode.el-20091113204419-o5vbwnq5f7feedwu-8804
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-12-22 13:40:44 +0000
+++ b/lisp/ChangeLog    2013-12-22 20:38:26 +0000
@@ -1,3 +1,8 @@
+2013-12-22  Dmitry Gutov  <address@hidden>
+
+       * progmodes/ruby-mode.el (ruby--electric-indent-p): Improve the
+       comments.  Handle electric indent after typing `?' and `!'.
+
 2013-12-22  Chong Yidong  <address@hidden>
 
        * faces.el (face-spec-recalc): If the theme specs are not

=== modified file 'lisp/progmodes/ruby-mode.el'
--- a/lisp/progmodes/ruby-mode.el       2013-12-22 06:04:40 +0000
+++ b/lisp/progmodes/ruby-mode.el       2013-12-22 20:38:26 +0000
@@ -779,15 +779,15 @@
 (defun ruby--electric-indent-p (char)
   (cond
    ((memq char ruby--electric-indent-chars)
-    ;; Outdent after typing a closing paren.
+    ;; Reindent after typing a char affecting indentation.
     (ruby--at-indentation-p (1- (point))))
    ((memq (char-after) ruby--electric-indent-chars)
-    ;; Reindent after inserting something before a closing paren.
+    ;; Reindent after inserting something in front of the above.
     (ruby--at-indentation-p (1- (point))))
-   ((or (memq (char-syntax char) '(?w ?_)))
+   ((or (and (>= char ?a) (<= char ?z)) (memq char '(?_ ?? ?! ?:)))
     (let ((pt (point)))
       (save-excursion
-        (skip-syntax-backward "w_")
+        (skip-chars-backward "[:alpha:]:_?!")
         (and (ruby--at-indentation-p)
              (looking-at (regexp-opt (cons "end" ruby-block-mid-keywords)))
              ;; Outdent after typing a keyword.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]