Commit d2e0e795 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/emacs-lisp/smie.el (smie-next-sexp): Refine last fix.

* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Tweak handling of
open braces.
parent bdc6b4c8
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.
......
......@@ -709,11 +709,13 @@ Possible return values:
(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))))))
......
......@@ -414,7 +414,8 @@ Also ignores spaces after parenthesis when 'space."
(`(: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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment