GNU bug report logs - #17128
24.3.50; `newline-and-indent' should not indent the current line

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Fri, 28 Mar 2014 06:19:02 UTC

Severity: normal

Tags: patch

Found in version 24.3.50

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17128 in the body.
You can then email your comments to 17128 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#17128; Package emacs. (Fri, 28 Mar 2014 06:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dmitry Gutov <dgutov <at> yandex.ru>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 28 Mar 2014 06:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; `newline-and-indent' should not indent the current line
Date: Fri, 28 Mar 2014 08:17:28 +0200
Tags: patch

There's `reindent-then-newline-and-indent' for that.

In GNU Emacs 24.3.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.8.6)
 of 2014-03-23 on axl
Repository revision: 116830 dgutov <at> yandex.ru-20140322084330-wrwcmwjdbe3mu712
Windowing system distributor `The X.Org Foundation', version 11.0.11405000
System Description:	Ubuntu 13.10


=== modified file 'lisp/simple.el'
--- lisp/simple.el	2014-03-25 23:30:08 +0000
+++ lisp/simple.el	2014-03-28 06:15:14 +0000
@@ -611,7 +611,7 @@
 column specified by the function `current-left-margin'."
   (interactive "*")
   (delete-horizontal-space t)
-  (newline nil t)
+  (newline)
   (indent-according-to-mode))
 
 (defun reindent-then-newline-and-indent ()





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17128; Package emacs. (Fri, 28 Mar 2014 14:18:01 GMT) Full text and rfc822 format available.

Message #8 received at 17128 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 17128 <at> debbugs.gnu.org
Subject: Re: bug#17128: 24.3.50;
 `newline-and-indent' should not indent the current line
Date: Fri, 28 Mar 2014 10:17:31 -0400
> There's `reindent-then-newline-and-indent' for that.

Agreed.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17128; Package emacs. (Tue, 01 Apr 2014 05:38:02 GMT) Full text and rfc822 format available.

Message #11 received at 17128 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 17128 <at> debbugs.gnu.org
Subject: Re: bug#17128: 24.3.50; `newline-and-indent' should not indent the
 current line
Date: Tue, 01 Apr 2014 08:37:44 +0300
On 28.03.2014 16:17, Stefan Monnier wrote:
>> There's `reindent-then-newline-and-indent' for that.
>
> Agreed.

Hmm, I'm not sure about the patch, though.

If `newline-and-indent' shouldn't reindent the current line [even when 
electric-indent-mode is enabled] because there's 
`reindent-then-newline-and-indent', then `newline' likewise probably 
shouldn't (re)indent either of the lines because of the existence of the 
former two functions.

In that case, my suggestion to separate the electric indent on RET from 
indenting after newline wouldn't exactly work.

Could we define new commands in electric-mode, and bind them when it's on?

Something like `electric-maybe-indent-then-newline' and 
`electric-maybe-reindent-then-newline-and-indent'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17128; Package emacs. (Tue, 01 Apr 2014 20:09:01 GMT) Full text and rfc822 format available.

Message #14 received at 17128 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 17128 <at> debbugs.gnu.org
Subject: Re: bug#17128: 24.3.50;
 `newline-and-indent' should not indent the current line
Date: Tue, 01 Apr 2014 16:08:20 -0400
> Could we define new commands in electric-mode, and bind them when it's on?
> Something like `electric-maybe-indent-then-newline' and
> `electric-maybe-reindent-then-newline-and-indent'.

That's an option, yes.  Alan might like it.


        Stefan




Reply sent to Dmitry Gutov <dgutov <at> yandex.ru>:
You have taken responsibility. (Wed, 02 Apr 2014 22:48:02 GMT) Full text and rfc822 format available.

Notification sent to Dmitry Gutov <dgutov <at> yandex.ru>:
bug acknowledged by developer. (Wed, 02 Apr 2014 22:48:03 GMT) Full text and rfc822 format available.

Message #19 received at 17128-done <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 17128-done <at> debbugs.gnu.org
Subject: Re: bug#17128: 24.3.50; `newline-and-indent' should not indent the
 current line
Date: Thu, 03 Apr 2014 01:47:42 +0300
On 01.04.2014 23:08, Stefan Monnier wrote:

> That's an option, yes.  Alan might like it.

Too bad that discussion is going very slowly.

I'm pulling this patch because it also breaks 
`electric-pair-open-newline-between-pairs'.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 01 May 2014 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 56 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.