all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: "João Távora" <joaotavora@gmail.com>
Cc: 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 12:33:28 +0000	[thread overview]
Message-ID: <20181222123328.GB3935@ACM> (raw)
In-Reply-To: <87h8f68cu0.fsf@gmail.com>

Hello, João.

On Sat, Dec 22, 2018 at 03:22:47 +0000, João Távora wrote:
> Alan Mackenzie <acm@muc.de> writes:

> > Hello, Beatrix.

> > As maintainer of CC Mode, I earnestly recommend you NOT to follow João's
> > suggestion.  It will not work, and will waste your time.

> What, exactly, will not work?

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.

> > Even if it appears to work, you will end up picking out bugs for an
> > indeterminate period.

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

See above.

> > Basically, electric-pair-mode as it is currently built is incompatible
> > with CC Mode, as I have pointed out here, albeit somewhat
> > undiplomatically.

> > I suggest you do nothing until tempers amongst Emacs developers have
> > cooled down, and hopefully a genuine solution to the bug has been worked
> > out and implemented.

> If you don't like electric-layout-mode, don't use it.  I'm trying to
> develop an alternative to c-toggle-auto-newline ....

Which is the wrong thing to do.

> .... within the electric-*-mode frame.  It's an experiment which I
> don't even know if Stefan will agree to, but it seems to work.  If
> Beatrix wants to cooperate, why shouldn't she?

My reading of the situation is that Beatrix reported a bug,
expecting/hoping for it to be fixed, so that she can get on with her
work more effectively.  I don't think she wants to spend lots of time
debugging (which is our job).

> I'm not asking you to nuke c-toggle-auto-newline or anything, ....

It looks rather that we to me, I must say.

> .... but should we all be forced to use it?  I don't think it's
> sensible in a free software project, Alan (and my temper is quite cool
> when saying this :-))

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?

I think the situation is that the various electric-... facilities can
only work with major modes designed in a particular restricted fashion -
they are not universal.  Your answer is to try and impose these
restrictions on all major modes.  That can't work, since we don't
control all such modes, and imposing restrictions is a Bad Thing
generally.

> Again, I said I don't have anything against making eletric-pair-mode
> compatible with c-toggle-auto-newline if someone comes up with a good
> solution that doesn't break e-p-m for other modes.  I will not invest
> time in looking into that solution, but you or someone else may, of
> course.

As I've said elsewhere, the key to the fix is fixing the breakage of
self-insert-command.  That is going to involve extensive changes to
electric-pair-mode, but will fix the problem rather than trying to work
around it.

My idea at the moment is to change from using post-self-insert-hook to
using post-command-hook, thus fixing self-insert-command.  There should
also be a buffer local variable holding the function to insert the
matching paren with, defaulting to self-insert-command, or similar.
Would this work, and if not, where would it fail?

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

As I've also said elsewhere, the fundamental root of the current problem
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.

> In the meantime let people explore alternatives, right?

It does not lie within my power to stop them.  ;-)

> João

-- 
Alan Mackenzie (Nuremberg, Germany).





  parent reply	other threads:[~2018-12-22 12:33 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 [this message]
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
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

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

  git send-email \
    --in-reply-to=20181222123328.GB3935@ACM \
    --to=acm@muc.de \
    --cc=33794@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    --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.