From unknown Tue Jun 17 01:48:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17737: 24.4.50; REGRESSION: `delete-selection-mode' broken by `electric-indent-mode' change Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Jun 2014 15:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17737 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 17737@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.14022414576095 (code B ref -1); Sun, 08 Jun 2014 15:31:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Jun 2014 15:30:57 +0000 Received: from localhost ([127.0.0.1]:41513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wtf3g-0001aE-6r for submit@debbugs.gnu.org; Sun, 08 Jun 2014 11:30:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58260) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wtf3d-0001Zw-Sz for submit@debbugs.gnu.org; Sun, 08 Jun 2014 11:30:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wtf3O-0004Ym-47 for submit@debbugs.gnu.org; Sun, 08 Jun 2014 11:30:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47266) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wtf3N-0004Yf-Mx for submit@debbugs.gnu.org; Sun, 08 Jun 2014 11:30:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wtf3E-00053u-P0 for bug-gnu-emacs@gnu.org; Sun, 08 Jun 2014 11:30:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wtf32-0004Vq-Jr for bug-gnu-emacs@gnu.org; Sun, 08 Jun 2014 11:30:28 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:48186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wtf32-0004Vj-DH for bug-gnu-emacs@gnu.org; Sun, 08 Jun 2014 11:30:16 -0400 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s58FUEhH018159 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 8 Jun 2014 15:30:15 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s58FUDTD015453 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 8 Jun 2014 15:30:14 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s58FUCWp025621 for ; Sun, 8 Jun 2014 15:30:12 GMT MIME-Version: 1.0 Message-ID: Date: Sun, 8 Jun 2014 08:30:14 -0700 (PDT) From: Drew Adams X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6691.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) emacs -Q M-x delete-selection-mode ; turn it on M-: (electric-indent-mode -1) ; turn it off I was hoping that this would just restore the behavior present in Emacs forever, prior to Emacs 24.4: C-j would insert a newline and indent, and RET would insert a newline. The regression is that C-j does not delete the active region. For example, in `emacs-lisp-mode': Select the text from the middle of a line through eol (the newline char). Ensure that point is at the start of the selection, not the end. Hit `C-j'. The rest of the line is indented on the next line, instead of being killed. If point was instead at eol then the rest of the line is intact and a newline is inserted and point indented. In sum, the selected text is not killed. A fix is to add this sexp to delsel.el: (put 'electric-newline-and-maybe-indent 'delete-selection t) I see that you have already added this sexp instead: (put 'reindent-then-newline-and-indent 'delete-selection t) I can't speak to whether that second sexp is correct or should be removed. I don't use command `reindent-then-newline-and-indent'. In GNU Emacs 24.4.50.1 (i686-pc-mingw32) of 2014-06-01 on ODIEONE Bzr revision: 117212 michael.albinus@gmx.de-20140601104945-g88x0mwrxorz302h Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --prefix=3D/c/Devel/emacs/snapshot/trunk --enable-checking=3Dyes,glyphs 'CFLAGS=3D-O0 -g3' LDFLAGS=3D-Lc:/Devel/emacs/lib 'CPPFLAGS=3D-DGC_MCHECK=3D1 -Ic:/Devel/emacs/include'' From unknown Tue Jun 17 01:48:55 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Drew Adams Subject: bug#17737: closed (Re: bug#17737: 24.4.50; REGRESSION: `delete-selection-mode' broken by `electric-indent-mode' change) Message-ID: References: X-Gnu-PR-Message: they-closed 17737 X-Gnu-PR-Package: emacs Reply-To: 17737@debbugs.gnu.org Date: Tue, 17 Jun 2014 13:41:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1403012463-3188-1" This is a multi-part message in MIME format... ------------=_1403012463-3188-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #17737: 24.4.50; REGRESSION: `delete-selection-mode' broken by `electric-in= dent-mode' change 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 17737@debbugs.gnu.org. --=20 17737: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D17737 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1403012463-3188-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 17737-done) by debbugs.gnu.org; 17 Jun 2014 13:40:57 +0000 Received: from localhost ([127.0.0.1]:50167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wwtd6-0000oy-J6 for submit@debbugs.gnu.org; Tue, 17 Jun 2014 09:40:57 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:14233) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wwtcz-0000og-I4 for 17737-done@debbugs.gnu.org; Tue, 17 Jun 2014 09:40:50 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCzQSFBgNJIgECNIZF456B4Q4BKkZgWqBcYFbIQ X-IPAS-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCzQSFBgNJIgECNIZF456B4Q4BKkZgWqBcYFbIQ X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="67097165" Received: from 75-119-224-253.dsl.teksavvy.com (HELO pastel.home) ([75.119.224.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 17 Jun 2014 09:40:39 -0400 Received: by pastel.home (Postfix, from userid 20848) id A9B6460D53; Tue, 17 Jun 2014 09:40:39 -0400 (EDT) From: Stefan Monnier To: Drew Adams Subject: Re: bug#17737: 24.4.50; REGRESSION: `delete-selection-mode' broken by `electric-indent-mode' change Message-ID: References: Date: Tue, 17 Jun 2014 09:40:39 -0400 In-Reply-To: (Drew Adams's message of "Sun, 8 Jun 2014 08:30:14 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 17737-done Cc: 17737-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > A fix is to add this sexp to delsel.el: > (put 'electric-newline-and-maybe-indent 'delete-selection t) Indeed, thanks, done, Stefan ------------=_1403012463-3188-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 8 Jun 2014 15:30:57 +0000 Received: from localhost ([127.0.0.1]:41513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wtf3g-0001aE-6r for submit@debbugs.gnu.org; Sun, 08 Jun 2014 11:30:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58260) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wtf3d-0001Zw-Sz for submit@debbugs.gnu.org; Sun, 08 Jun 2014 11:30:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wtf3O-0004Ym-47 for submit@debbugs.gnu.org; Sun, 08 Jun 2014 11:30:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47266) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wtf3N-0004Yf-Mx for submit@debbugs.gnu.org; Sun, 08 Jun 2014 11:30:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wtf3E-00053u-P0 for bug-gnu-emacs@gnu.org; Sun, 08 Jun 2014 11:30:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wtf32-0004Vq-Jr for bug-gnu-emacs@gnu.org; Sun, 08 Jun 2014 11:30:28 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:48186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wtf32-0004Vj-DH for bug-gnu-emacs@gnu.org; Sun, 08 Jun 2014 11:30:16 -0400 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s58FUEhH018159 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 8 Jun 2014 15:30:15 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s58FUDTD015453 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 8 Jun 2014 15:30:14 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s58FUCWp025621 for ; Sun, 8 Jun 2014 15:30:12 GMT MIME-Version: 1.0 Message-ID: Date: Sun, 8 Jun 2014 08:30:14 -0700 (PDT) From: Drew Adams To: bug-gnu-emacs@gnu.org Subject: 24.4.50; REGRESSION: `delete-selection-mode' broken by `electric-indent-mode' change X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6691.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) emacs -Q M-x delete-selection-mode ; turn it on M-: (electric-indent-mode -1) ; turn it off I was hoping that this would just restore the behavior present in Emacs forever, prior to Emacs 24.4: C-j would insert a newline and indent, and RET would insert a newline. The regression is that C-j does not delete the active region. For example, in `emacs-lisp-mode': Select the text from the middle of a line through eol (the newline char). Ensure that point is at the start of the selection, not the end. Hit `C-j'. The rest of the line is indented on the next line, instead of being killed. If point was instead at eol then the rest of the line is intact and a newline is inserted and point indented. In sum, the selected text is not killed. A fix is to add this sexp to delsel.el: (put 'electric-newline-and-maybe-indent 'delete-selection t) I see that you have already added this sexp instead: (put 'reindent-then-newline-and-indent 'delete-selection t) I can't speak to whether that second sexp is correct or should be removed. I don't use command `reindent-then-newline-and-indent'. In GNU Emacs 24.4.50.1 (i686-pc-mingw32) of 2014-06-01 on ODIEONE Bzr revision: 117212 michael.albinus@gmx.de-20140601104945-g88x0mwrxorz302h Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --prefix=3D/c/Devel/emacs/snapshot/trunk --enable-checking=3Dyes,glyphs 'CFLAGS=3D-O0 -g3' LDFLAGS=3D-Lc:/Devel/emacs/lib 'CPPFLAGS=3D-DGC_MCHECK=3D1 -Ic:/Devel/emacs/include'' ------------=_1403012463-3188-1--