emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: electric-indent-mode: abolition of `newline' function is not the Rig


From: Alan Mackenzie
Subject: Re: electric-indent-mode: abolition of `newline' function is not the Right Thing.
Date: Sun, 13 Oct 2013 17:28:41 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

Hello, Stefan.

On Sun, Oct 13, 2013 at 12:22:33PM -0400, Stefan Monnier wrote:
> > :-)  Of course there are workarounds, but that's not the point.
> > There are approximately 198 calls to `newline' in the Emacs Lisp
> > sources, and an unknown further number in other Lisp files and users'
> > .emacsen.  Some of these calls are going to get broken by the
> > effective change to `newline'.

> Right.  But the problem is that this is not specific to
> electric-indent-mode: newline calls self-insert-command, which runs
> expand-abbrev and (since Emacs24) post-self-insert-hook.  Any caller
> which only wants a \n and no extra doo-dads should not call `newline'.

> electric-indent-mode just makes this problem more apparent.

Sorry Stefan, but that is disingenuous.  If you look again at
`electric-indent-post-self-insert-function', you will see that that
function deliberately converts `newline' into `newline-and-indent'.  It
even says so in the comments.  _This_ is the problem.

What is the justification for this extension in functionality of
`newline' to do the same as `newline-and-indent'?

And people calling `newline' do not simply want a \n.  They want
abbreviations to be processed, they want auto-fill to be run, trailing
space to be removed from otherwise blank lines, and so on.  What they
_don't_ want is indentation inserted on the new line.

Please take this indent-newline functionality out of
e-i-post-s-i-function (or let me do it).

Incidentally, each call of e-i-post-s-i-function creates a new marker,
bound to the let variable `before'.  This is not set to point nowhere
before `before' becomes unbound.  I think it probably should.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]