all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#17128: 24.3.50; `newline-and-indent' should not indent the current line
@ 2014-03-28  6:17 Dmitry Gutov
  2014-03-28 14:17 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2014-03-28  6:17 UTC (permalink / raw
  To: 17128

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@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 ()






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#17128: 24.3.50; `newline-and-indent' should not indent the current line
  2014-03-28  6:17 bug#17128: 24.3.50; `newline-and-indent' should not indent the current line Dmitry Gutov
@ 2014-03-28 14:17 ` Stefan Monnier
  2014-04-01  5:37   ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2014-03-28 14:17 UTC (permalink / raw
  To: Dmitry Gutov; +Cc: 17128

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

Agreed.


        Stefan





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#17128: 24.3.50; `newline-and-indent' should not indent the current line
  2014-03-28 14:17 ` Stefan Monnier
@ 2014-04-01  5:37   ` Dmitry Gutov
  2014-04-01 20:08     ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2014-04-01  5:37 UTC (permalink / raw
  To: Stefan Monnier; +Cc: 17128

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'.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#17128: 24.3.50; `newline-and-indent' should not indent the current line
  2014-04-01  5:37   ` Dmitry Gutov
@ 2014-04-01 20:08     ` Stefan Monnier
  2014-04-02 22:47       ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2014-04-01 20:08 UTC (permalink / raw
  To: Dmitry Gutov; +Cc: 17128

> 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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#17128: 24.3.50; `newline-and-indent' should not indent the current line
  2014-04-01 20:08     ` Stefan Monnier
@ 2014-04-02 22:47       ` Dmitry Gutov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Gutov @ 2014-04-02 22:47 UTC (permalink / raw
  To: Stefan Monnier; +Cc: 17128-done

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'.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-04-02 22:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-28  6:17 bug#17128: 24.3.50; `newline-and-indent' should not indent the current line Dmitry Gutov
2014-03-28 14:17 ` Stefan Monnier
2014-04-01  5:37   ` Dmitry Gutov
2014-04-01 20:08     ` Stefan Monnier
2014-04-02 22:47       ` Dmitry Gutov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.