[Top][All Lists]

[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: Stefan Monnier
Subject: Re: electric-indent-mode: abolition of `newline' function is not the Right Thing.
Date: Mon, 14 Oct 2013 08:56:25 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

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

Not sure who is your "they".  In my experience, what I've seen users
want is "auto-indentation" and by that they mean that the text should be
kept indented when they hit RET and a few other keys.
E.g. a question I've seen many times is

  So I tried this Emacs thingy which claims to do indentation for me,
  but all my text stays at the left-margin.  What am I doing wrong.

and the answer I generally see given is:

  You want to bind RET to newline-and-indent.

Are these the majority, users?  I don't know.  But so far, you're the
only person who's complained about ?\n being in the default value of
electric-indent-chars, so I see no evidence that your preference in this
regard is representative.

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

Very easy: remove ?\n from electric-indent-chars.
IOW (setq-default electric-indent-chars nil) should do that for you.

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

Let's see if/when this leads to a concrete performance problem, and at
that point we'll see how to fix it.  Making a marker point nowhere is an
annoyance and is itself a costly operation (O(N) for N markers), so
I don't much like using the workaround you suggest.


reply via email to

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