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>,
	"Beatrix Klebe" <beeuhtricks@gmail.com>
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 22:15:40 +0000	[thread overview]
Message-ID: <20181222221540.GC3935@ACM> (raw)
In-Reply-To: <87woo16yzp.fsf@gmail.com>

Hello, Beatrix and João.

On Sat, Dec 22, 2018 at 21:19:22 +0000, João Távora wrote:
> Beatrix Klebe <beeuhtricks@gmail.com> writes:

> > Well, in that case, I am flattered that my opinion is given much
> > weight in this.

> It's supposed to work like that everyday in the Emacs bug tracker.  If
> it flatters you, so much the better :-)

> > Things such as c-toggle-auto-newline, for example, almost seem in this
> > case that they might be better delegated to electric-layout-mode, with
> > cc-mode specifying different electric-layout constraints for its
> > different formatting styles. It seems this is close to what João was
> > suggesting?

This is what I oppose.  Given how well CC Mode's auto-newline works,
such a change would almost certainly be a negative step in quality,
portability, and would be a lot of unrewarding work to do.  CC Mode
isn't broken, here.  It doesn't need fixing, here.

> Yes, that is precisely what I am suggesting.  I am happy that this point
> made it across.

> Though there is not any need to give up on c-toggle-auto-newline if you
> don't use electric-pair-mode, or if you use some other tool like
> smartparens, or perhaps even my older tool autopair.el (tho those tools
> might have other drawbacks that I don't known)

If electric-pair-mode was fixed, it would work perfectly well with CC
Mode.

> > And I suspect what Alan disagrees with? I apologize for any
> > misunderstanding.

One of the things, yes.  CC Mode has, for years, been under constant
attack from people who want to make Emacs major modes work only the way
they think modes should.  CC Mode works differently, for good reasons.
To adapt CC Mode the way these people want would have significant
disadvantages, including some lost functionality.

Right now, João's direction of travel seems to be to cement
electric-pair-mode's unusability in modes like CC Mode, of which there
are quite a few.  I hope I've misunderstood this and I'm mistaken.

> Yes, Alan disagrees with this.  In his view, electric- modes are abusing
> the semantics of post-self-insert-hook.  Well, at least in my view of
> his views :-)

Please don't misrepresent me like that.  The point is that the
electric-... modes abuse not so much the post-self-insert-hook (although
they do), but they totally break self-insert-command.  You have had
several hours to contest this, but by your silence appear to have
accepted it.

electric-pair-mode breaks self-insert-command.

self-insert-command is (or was) a general purpose command for inserting
typed characters into a buffer.  With electric-pair-mode enabled, it
ceases to be general purpose, being usable only in contexts blessed by
the electric-... functionality.  This is why CC Mode's auto-newline
broke.  It will stay broken until electric-pair-mode's breaking of that
function gets fixed.

> João

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).





  reply	other threads:[~2018-12-22 22:15 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
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 [this message]
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=20181222221540.GC3935@ACM \
    --to=acm@muc.de \
    --cc=33794@debbugs.gnu.org \
    --cc=bea@klebe.blog \
    --cc=beeuhtricks@gmail.com \
    --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.