aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2012-11-12 05:11:06 +0400
committerDmitry Gutov2012-11-12 05:11:06 +0400
commitd1e1e53dec51a9cb8aa9d6033d32428051ab7e85 (patch)
tree2acc4eaad376323cae41de08dcb66196858ce658
parenta1d3e07e2896faadfd56b35a8c5f775353f39058 (diff)
downloademacs-d1e1e53dec51a9cb8aa9d6033d32428051ab7e85.tar.gz
emacs-d1e1e53dec51a9cb8aa9d6033d32428051ab7e85.zip
* lisp/progmodes/ruby-mode.el (ruby-move-to-block): When moving
backward, always stop at indentation. Reverts the change from 2012-08-12T22:06:56Z!monnier@iro.umontreal.ca. Fixes: debbugs:12851
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/progmodes/ruby-mode.el12
-rw-r--r--test/automated/ruby-mode-tests.el4
3 files changed, 9 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8228d857233..bfd74a15a8a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12012-11-12 Dmitry Gutov <dgutov@yandex.ru>
2
3 * progmodes/ruby-mode.el (ruby-move-to-block): When moving
4 backward, always stop at indentation. Reverts the change from
5 2012-08-12T22:06:56Z!monnier@iro.umontreal.ca (Bug#12851).
6
12012-11-11 Glenn Morris <rgm@gnu.org> 72012-11-11 Glenn Morris <rgm@gnu.org>
2 8
3 * ibuffer.el (ibuffer-mode-map, ibuffer-mode): 9 * ibuffer.el (ibuffer-mode-map, ibuffer-mode):
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 84cf7308d75..e4bfffa73c1 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -898,17 +898,7 @@ or blocks containing the current block."
898 (back-to-indentation) 898 (back-to-indentation)
899 (if (looking-at (concat "\\<\\(" ruby-block-mid-re "\\)\\>")) 899 (if (looking-at (concat "\\<\\(" ruby-block-mid-re "\\)\\>"))
900 (setq done nil))))) 900 (setq done nil)))))
901 (back-to-indentation) 901 (back-to-indentation)))
902 (when (< n 0)
903 (let ((eol (point-at-eol)) state next)
904 (if (< orig eol) (setq eol orig))
905 (setq orig (point))
906 (while (and (setq next (apply 'ruby-parse-partial eol state))
907 (< (point) eol))
908 (setq state next))
909 (when (cdaadr state)
910 (goto-char (cdaadr state)))
911 (backward-word)))))
912 902
913(defun ruby-beginning-of-block (&optional arg) 903(defun ruby-beginning-of-block (&optional arg)
914 "Move backward to the beginning of the current block. 904 "Move backward to the beginning of the current block.
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el
index ba3040577b1..8da0041e9a4 100644
--- a/test/automated/ruby-mode-tests.el
+++ b/test/automated/ruby-mode-tests.el
@@ -202,13 +202,13 @@ VALUES-PLIST is a list with alternating index and value elements."
202 | end 202 | end
203 |")) 203 |"))
204 204
205(ert-deftest ruby-move-to-block-stops-at-opening () 205(ert-deftest ruby-move-to-block-stops-at-indentation ()
206 (with-temp-buffer 206 (with-temp-buffer
207 (insert "def f\nend") 207 (insert "def f\nend")
208 (beginning-of-line) 208 (beginning-of-line)
209 (ruby-mode) 209 (ruby-mode)
210 (ruby-move-to-block -1) 210 (ruby-move-to-block -1)
211 (should (looking-at "f$")))) 211 (should (looking-at "^def"))))
212 212
213(ert-deftest ruby-toggle-block-to-do-end () 213(ert-deftest ruby-toggle-block-to-do-end ()
214 (with-temp-buffer 214 (with-temp-buffer