bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#50538: [PATCH] 28.0.50; electric-pair-mode fails to pair double quot


From: Jim Porter
Subject: bug#50538: [PATCH] 28.0.50; electric-pair-mode fails to pair double quotes in some cases in CC mode
Date: Wed, 15 Sep 2021 15:17:23 -0700

On 9/11/2021 8:58 PM, Jim Porter wrote:
> (Note: I've just updated my copyright assignment information, but
> haven't received confirmation that everything is in order, so this might
> need to wait until that's done for it to merge.)

I've gotten confirmation that my copyright assignment info is all up-to-date, so once this patch passes muster, it should be ok to merge it.

On 9/12/2021 11:05 AM, Jim Porter wrote:
Note however that this solution isn't perfect: it means a user's custom `electric-pair-inhibit-predicate' can only inhibit *more* than CC mode's default behavior, not less. I think that's a reasonable compromise though, and users who want more direct control can set `electric-pair-inhibit-predicate' inside `c-mode-common-hook'. A "perfect" solution here would probably require adding new customization points to `electric-pair-mode' (e.g. a way for major modes to override how the syntax is analyzed), and I'm not sure the added complexity would be worth it, especially since this code is already a bit tricky.

I'm not sure if someone has a better idea for how to do things, but for my config[1], the patch works well and makes CC modes behave the same as other programming modes. In my opinion, the worst thing `electric-pair-mode' can do is to behave inconsistently, since that forces the user to pay close attention to something that should be almost invisible/automatic.

[1] I customize `electric-pair-inhibit-predicate' to disable electric-pairing in strings/comments, and this patch interacts correctly with that customization.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]