Subject: bug#12851: closed (Re: Bug 12851)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 12 Nov 2012 01:31:02 +0000

Your bug report

#12851: Revert the change to ruby-move-to-block from 109576

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
12851: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12851
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: Bug 12851
From: Dmitry Gutov <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: [email-masked]
Date: Mon, 12 Nov 2012 05:30:14 +0400
List-Id: <debbugs-submit.debbugs.gnu.org>

On 12.11.2012 3:03, Stefan Monnier wrote:
>> Could you give me the go-ahead?
>> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12851
>
> Oh, sorry, yes please go ahead,

Thanks, installed.

Subject: Revert the change to ruby-move-to-block from 109576
From: Dmitry Gutov <[email-masked]>
To: [email-masked]
Date: Sat, 10 Nov 2012 07:15:36 +0400
List-Id: <debbugs-submit.debbugs.gnu.org>

I want to commit this patch to emacs-24. Is that okay?

The change is not particularly useful by itself, it changes 
`ruby-beginning-of-block' and `ruby-backward-sexp' behavior (making 
things more complicated for third-party code), and, while fixing the 
round-trip problem (*) for "something do\nend", introduces it for "def 
foo\nend".

(*) When the point is at the end of block, we want (progn 
(ruby-beginning-of-block) (ruby-end-of-block)) to bring us back to where 
we were at the start.
=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog	2012-11-05 16:32:35 +0000
+++ lisp/ChangeLog	2012-11-10 03:00:13 +0000
@@ -1,3 +1,9 @@
+2012-11-10  Dmitry Gutov  <[email-masked]>
+
+	* progmodes/ruby-mode.el (ruby-move-to-block): When moving
+	backward, always stop at indentation.  Reverts the change from
+	109576.
+
 2012-11-05  AgustГn MartГn Domingo  <[email-masked]>
 
 	* textmodes/ispell.el (ispell-program-name): Update

=== modified file 'lisp/progmodes/ruby-mode.el'
--- lisp/progmodes/ruby-mode.el	2012-09-24 11:39:33 +0000
+++ lisp/progmodes/ruby-mode.el	2012-11-10 02:51:09 +0000
@@ -898,17 +898,7 @@
             (back-to-indentation)
             (if (looking-at (concat "\\<\\(" ruby-block-mid-re "\\)\\>"))
                 (setq done nil)))))
-    (back-to-indentation)
-    (when (< n 0)
-      (let ((eol (point-at-eol)) state next)
-        (if (< orig eol) (setq eol orig))
-        (setq orig (point))
-        (while (and (setq next (apply 'ruby-parse-partial eol state))
-                    (< (point) eol))
-          (setq state next))
-        (when (cdaadr state)
-          (goto-char (cdaadr state)))
-        (backward-word)))))
+    (back-to-indentation)))
 
 (defun ruby-beginning-of-block (&optional arg)
   "Move backward to the beginning of the current block.

=== modified file 'test/automated/ruby-mode-tests.el'
--- test/automated/ruby-mode-tests.el	2012-09-18 22:10:19 +0000
+++ test/automated/ruby-mode-tests.el	2012-11-10 03:01:43 +0000
@@ -202,13 +202,13 @@
    |  end
    |"))
 
-(ert-deftest ruby-move-to-block-stops-at-opening ()
+(ert-deftest ruby-move-to-block-stops-at-indentation ()
   (with-temp-buffer
     (insert "def f\nend")
     (beginning-of-line)
     (ruby-mode)
     (ruby-move-to-block -1)
-    (should (looking-at "f$"))))
+    (should (looking-at "^def"))))
 
 (ert-deftest ruby-toggle-block-to-do-end ()
   (with-temp-buffer