From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: electric-pair-mode
Date: Fri, 29 Nov 2013 08:44:57 -0500 [thread overview]
Message-ID: <jwvtxeve37n.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87fvqf1yjm.fsf@thinkpad.tsdh.org> (Tassilo Horn's message of "Fri, 29 Nov 2013 08:01:49 +0100")
> Ok, now I've found a mode where it's a problem. AUCTeX has its own
> TeX-ified brace pairing feature which for example knows that \left( has
> to be closed by \right(, \{ by \}, etc. With `electric-pair-mode'
> enabled, when typing a { I get two closing braces.
Yes, that is a problem. AUCTeX's pairing should be made aware of
electric-pair-mode (including being enabled/disabled by
calling/setting electric-pair-mode as well).
> Right now, I have "disabled" `electric-pair-mode' for auctex using:
> ;; AUCTeX brace pairing feature doesn't play nice with `electric-pair-mode'
> ;; which is a global minor mode as of emacs 24.4.
> (when (and (boundp 'electric-pair-mode)
> (boundp 'electric-pair-inhibit-predicate))
> (set (make-local-variable 'electric-pair-inhibit-predicate)
> (lambda (char) t))))
A simpler way to disable it is to set electric-pair-mode to nil
(buffer-locally). No need to check boundp of anything.
> I somehow have the feeling that `electric-pair-mode' should only do its
> magic if the opening paren/brace/bracket is inserted with
> `self-insert-command'.
What happens is that AUCTeX's pairing commands call self-insert-command.
Stefan
next prev parent reply other threads:[~2013-11-29 13:44 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-16 23:27 electric-pair-mode Stefan Monnier
2013-11-17 3:10 ` electric-pair-mode Xue Fuqiao
2013-11-17 18:30 ` electric-pair-mode Jorgen Schaefer
2013-11-17 21:12 ` electric-pair-mode Stefan Monnier
2013-11-18 11:04 ` electric-pair-mode Xue Fuqiao
2013-11-17 21:05 ` electric-indent-mode (was: electric-pair-mode) Stefan Monnier
2013-11-19 9:48 ` electric-indent-mode (was electric-pair-mode) Stephen Berman
2013-11-19 13:41 ` Stefan Monnier
2013-11-19 14:39 ` Stephen Berman
2013-11-21 13:48 ` electric-pair-mode Tassilo Horn
2013-11-22 1:13 ` electric-pair-mode Stefan Monnier
2013-11-22 13:20 ` electric-pair-mode Alexander Baier
2013-11-22 19:13 ` electric-pair-mode Tassilo Horn
2013-11-22 20:35 ` electric-pair-mode Alexander Baier
2013-11-22 21:09 ` electric-pair-mode Tassilo Horn
2013-11-23 1:53 ` electric-pair-mode Stefan Monnier
2013-11-29 7:01 ` electric-pair-mode Tassilo Horn
2013-11-29 13:44 ` Stefan Monnier [this message]
2013-11-29 17:10 ` electric-pair-mode Tassilo Horn
-- strict thread matches above, loose matches on Subject: below --
2013-12-05 19:16 electric-pair-mode Harald Hanche-Olsen
2013-12-06 13:50 ` electric-pair-mode Bastien
2013-12-06 17:12 ` electric-pair-mode Harald Hanche-Olsen
2013-12-07 7:18 ` electric-pair-mode Bastien
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=jwvtxeve37n.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
/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.