* lisp/emacs-lisp/smie.el (smie-rule-parent): Fix opener-test.
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 22 Oct 2013 15:45:56 +0000 (11:45 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 22 Oct 2013 15:45:56 +0000 (11:45 -0400)
* lisp/progmodes/ruby-mode.el (ruby-smie-rules):
Remove corresponding workaround.  Fix indentation rule of ";" so it
also applies when ";" is the parent.

lisp/ChangeLog
lisp/emacs-lisp/smie.el
lisp/progmodes/ruby-mode.el

index 6e1b8c1..0b08cd6 100644 (file)
@@ -1,10 +1,18 @@
+2013-10-22  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+
+       * emacs-lisp/smie.el (smie-rule-parent): Fix opener-test.
+       * progmodes/ruby-mode.el (ruby-smie-rules):
+       Remove corresponding workaround.  Fix indentation rule of ";" so it
+       also applies when ";" is the parent.
+
 2013-10-22  Xue Fuqiao  <xfq.free@gmail.com>
 
        * frame.el (display-screens, display-pixel-height)
        (display-pixel-width, display-mm-width, display-backing-store)
        (display-save-under, display-planes, display-color-cells)
-       (display-visual-class, display-monitor-attributes-list): Mention
-       the optional ‘display’ argument in doc strings.
+       (display-visual-class, display-monitor-attributes-list):
+       Mention the optional ‘display’ argument in doc strings.
 
 2013-10-22  Michael Gauland  <mikelygee@amuri.net>
 
index ebb82f4..f1ffdec 100644 (file)
@@ -1242,7 +1242,8 @@ Only meaningful when called from within `smie-rules-function'."
              ;; rules-function, so it gives it a chance to tweak
              ;; indentation (e.g. by forcing indentation relative to
              ;; its own parent, as in fn a => fn b => fn c =>).
-             (if (or (listp (car smie--parent)) (smie-indent--hanging-p))
+             (if (or (not (numberp (car smie--parent)))
+                    (smie-indent--hanging-p))
                  (smie-indent-virtual) (current-column))))))
 
 (defvar smie-rule-separator-outdent 2)
index a6e5470..fa681e5 100644 (file)
@@ -444,23 +444,13 @@ explicitly declared in magic comment."
     ;; should be aligned with the first.
     (`(:elem . args) (if (looking-at "\\s\"") 0))
     ;; (`(:after . ",") (smie-rule-separator kind))
-    (`(:after . ";")
+    (`(:before . ";")
      (cond
       ((smie-rule-parent-p "def" "begin" "do" "class" "module" "for"
                            "while" "until" "unless"
                            "if" "then" "elsif" "else" "when"
-                           "rescue" "ensure")
+                           "rescue" "ensure" "{")
        (smie-rule-parent ruby-indent-level))
-      ((and (smie-rule-parent-p "{")
-            (save-excursion
-              (goto-char (1+ (cadr (smie-indent--parent))))
-              (ruby-smie--opening-pipe-p)
-              (forward-char -1)
-              ;; Can't delegate to `smie-rule-parent' because it
-              ;; short-circuits to `current-column' when the parent
-              ;; token is of paren syntax class and not hanging.
-              (cons 'column (+ (smie-indent-virtual)
-                               ruby-indent-level)))))
       ;; For (invalid) code between switch and case.
       ;; (if (smie-parent-p "switch") 4)
       (t 0)))