From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#39376: [PATCH] Throw error when calling reverse-region on a single line Date: Sat, 15 Feb 2020 10:51:54 +0200 Message-ID: <838sl4nsgl.fsf@gnu.org> References: <20200131212624.4658-1-philip@warpmail.net> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="81407"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 39376-done@debbugs.gnu.org To: Philip K Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 15 09:52:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j2tBM-000L5Z-6V for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Feb 2020 09:52:12 +0100 Original-Received: from localhost ([::1]:49394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2tBL-0001nv-9J for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Feb 2020 03:52:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36244) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2tBD-0001kX-H8 for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2020 03:52:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2tBC-00087E-MX for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2020 03:52:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57273) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2tBC-00086x-JU for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2020 03:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j2tBC-0000eH-J4 for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2020 03:52:02 -0500 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Feb 2020 08:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 39376 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 39376@debbugs.gnu.org, eliz@gnu.org, philip@warpmail.net Original-Received: via spool by 39376-done@debbugs.gnu.org id=D39376.15817567182481 (code D ref 39376); Sat, 15 Feb 2020 08:52:02 +0000 Original-Received: (at 39376-done) by debbugs.gnu.org; 15 Feb 2020 08:51:58 +0000 Original-Received: from localhost ([127.0.0.1]:35012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j2tB8-0000dw-IS for submit@debbugs.gnu.org; Sat, 15 Feb 2020 03:51:58 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j2tB5-0000di-Lm for 39376-done@debbugs.gnu.org; Sat, 15 Feb 2020 03:51:56 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j2tAz-0007sJ-2Z; Sat, 15 Feb 2020 03:51:49 -0500 Original-Received: from [176.228.60.248] (port=2966 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j2tAy-0001Hv-Hs; Sat, 15 Feb 2020 03:51:48 -0500 In-reply-to: <20200131212624.4658-1-philip@warpmail.net> (message from Philip K on Fri, 31 Jan 2020 22:26:24 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:176083 Archived-At: > From: Philip K > Date: Fri, 31 Jan 2020 22:26:24 +0100 > > The current implementation of reverse region will delete everything > following the current line, if the region marks only a part of a > line. This is because the algorithm implemented below accidentally > deletes all following lines, and fails before being able to reinsert > them. > > This patch sends an error (could be changed to an user-error) in that > case, as it makes no sense for a single line to be reversed. Thanks. I installed a slightly different change, because the command would still delete the following lines if only BEG or END (bit not both) was not at a line beginning/end. I also fixed the doc string and the comments there.