emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r115042: * lisp/progmodes/ruby-mode.el (ruby-smie--i


From: Dmitry Gutov
Subject: [Emacs-diffs] trunk r115042: * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p):
Date: Sat, 09 Nov 2013 00:00:07 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115042
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Gutov <address@hidden>
branch nick: trunk
timestamp: Sat 2013-11-09 01:59:56 +0200
message:
  * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p):
  Not after "||".
  (ruby-smie-rules): Indent non-hanging "begin" blocks as part of
  their parent.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/ruby-mode.el    
rubymode.el-20091113204419-o5vbwnq5f7feedwu-8804
  test/indent/ruby.rb            ruby.rb-20120424165921-h044139hbrd7snvw-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-11-08 22:53:41 +0000
+++ b/lisp/ChangeLog    2013-11-08 23:59:56 +0000
@@ -1,3 +1,10 @@
+2013-11-08  Dmitry Gutov  <address@hidden>
+
+       * progmodes/ruby-mode.el (ruby-smie--implicit-semi-p):
+       Not after "||".
+       (ruby-smie-rules): Indent non-hanging "begin" blocks as part of
+       their parent.
+
 2013-11-08  Stefan Monnier  <address@hidden>
 
        * progmodes/ruby-mode.el: Don't require cl any more.  Use pcase instead.

=== modified file 'lisp/progmodes/ruby-mode.el'
--- a/lisp/progmodes/ruby-mode.el       2013-11-08 22:53:41 +0000
+++ b/lisp/progmodes/ruby-mode.el       2013-11-08 23:59:56 +0000
@@ -364,6 +364,8 @@
              (and (eq (char-before) ?=)
                   (string-match "\\`\\s." (save-excursion
                                             (ruby-smie--backward-token))))
+             (and (eq (char-before) ?|)
+                  (eq (char-before (1- (point))) ?|))
              (and (eq (car (syntax-after (1- (point)))) 2)
                   (member (save-excursion (ruby-smie--backward-token))
                           '("iuwu-mod" "and" "or")))
@@ -546,6 +548,9 @@
                      "+=" "-=" "*=" "/=" "%=" "**=" "&=" "|=" "^="
                      "<<=" ">>=" "&&=" "||=" "and" "or"))
      (if (smie-rule-parent-p ";" nil) ruby-indent-level))
+    (`(:before . "begin")
+     (unless (save-excursion (skip-chars-backward " \t") (bolp))
+       (smie-rule-parent)))
     ))
 
 (defun ruby-imenu-create-index-in-block (prefix beg end)

=== modified file 'test/indent/ruby.rb'
--- a/test/indent/ruby.rb       2013-11-08 03:30:24 +0000
+++ b/test/indent/ruby.rb       2013-11-08 23:59:56 +0000
@@ -285,9 +285,14 @@
   end
 end
 
-# Failing with SMIE:
-
 foo ||
   begin
     bar
   end
+
+def qux
+  foo ||= begin
+    bar
+    tee
+  end
+end


reply via email to

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