2013-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
+ * progmodes/ruby-mode.el (ruby-smie-rules): Tweak handling of
+ open braces.
+
+ * emacs-lisp/smie.el (smie-next-sexp): Refine last fix.
+
* textmodes/css-mode.el (css-smie-rules): Fix indentation (bug#15467).
(css-mode): Use electric-indent-chars.
(condition-case err
(progn (funcall next-sexp 1) nil)
(scan-error
- (let ((pos (nth 2 err)))
+ (let ((epos (nth 2 err)))
+ (goto-char pos)
(throw 'return
- (list t pos
+ (list t epos
(buffer-substring-no-properties
- pos (+ pos (if (< (point) pos) -1 1))))))))
+ epos
+ (+ epos (if (< (point) epos) -1 1))))))))
(if (eq pos (point))
;; We did not move, so let's abort the loop.
(throw 'return (list t (point))))))
(`(:before . ,(or `"(" `"[" `"{"))
;; Treat purely syntactic block-constructs as being part of their parent,
;; when the opening statement is hanging.
- (if (smie-rule-hanging-p) (smie-rule-parent)))
+ (when (smie-rule-hanging-p)
+ (smie-backward-sexp 'halfsexp) (smie-indent-virtual)))
(`(:after . "=") 2)
(`(:before . "do")
(when (or (smie-rule-hanging-p)