aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2013-01-28 05:20:42 +0400
committerDmitry Gutov2013-01-28 05:20:42 +0400
commita324b8c791b5de887168ca14cff86722bdb73d20 (patch)
treec8655f2f975e81f319166d337ed606177bf272cb
parentb162502414d491f6893d962a49a88dfabac86fbf (diff)
downloademacs-a324b8c791b5de887168ca14cff86722bdb73d20.tar.gz
emacs-a324b8c791b5de887168ca14cff86722bdb73d20.zip
* progmodes/ruby-mode.el (ruby-move-to-block): Work with (maybe
temporarily) broken indentation. * automated/ruby-mode-tests.el (ruby-block-test-example): Break indentation of the do block opener and add a line inside it. * automated/ruby-mode-tests.el (works-on-do, ok-with-three): Adjust line numbers.
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/progmodes/ruby-mode.el2
-rw-r--r--test/ChangeLog4
-rw-r--r--test/automated/ruby-mode-tests.el7
4 files changed, 11 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cc30dc82341..7b37b3d21b3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,8 @@
2 2
3 * progmodes/ruby-mode.el (ruby-font-lock-keywords): Remove some 3 * progmodes/ruby-mode.el (ruby-font-lock-keywords): Remove some
4 checks made superfluous by the \_< operator. 4 checks made superfluous by the \_< operator.
5 * progmodes/ruby-mode.el (ruby-move-to-block): Work with (maybe
6 temporarily) broken indentation.
5 7
62013-01-27 Nobuyoshi Nakada <nobu@ruby-lang.org> 82013-01-27 Nobuyoshi Nakada <nobu@ruby-lang.org>
7 9
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 989c00365a0..2c8a5ee4a13 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -905,7 +905,7 @@ current block, a sibling block, or an outer block. Do that (abs N) times."
905 ((and backward (looking-at "^=end\\>")) 905 ((and backward (looking-at "^=end\\>"))
906 (re-search-backward "^=begin\\>")) 906 (re-search-backward "^=begin\\>"))
907 (t 907 (t
908 (setq pos (current-indentation)) 908 (setq pos (ruby-calculate-indent))
909 (cond 909 (cond
910 ;; Deeper indentation, we found a block. 910 ;; Deeper indentation, we found a block.
911 ;; FIXME: We can't recognize empty blocks this way. 911 ;; FIXME: We can't recognize empty blocks this way.
diff --git a/test/ChangeLog b/test/ChangeLog
index 505ac398e2f..7e893ba6768 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -2,6 +2,10 @@
2 2
3 * automated/ruby-mode-tests.el 3 * automated/ruby-mode-tests.el
4 (ruby-indent-spread-args-in-parens): New test. 4 (ruby-indent-spread-args-in-parens): New test.
5 * automated/ruby-mode-tests.el (ruby-block-test-example):
6 Break indentation of the do block opener and add a line inside it.
7 * automated/ruby-mode-tests.el (works-on-do, ok-with-three):
8 Adjust line numbers.
5 9
62013-01-15 Stefan Monnier <monnier@iro.umontreal.ca> 102013-01-15 Stefan Monnier <monnier@iro.umontreal.ca>
7 11
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el
index 42c59a1f3f0..2028c6fad00 100644
--- a/test/automated/ruby-mode-tests.el
+++ b/test/automated/ruby-mode-tests.el
@@ -408,7 +408,8 @@ VALUES-PLIST is a list with alternating index and value elements."
408 | end 408 | end
409 | 409 |
410 | def baz 410 | def baz
411 | some do 411 |some do
412 |3
412 | end 413 | end
413 | end 414 | end
414 |end")) 415 |end"))
@@ -425,7 +426,7 @@ VALUES-PLIST is a list with alternating index and value elements."
425(ruby-deftest-move-to-block works-on-do 426(ruby-deftest-move-to-block works-on-do
426 (goto-line 11) 427 (goto-line 11)
427 (ruby-end-of-block) 428 (ruby-end-of-block)
428 (should (= 12 (line-number-at-pos))) 429 (should (= 13 (line-number-at-pos)))
429 (ruby-beginning-of-block) 430 (ruby-beginning-of-block)
430 (should (= 11 (line-number-at-pos)))) 431 (should (= 11 (line-number-at-pos))))
431 432
@@ -437,7 +438,7 @@ VALUES-PLIST is a list with alternating index and value elements."
437(ruby-deftest-move-to-block ok-with-three 438(ruby-deftest-move-to-block ok-with-three
438 (goto-line 2) 439 (goto-line 2)
439 (ruby-move-to-block 3) 440 (ruby-move-to-block 3)
440 (should (= 13 (line-number-at-pos)))) 441 (should (= 14 (line-number-at-pos))))
441 442
442(ruby-deftest-move-to-block ok-with-minus-two 443(ruby-deftest-move-to-block ok-with-minus-two
443 (goto-line 10) 444 (goto-line 10)