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@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] trunk r116461: Connect electric-indent-mode up with CC Mode. Bug #15478.
Date: Wed, 19 Mar 2014 22:42:31 +0000	[thread overview]
Message-ID: <20140319224231.GB4783@acm.acm> (raw)
In-Reply-To: <jwvbnx46efo.fsf-monnier+emacsdiffs@gnu.org>

Hello, Stefan.

On Mon, Mar 17, 2014 at 11:48:16AM -0400, Stefan wrote:
> >> Right.  But I don't see what is so special about the C language that
> >> makes c-electric-flag (aka electric-indent-mode) indispensable in c-mode.
> > CC Mode modes don't indent correctly automatically without electric
> > indentation.

> And the same holds true for all other programming modes.

No it doesn't.  We both agree that Emacs Lisp Mode has no use whatsoever
for electric indentation.  Clearly, only languages where a line's
indentation is dependent on the contents of that line can benefit from
electric indentation.

> Nothing special here.

> I don't know of any mode where electric behavior of something else than
> the newline character is needed for the "typical case where lines of
> code are being typed in, line by line".

Then I suggest you think hard about the disadvantages of RET as an
electric indentation key.  If there weren't such disadvantages, CC Mode
would have been using it for 20 years.

> But since this "typical case" is not that typical, several major modes
> elect to make a few other keys electric so as to try and maintain
> indentation even when code is being modified rather than just being
> written linearly.

Yes.

> Maybe the special part of c-mode is that you used a set of electric
> chars which is sufficient and yet does not include newline.

Newline is a poor choice for an electric indentation key.

> > Not quite.  I want the default for CC Mode modes to be t, regardless of
> > any system wide default.

> I know you steadfastly refuse to recognize that this is your personal
> preference rather than a requirement of the languages you support.

You're not going to accept reasoned argument here, so I think there's no
point continuing this line of discussion.

> > I think you are wrong in your tacit assumption that liking of e-i-m is
> > person dependent rather than major mode dependent.

> There are details about *how* e-i-m works which depend on the mode.
> Yes.  That's why e-i-m has mode-local settings (e.g. which keys are
> electric, or whether the indentation algorithm can reliably reindent).

Any "indentation algorithm" can reliably reindent.  It is the context in
which the algorithm is used which is important, not the algorithm itself.

> But the global e-i-m setting is about deciding whether the user wants
> his code to be automatically indented as he types (to the extent
> possible).  It is *defined* as a person-dependent preference.

Clearly.  I am pointing out that this definition is perhaps a suboptimal
one.  Your scheme makes it difficult for a user to set up a major mode as
being non e-i-m, or even an individual buffer.

> > The way electric-indent-mode was implemented seems optimised to maximise
> > the difficulty of integrating CC Mode with it.

> Of course, my main objective was to piss you off and make your
> life miserable.  It hasn't worked as well as planned, but this is not
> quite over yet ;-)

Not even that.  You were in so much of a hurry to reinvent the wheel,
that you were oblivious of perfectly round wheels with smooth bearings
which had been in existence for ~20 years.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).



  reply	other threads:[~2014-03-19 22:42 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1WFSpO-0001e7-Gm@vcs.savannah.gnu.org>
2014-02-18  0:11 ` [Emacs-diffs] trunk r116461: Connect electric-indent-mode up with CC Mode. Bug #15478 Stefan Monnier
2014-02-22 18:27   ` Alan Mackenzie
2014-02-25  3:24     ` Stefan Monnier
2014-02-28 19:50       ` Alan Mackenzie
2014-03-01 15:57         ` Stefan Monnier
2014-03-02 11:51           ` Alan Mackenzie
2014-03-04  3:48             ` Stefan Monnier
2014-03-08 22:58               ` Alan Mackenzie
2014-03-09  1:57                 ` Stefan Monnier
2014-03-09 12:37                   ` Alan Mackenzie
2014-03-10  3:37                     ` Stefan Monnier
2014-03-10  6:59                       ` Glenn Morris
2014-03-10 12:24                       ` João Távora
2014-03-10 18:30                         ` Stefan Monnier
2014-03-16 22:35                       ` Alan Mackenzie
2014-03-17 15:48                         ` Stefan
2014-03-19 22:42                           ` Alan Mackenzie [this message]
2014-03-20  1:46                             ` Stefan
2014-03-20  8:35                               ` Thien-Thi Nguyen
2014-03-21  8:24                                 ` João Távora
2014-03-22 13:13                               ` Alan Mackenzie
2014-03-22 16:14                                 ` Stefan
2014-03-22 20:19                                   ` David Caldwell
2014-03-22 22:05                                     ` David Kastrup
2014-03-22 22:32                                       ` David Caldwell
2014-03-24  1:13                                     ` Stefan
2014-03-22 22:34                                   ` Alan Mackenzie
2014-03-24  1:37                                     ` Stefan
2014-03-24 22:40                                       ` Alan Mackenzie
2014-03-25  1:37                                         ` Dmitry Gutov
2014-03-26 20:53                                           ` Alan Mackenzie
2014-03-27  8:02                                             ` Dmitry Gutov
2014-03-30 14:57                                               ` Alan Mackenzie
2014-03-31 17:11                                                 ` Dmitry Gutov
2014-04-03 21:53                                                   ` Alan Mackenzie
2014-03-25  1:54                                         ` Stefan
2014-03-26 21:21                                           ` Alan Mackenzie
2014-03-27 14:49                                             ` Stefan Monnier
2014-03-30 11:37                                               ` Alan Mackenzie
2014-03-30 16:46                                                 ` Stefan Monnier
2014-03-22 23:10                                   ` Alan Mackenzie
2014-03-24  1:39                                     ` Stefan
2014-03-24  6:59                                       ` Stephen J. Turnbull
2014-03-24  9:08                                         ` Dmitry Gutov
2014-03-24 17:19                                           ` Eli Zaretskii
2014-03-24 17:29                                             ` David Kastrup
2014-03-24 17:39                                               ` David Kastrup
2014-03-24 17:38                                             ` Dmitry Gutov
2014-03-24 17:52                                               ` Eli Zaretskii
2014-03-25  1:53                                                 ` Dmitry Gutov
2014-03-25  3:49                                                   ` Eli Zaretskii
2014-03-24 18:32                                           ` Stefan
2014-03-25  1:49                                             ` Dmitry Gutov
2014-03-25  7:44                                             ` Stephen J. Turnbull
2014-03-25  8:08                                               ` Steinar Bang
2014-03-25 16:49                                                 ` Stephen J. Turnbull
2014-03-25 17:08                                                   ` Steinar Bang
2014-03-25 17:31                                                     ` Dmitry Gutov
2014-03-25 19:28                                                       ` Steinar Bang
2014-03-25 19:49                                                         ` David Kastrup
2014-03-25 19:54                                                           ` Dmitry Gutov
2014-03-25 13:26                                               ` Stefan Monnier
2014-03-27  7:51                                                 ` Stephen J. Turnbull
2014-03-24 21:12                                         ` Alan Mackenzie

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=20140319224231.GB4783@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.