* lisp/emacs-lisp/smie.el (smie-rule-parent): Fix opener-test.

* lisp/progmodes/ruby-mode.el (ruby-smie-rules):
Remove corresponding workaround.  Fix indentation rule of ";" so it
also applies when ";" is the parent.
This commit is contained in:
Stefan Monnier 2013-10-22 11:45:56 -04:00
parent a034ece066
commit 7790a27058
3 changed files with 14 additions and 15 deletions

View 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>

View 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)

View 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)))