all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: electric-indent-mode: abolition of `newline' function is not the Right Thing.
Date: Wed, 16 Oct 2013 18:46:31 +0000	[thread overview]
Message-ID: <20131016184631.GB3125@acm.acm> (raw)
In-Reply-To: <jwvk3hgpp09.fsf-monnier+emacs@gnu.org>

Hello, Stefan.

On Mon, Oct 14, 2013 at 08:56:25AM -0400, Stefan Monnier wrote:
> > 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".

The people who have written Emacs Lisp code which calls `newline' (as
contrasted with `newline-and-indent').

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

That is a different topic from this thread's.  The question which should
be asked, should have been asked some while ago, is what is the best way
of giving these users what they want.  The answer is not, and can not be,
to have an Emacs without the traditional functionality of `newline'.

[ .... ]

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

Have I complained about \n being in electric-indent-chars?  I don't think
I have, but might be mistaken.  My complaint, and I've been perfectly
clear about it, is the abolition of the traditional functionality of the
`newline' function whenever electric-indent-mode is enabled.  You haven't
really addressed this issue in your past few posts.

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

Is that your solution to the ~198 uses of `newline' in Emacs and
countless others in other code and users' .emacsen?  Each caller of
`newline' should first ensure that \n is not in electric-indent-chars?

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

Well, it's not really my suggestion, it's standard advice in the Elisp
manual on page "Overview of Markers".  Without doing this, a buffer's
performance is gradually going to worsen as a heap of useless markers
accumulates, until such time as garbage collection eventually gets rid of
them.  The cost of making a marker point nowhere, less than once per
keystroke, is hardly high.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).



  reply	other threads:[~2013-10-16 18:46 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-13 10:13 electric-indent-mode: abolition of `newline' function is not the Right Thing Alan Mackenzie
2013-10-13 13:23 ` Stefan Monnier
2013-10-13 14:09   ` Alan Mackenzie
2013-10-13 16:22     ` Stefan Monnier
2013-10-13 17:28       ` Alan Mackenzie
2013-10-14 12:56         ` Stefan Monnier
2013-10-16 18:46           ` Alan Mackenzie [this message]
2013-10-15 18:28         ` martin rudalics
2013-10-16 17:12           ` Alan Mackenzie
2013-10-16 17:59             ` Stefan Monnier
2013-10-16 18:58               ` Alan Mackenzie
2013-10-16 20:55                 ` chad
2013-10-16 21:07                   ` Daniel Colascione
2013-10-18 16:51                   ` Alan Mackenzie
2013-10-16 23:22               ` Stephen J. Turnbull
2013-10-16 18:34             ` martin rudalics
2013-10-16 19:26               ` Default behaviour of RET Alan Mackenzie
2013-10-16 19:47                 ` Eli Zaretskii
2013-10-16 23:17                 ` Stephen J. Turnbull
2013-10-17  0:47                   ` Stefan Monnier
2013-10-18 17:03                     ` Alan Mackenzie
2013-10-18 19:52                       ` Stefan Monnier
2013-10-18 20:45                         ` Alan Mackenzie
2013-10-19  1:59                           ` Stefan Monnier
2013-10-19 10:58                             ` Alan Mackenzie
2013-10-19 15:07                               ` Drew Adams
2013-10-20 14:55                                 ` Alan Mackenzie
2013-10-20 22:26                                   ` Richard Stallman
2013-10-21  2:38                                     ` Eli Zaretskii
2013-10-19 22:20                               ` Stefan Monnier
2013-10-20 15:00                                 ` Alan Mackenzie
2013-10-18 16:57                   ` Alan Mackenzie
2013-10-13 20:00 ` electric-indent-mode: abolition of `newline' function is not the Right Thing Matthias Meulien
2013-10-14 13:21   ` Stefan Monnier
2013-10-14 13:31     ` Matthias Meulien
2013-10-14 16:46       ` Stefan Monnier
2013-10-15 15:54         ` Davis Herring
2013-10-15 20:03         ` Matthias Meulien
2013-10-16  2:44           ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131016184631.GB3125@acm.acm \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.