unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Alan Mackenzie <acm@muc.de>
Cc: bea@klebe.blog, Stefan Monnier <monnier@IRO.UMontreal.CA>,
	33794@debbugs.gnu.org
Subject: bug#33794: 26.1; electric-pair-mode breaks auto-newline minor mode of cc-mode
Date: Sat, 22 Dec 2018 13:47:31 +0000	[thread overview]
Message-ID: <874lb58yh8.fsf@gmail.com> (raw)
In-Reply-To: <20181222102011.GA3935@ACM> (Alan Mackenzie's message of "Sat, 22 Dec 2018 10:20:11 +0000")

Hello Alan,

I will be, again, responding to your two emails in one.

Alan Mackenzie <acm@muc.de> writes:

> This clearly isn't true at the moment.  Have you tested it with, for
> example, Cperl Mode, or Vera Mode?  That characteristic is an
> aspiration, which is laudable.

Fair enough.  But what are the bugs in those modes?  I've just tested it
briefly there and it seems to work.  I type parenthesis of various kinds
and they get autopaired and autoskipped.

> I think that what is missing from this history is the stage where the
> idea with proposed solution is first discussed on emacs-devel, where
> conceptual problems can be identified and resolved.  As a result, e-p-m
> is only compatible with some major modes; it is incompatible with those
> that explicitly call self-insert-function as part of a command bound to
> a key which is usually self-inserting.  There are quite a few such
> modes.

I think, but I'm not sure, that anycommand that eventually calls
post-self-insert-hook would also work.

> The answer is, of course, that "{" should be inserted into the buffer.
> With electric-pair-mode-enabled, what actually happens is that "{}"
> gets inserted instead.  This is broken.  I ask you to consider this
> paragraph very carefully rather than reacting emotionally against it.

Alan, OK, that is your opinion, but please don't tell me which part of
my brain to use when reacting to something, that's a wee bit too
arrogant...

> Again, you're much more familiar with electric-indent-mode, and friends.
> Do they also break self-insert-command?

No idea.  And I'm not very familiar with them, no.

Look, the framework for inserting extra things in post-self-insert-hook
was already in place when I joined the party.  Be it space for indent or
newlines for layout or delimiters for pairing.  I just followed those
tracks, which apparently cause you dismay.  And I enjoyed it, hehehe,
sorry :-) it really did make coding easier.

> with a few quick hacks can only lead to frustration all round, and to
> tears.

My tears, certainly, because I'm such an emotional trainwreck :-)

> self-insert-command needs to behave correctly, according to its
> documentation.  It is surely not beyond us to fix these problems.

Of course there are different ways to solve problems.  I think the way I
am exploring is the best.  You think otherwise, that's OK.

> Can't say exactly, but a quick hack on some minor mode which violates
> and attempts to duplicate the conventions of the major mode, not
> intensively tested, is not going to work.

Who convened where to decide this that you call "convention"?

And exactly what conventions is electric-layout-mode breaking (btw, you
should be aware that electric-layout-mode exists since 2010: Again, long
before I joined the party).

>> What bugs?  If you know of any, it would be good to report them, right?
> See above.

I did, but I don't see any reports of flawed behaviour there.  I'm not
saying there aren't any bugs: I'm just saying you should first look to
indications or traces of these bugs before publically stating that there
are.

> Which is the wrong thing to do.

Did you see The Big Lebowsky by the Cohen brothers? :-) There's a nice
riposte there, apropos opinions.

> I don't think she wants to spend lots of time debugging (which is our
> job).

Yes, maybe.  It's up to her, of course.  But it's not my "job", it's
something I do for fun.  And Alan, I have some experience in dealing
with user's reports too (neatly over a decade long, since that seems to
matter to you) and some users are more cooperative than others, and
that's fine.

> Eh??  The auto-newline facility is there and is optional.  It is an
> integral part of CC Mode.  Where is this "forcing" you're referring
> to?

Fair enough, no "forcing".  It sounded like you were suggesting to
Beatrix that she stay away from any solution except yours, for no reason
other than your authority as CC-mode maintainer and some unsubstantiated
prophecies of disaster.

> Is there any documentation for the connections between
> electric-pair-mode and the other electric-... facilities?

I don't think so: unless you count comments.  The interfaces they adhere
to to work together is post-self-insert-hook, with a few hacks here and
there marked FIXME by Stefan.

> is social: somebody inventing facilities which impose constraints on
> Emacs in general, and imposing these on Emacs without public
> discussion.  That cannot end well, and it hasn't ended well.

There's something here that doesn't make sense: you repudiate
"constraints", but you laud "convention".  But, in my view, pieces of
software uses "interfaces" to work together.

We're just discussing here who violated them, that's all.

João

PS: Without public discussion??? This discussion _is_ public! :-)






  reply	other threads:[~2018-12-22 13:47 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18 17:38 bug#33794: 26.1; electric-pair-mode breaks auto-newline minor mode of cc-mode Beatrix Klebe
     [not found] ` <mailman.5894.1545155289.1284.bug-gnu-emacs@gnu.org>
2018-12-21 13:48   ` Alan Mackenzie
2018-12-21 13:57     ` João Távora
2018-12-21 14:12       ` Stefan Monnier
2018-12-21 16:00         ` Beatrix Klebe
2018-12-21 18:49           ` João Távora
2018-12-21 19:06             ` Beatrix Klebe
2018-12-21 19:20               ` João Távora
2018-12-21 19:24                 ` João Távora
2018-12-21 19:43                 ` Beatrix Klebe
2018-12-22  1:08                   ` João Távora
2018-12-22  2:16                     ` João Távora
2018-12-22  2:41                       ` Alan Mackenzie
2018-12-22  3:22                         ` João Távora
2018-12-22  4:41                           ` Beatrix Klebe
2018-12-22 10:02                             ` João Távora
2018-12-22 12:33                           ` Alan Mackenzie
2019-01-01 19:27           ` Alan Mackenzie
2019-01-15 16:10             ` Alan Mackenzie
2018-12-21 20:11         ` Alan Mackenzie
2018-12-22  0:45           ` João Távora
2018-12-22 10:20             ` Alan Mackenzie
2018-12-22 13:47               ` João Távora [this message]
2018-12-21 21:50       ` Alan Mackenzie
2018-12-22 16:22         ` Stefan Monnier
2018-12-22 16:34           ` Beatrix Klebe
2018-12-22 17:12             ` Stefan Monnier
2018-12-22 17:34               ` Beatrix Klebe
2018-12-22 21:19                 ` João Távora
2018-12-22 22:15                   ` Alan Mackenzie
2018-12-22 22:55                     ` João Távora
2018-12-23 20:21                       ` Alan Mackenzie
     [not found]                       ` <20181223202143.GA6658@ACM>
2018-12-23 21:38                         ` João Távora
2018-12-23 21:46                           ` Alan Mackenzie
2018-12-28 12:44                           ` Alan Mackenzie
2018-12-23 14:43                     ` Stefan Monnier
2018-12-23 14:48   ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=874lb58yh8.fsf@gmail.com \
    --to=joaotavora@gmail.com \
    --cc=33794@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=bea@klebe.blog \
    --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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).