diff options
| author | Stefan Monnier | 2013-10-22 11:45:56 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2013-10-22 11:45:56 -0400 |
| commit | 7790a27058bf9ec3dcdf31746853f125d6c84693 (patch) | |
| tree | d442063842db4cf1366fe6b33277c8695769de36 | |
| parent | a034ece0661ca20229e69e134a31fd1501b391e9 (diff) | |
| download | emacs-7790a27058bf9ec3dcdf31746853f125d6c84693.tar.gz emacs-7790a27058bf9ec3dcdf31746853f125d6c84693.zip | |
* 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.
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/emacs-lisp/smie.el | 3 | ||||
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 14 |
3 files changed, 14 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6e1b8c1373e..0b08cd6bad9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,10 +1,18 @@ | |||
| 1 | 2013-10-22 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | |||
| 4 | * emacs-lisp/smie.el (smie-rule-parent): Fix opener-test. | ||
| 5 | * progmodes/ruby-mode.el (ruby-smie-rules): | ||
| 6 | Remove corresponding workaround. Fix indentation rule of ";" so it | ||
| 7 | also applies when ";" is the parent. | ||
| 8 | |||
| 1 | 2013-10-22 Xue Fuqiao <xfq.free@gmail.com> | 9 | 2013-10-22 Xue Fuqiao <xfq.free@gmail.com> |
| 2 | 10 | ||
| 3 | * frame.el (display-screens, display-pixel-height) | 11 | * frame.el (display-screens, display-pixel-height) |
| 4 | (display-pixel-width, display-mm-width, display-backing-store) | 12 | (display-pixel-width, display-mm-width, display-backing-store) |
| 5 | (display-save-under, display-planes, display-color-cells) | 13 | (display-save-under, display-planes, display-color-cells) |
| 6 | (display-visual-class, display-monitor-attributes-list): Mention | 14 | (display-visual-class, display-monitor-attributes-list): |
| 7 | the optional ‘display’ argument in doc strings. | 15 | Mention the optional ‘display’ argument in doc strings. |
| 8 | 16 | ||
| 9 | 2013-10-22 Michael Gauland <mikelygee@amuri.net> | 17 | 2013-10-22 Michael Gauland <mikelygee@amuri.net> |
| 10 | 18 | ||
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index ebb82f4bf54..f1ffdec5ec4 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el | |||
| @@ -1242,7 +1242,8 @@ Only meaningful when called from within `smie-rules-function'." | |||
| 1242 | ;; rules-function, so it gives it a chance to tweak | 1242 | ;; rules-function, so it gives it a chance to tweak |
| 1243 | ;; indentation (e.g. by forcing indentation relative to | 1243 | ;; indentation (e.g. by forcing indentation relative to |
| 1244 | ;; its own parent, as in fn a => fn b => fn c =>). | 1244 | ;; its own parent, as in fn a => fn b => fn c =>). |
| 1245 | (if (or (listp (car smie--parent)) (smie-indent--hanging-p)) | 1245 | (if (or (not (numberp (car smie--parent))) |
| 1246 | (smie-indent--hanging-p)) | ||
| 1246 | (smie-indent-virtual) (current-column)))))) | 1247 | (smie-indent-virtual) (current-column)))))) |
| 1247 | 1248 | ||
| 1248 | (defvar smie-rule-separator-outdent 2) | 1249 | (defvar smie-rule-separator-outdent 2) |
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index a6e54701ffe..fa681e5cde3 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -444,23 +444,13 @@ explicitly declared in magic comment." | |||
| 444 | ;; should be aligned with the first. | 444 | ;; should be aligned with the first. |
| 445 | (`(:elem . args) (if (looking-at "\\s\"") 0)) | 445 | (`(:elem . args) (if (looking-at "\\s\"") 0)) |
| 446 | ;; (`(:after . ",") (smie-rule-separator kind)) | 446 | ;; (`(:after . ",") (smie-rule-separator kind)) |
| 447 | (`(:after . ";") | 447 | (`(:before . ";") |
| 448 | (cond | 448 | (cond |
| 449 | ((smie-rule-parent-p "def" "begin" "do" "class" "module" "for" | 449 | ((smie-rule-parent-p "def" "begin" "do" "class" "module" "for" |
| 450 | "while" "until" "unless" | 450 | "while" "until" "unless" |
| 451 | "if" "then" "elsif" "else" "when" | 451 | "if" "then" "elsif" "else" "when" |
| 452 | "rescue" "ensure") | 452 | "rescue" "ensure" "{") |
| 453 | (smie-rule-parent ruby-indent-level)) | 453 | (smie-rule-parent ruby-indent-level)) |
| 454 | ((and (smie-rule-parent-p "{") | ||
| 455 | (save-excursion | ||
| 456 | (goto-char (1+ (cadr (smie-indent--parent)))) | ||
| 457 | (ruby-smie--opening-pipe-p) | ||
| 458 | (forward-char -1) | ||
| 459 | ;; Can't delegate to `smie-rule-parent' because it | ||
| 460 | ;; short-circuits to `current-column' when the parent | ||
| 461 | ;; token is of paren syntax class and not hanging. | ||
| 462 | (cons 'column (+ (smie-indent-virtual) | ||
| 463 | ruby-indent-level))))) | ||
| 464 | ;; For (invalid) code between switch and case. | 454 | ;; For (invalid) code between switch and case. |
| 465 | ;; (if (smie-parent-p "switch") 4) | 455 | ;; (if (smie-parent-p "switch") 4) |
| 466 | (t 0))) | 456 | (t 0))) |