From unknown Thu Sep 11 23:31:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12851: Revert the change to ruby-move-to-block from 109576 Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Nov 2012 03:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12851 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 12851@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.135251736827041 (code B ref -1); Sat, 10 Nov 2012 03:17:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 Nov 2012 03:16:08 +0000 Received: from localhost ([127.0.0.1]:58616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TX1YF-000725-3D for submit@debbugs.gnu.org; Fri, 09 Nov 2012 22:16:07 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48621) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TX1Y0-00071U-0p for submit@debbugs.gnu.org; Fri, 09 Nov 2012 22:16:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TX1Xo-00073q-EA for submit@debbugs.gnu.org; Fri, 09 Nov 2012 22:15:41 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:60166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TX1Xo-00073l-AM for submit@debbugs.gnu.org; Fri, 09 Nov 2012 22:15:40 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TX1Xn-0006ed-Bp for bug-gnu-emacs@gnu.org; Fri, 09 Nov 2012 22:15:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TX1Xm-00073a-72 for bug-gnu-emacs@gnu.org; Fri, 09 Nov 2012 22:15:39 -0500 Received: from mail-lb0-f169.google.com ([209.85.217.169]:53215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TX1Xl-00073W-TZ for bug-gnu-emacs@gnu.org; Fri, 09 Nov 2012 22:15:38 -0500 Received: by mail-lb0-f169.google.com with SMTP id s4so139522lbc.0 for ; Fri, 09 Nov 2012 19:15:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :content-type; bh=3nllNiTpMPBT1QfruddS/jGBE5FrK9cs2CfQSzgcR6s=; b=h8pMlN8PSekKDVl864snpSCWmUKSUi6MZhX5AOZBMajcsOMdID/hoFLQNCHTmXJQXT qFf0NvEe1GA46LOrMn87L/Orv0wRYmajv6yKmsTom9UdlIk64eoktnyUfOBQF9thSNVj fu5yDVrgBkRFsNdcartE8DVMRVUz6MVNDdjLIUHg7gNclI/1DRNA9MUs8yAi/pyXX526 EWQKxcDgNYn7Rfvro4pEPSBrVrvivz9InHkkiAcnsmkWyjWViuDEx+ICRw2c4Y6Ryqzx 5ebxpl9B5a8oTBNkYPMQduZxiZYXVqW7inRCN0B1ZAnMVp3U8HuEbqzPh8kiWwwIBgoG WirA== Received: by 10.152.106.110 with SMTP id gt14mr12213857lab.1.1352517336445; Fri, 09 Nov 2012 19:15:36 -0800 (PST) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPS id eo4sm96168lbb.5.2012.11.09.19.15.35 (version=SSLv3 cipher=OTHER); Fri, 09 Nov 2012 19:15:35 -0800 (PST) Message-ID: <509DC6D8.6020200@yandex.ru> Date: Sat, 10 Nov 2012 07:15:36 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010906040001020604090704" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) This is a multi-part message in MIME format. --------------010906040001020604090704 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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. --------------010906040001020604090704 Content-Type: text/plain; charset=windows-1251; name="ruby-move-to-block-revert.diff" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="ruby-move-to-block-revert.diff" === 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 + + * 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 * 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 --------------010906040001020604090704-- From unknown Thu Sep 11 23:31:30 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Dmitry Gutov Subject: bug#12851: closed (Re: Bug 12851) Message-ID: References: <50A05126.5040702@yandex.ru> <509DC6D8.6020200@yandex.ru> X-Gnu-PR-Message: they-closed 12851 X-Gnu-PR-Package: emacs Reply-To: 12851@debbugs.gnu.org Date: Mon, 12 Nov 2012 01:31:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1352683862-3722-1" This is a multi-part message in MIME format... ------------=_1352683862-3722-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 12851@debbugs.gnu.org. --=20 12851: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D12851 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1352683862-3722-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 12851-done) by debbugs.gnu.org; 12 Nov 2012 01:30:41 +0000 Received: from localhost ([127.0.0.1]:34026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TXirI-0000xH-29 for submit@debbugs.gnu.org; Sun, 11 Nov 2012 20:30:41 -0500 Received: from mail-lb0-f172.google.com ([209.85.217.172]:49599) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TXirE-0000x9-Q0 for 12851-done@debbugs.gnu.org; Sun, 11 Nov 2012 20:30:37 -0500 Received: by mail-lb0-f172.google.com with SMTP id y2so1163491lbk.3 for <12851-done@debbugs.gnu.org>; Sun, 11 Nov 2012 17:30:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=lDeE+VWrbRU2hQJ5/6dmf4vYh1WJ1CzAaoGJ3eeL9dg=; b=C0/PCJ1lzJJIgm1KBmYsM+jLz8T/nV9rdD7FJda/5cC1zh8h8AGzw4mOrSC6dXk8WO e2TsIkCUlWNkonMjlfUks5kFs54VRZbAwGXJkLH5ZjxFdbqtq/dqPqHOvDWQPm9ImGwZ 9wMXT3Lr/ZDfoFrijTCG6L4jXsUQSzvaRjuMVSDLaT9ntTa8zS/LAX0ApNz7QTJx/Rq4 uVx+Ng9shhJUdgV7SV7cQLPH5kGyvOAowiwu8OnaV5eYJCl7Tug/MUbkTYtkZ2QRWY7T wCfbefK3hp6QgrNlJ7RIXpP4OQYGmsSf5q4XuGV2pLa7tPWzXL4CjNkO1nGiELDc2Qo4 PziQ== Received: by 10.112.36.42 with SMTP id n10mr7320200lbj.42.1352683814384; Sun, 11 Nov 2012 17:30:14 -0800 (PST) Received: from [192.168.1.2] ([178.252.98.87]) by mx.google.com with ESMTPS id g5sm1876697lbk.7.2012.11.11.17.30.12 (version=SSLv3 cipher=OTHER); Sun, 11 Nov 2012 17:30:13 -0800 (PST) Message-ID: <50A05126.5040702@yandex.ru> Date: Mon, 12 Nov 2012 05:30:14 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Stefan Monnier Subject: Re: Bug 12851 References: <509FF264.9020508@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 12851-done Cc: 12851-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) 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. ------------=_1352683862-3722-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 10 Nov 2012 03:16:08 +0000 Received: from localhost ([127.0.0.1]:58616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TX1YF-000725-3D for submit@debbugs.gnu.org; Fri, 09 Nov 2012 22:16:07 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48621) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TX1Y0-00071U-0p for submit@debbugs.gnu.org; Fri, 09 Nov 2012 22:16:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TX1Xo-00073q-EA for submit@debbugs.gnu.org; Fri, 09 Nov 2012 22:15:41 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:60166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TX1Xo-00073l-AM for submit@debbugs.gnu.org; Fri, 09 Nov 2012 22:15:40 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TX1Xn-0006ed-Bp for bug-gnu-emacs@gnu.org; Fri, 09 Nov 2012 22:15:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TX1Xm-00073a-72 for bug-gnu-emacs@gnu.org; Fri, 09 Nov 2012 22:15:39 -0500 Received: from mail-lb0-f169.google.com ([209.85.217.169]:53215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TX1Xl-00073W-TZ for bug-gnu-emacs@gnu.org; Fri, 09 Nov 2012 22:15:38 -0500 Received: by mail-lb0-f169.google.com with SMTP id s4so139522lbc.0 for ; Fri, 09 Nov 2012 19:15:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :content-type; bh=3nllNiTpMPBT1QfruddS/jGBE5FrK9cs2CfQSzgcR6s=; b=h8pMlN8PSekKDVl864snpSCWmUKSUi6MZhX5AOZBMajcsOMdID/hoFLQNCHTmXJQXT qFf0NvEe1GA46LOrMn87L/Orv0wRYmajv6yKmsTom9UdlIk64eoktnyUfOBQF9thSNVj fu5yDVrgBkRFsNdcartE8DVMRVUz6MVNDdjLIUHg7gNclI/1DRNA9MUs8yAi/pyXX526 EWQKxcDgNYn7Rfvro4pEPSBrVrvivz9InHkkiAcnsmkWyjWViuDEx+ICRw2c4Y6Ryqzx 5ebxpl9B5a8oTBNkYPMQduZxiZYXVqW7inRCN0B1ZAnMVp3U8HuEbqzPh8kiWwwIBgoG WirA== Received: by 10.152.106.110 with SMTP id gt14mr12213857lab.1.1352517336445; Fri, 09 Nov 2012 19:15:36 -0800 (PST) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPS id eo4sm96168lbb.5.2012.11.09.19.15.35 (version=SSLv3 cipher=OTHER); Fri, 09 Nov 2012 19:15:35 -0800 (PST) Message-ID: <509DC6D8.6020200@yandex.ru> Date: Sat, 10 Nov 2012 07:15:36 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: Revert the change to ruby-move-to-block from 109576 Content-Type: multipart/mixed; boundary="------------010906040001020604090704" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) This is a multi-part message in MIME format. --------------010906040001020604090704 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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. --------------010906040001020604090704 Content-Type: text/plain; charset=windows-1251; name="ruby-move-to-block-revert.diff" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="ruby-move-to-block-revert.diff" === 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 + + * 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 * 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 --------------010906040001020604090704-- ------------=_1352683862-3722-1--