unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ergus <spacibba@aol.com>
Cc: 53661@debbugs.gnu.org
Subject: bug#53661: 29.0.50; electric-pair-mode not respecting electric-pair-inhibit-predicate.
Date: Mon, 31 Jan 2022 21:28:54 +0200	[thread overview]
Message-ID: <837daf9021.fsf@gnu.org> (raw)
In-Reply-To: <20220131192001.ckn3dedbz3qzix3o@Ergus> (message from Ergus on Mon, 31 Jan 2022 20:20:01 +0100)

> Date: Mon, 31 Jan 2022 20:20:01 +0100
> From: Ergus <spacibba@aol.com>
> Cc: 53661@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.)





      reply	other threads:[~2022-01-31 19:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87fsp4eygw.fsf.ref@aol.com>
2022-01-31 15:06 ` bug#53661: 29.0.50; electric-pair-mode not respecting electric-pair-inhibit-predicate Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-31 16:41   ` Eli Zaretskii
2022-01-31 17:29     ` Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-31 18:04       ` Eli Zaretskii
2022-01-31 19:20         ` Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-31 19:28           ` Eli Zaretskii [this message]

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=837daf9021.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=53661@debbugs.gnu.org \
    --cc=spacibba@aol.com \
    /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).