Subject: bug#17737: closed (Re: bug#17737: 24.4.50; REGRESSION: `delete-selection-mode' broken by `electric-indent-mode' change)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 17 Jun 2014 13:41:03 +0000

Your bug report

#17737: 24.4.50; REGRESSION: `delete-selection-mode' broken by `electric-indent-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 [email-masked].

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

Subject: Re: bug#17737: 24.4.50; REGRESSION: `delete-selection-mode' broken by `electric-indent-mode' change
From: Stefan Monnier <[email-masked]>
To: Drew Adams <[email-masked]>
Cc: [email-masked]
Date: Tue, 17 Jun 2014 09:40:39 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

> A fix is to add this sexp to delsel.el:

> (put 'electric-newline-and-maybe-indent 'delete-selection t)

Indeed, thanks, done,

        Stefan

Subject: 24.4.50; REGRESSION: `delete-selection-mode' broken by `electric-indent-mode' change
From: Drew Adams <[email-masked]>
To: [email-masked]
Date: Sun, 8 Jun 2014 08:30:14 -0700 (PDT)
List-Id: <debbugs-submit.debbugs.gnu.org>

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 [email-masked]
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/Devel/emacs/snapshot/trunk
 --enable-checking=yes,glyphs 'CFLAGS=-O0 -g3'
 LDFLAGS=-Lc:/Devel/emacs/lib 'CPPFLAGS=-DGC_MCHECK=1
 -Ic:/Devel/emacs/include''