GNU bug report logs - #53661
29.0.50; electric-pair-mode not respecting electric-pair-inhibit-predicate.

Previous Next

Package: emacs;

Reported by: Ergus <spacibba <at> aol.com>

Date: Mon, 31 Jan 2022 15:08:01 UTC

Severity: normal

Found in version 29.0.50

Full log


Message #20 received at 53661 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ergus <spacibba <at> aol.com>
Cc: 53661 <at> debbugs.gnu.org
Subject: Re: bug#53661: 29.0.50; electric-pair-mode not respecting
 electric-pair-inhibit-predicate.
Date: Mon, 31 Jan 2022 21:28:54 +0200
> Date: Mon, 31 Jan 2022 20:20:01 +0100
> From: Ergus <spacibba <at> aol.com>
> Cc: 53661 <at> debbugs.gnu.org
> 
> >> I wanted to add "<>" so I added to my init:
> >>
> >> (add-to-list 'electric-pair-pairs '(?< . ?>))
> >
> >And it didn't work because of the hard-coded syntaxes?
> >
> Adding to the list worked correctly, What didn't work was to use the
> electric-pair-inhibit-predicate that was never called, so a < always
> inserted a >.
> 
> >What is the syntax of ?< in the mode where you wanted to add that?
> 
> It is just c++-mode.

And that is your problem, I believe: <> in C++ aren't treated as
parentheses or string delimiters, so their syntax doesn't fit what
electric-pair-mode assumes.

IOW, you need a different, C++ specific feature.  (I'd be surprised if
none already existed, btw.)




This bug report was last modified 3 years and 136 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.