GNU bug report logs - #47936
AucTeX and electric-pair-mode

Previous Next

Package: auctex;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Wed, 21 Apr 2021 17:32:02 UTC

Severity: normal

Done: Tassilo Horn <tsdh <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 47936 <at> debbugs.gnu.org
Subject: bug#47936: AucTeX and electric-pair-mode
Date: Thu, 22 Apr 2021 13:33:34 +0900
[Message part 1 (text/plain, inline)]
Hi Philip,

>>>>> Philip Kaludercic <philipk <at> posteo.net> writes:

> an annoyance I have with auctex is it's interaction with
> electric-pair-mode. If both LaTeX-electric-left-right-brace and
> electric-pair-mode are enabled, typing '(' inserts "())", because both
> AucTeX and the electric function insert a closing parentheses. I still
> want to keep LaTeX-electric-left-right-brace enabled, because it handles
> TeX-specific parentheses (\{, \left <something>, ...) better.

AUCTeX already has the following code in `LaTeX-common-initialization'
to turn off `electric-pair-mode' explicitly.  So I guess you customize
`LaTeX-mode-hook' to re-enable `electric-pair-mode'.

  ;; AUCTeX's brace pairing feature (`LaTeX-electric-left-right-brace') doesn't
  ;; play nice with `electric-pair-mode' which is a global minor mode as of
  ;; emacs 24.4.
  (when (and LaTeX-electric-left-right-brace
             (boundp 'electric-pair-mode))
    (set (make-local-variable 'electric-pair-mode) nil))

> The attached patch would propose a solution that respects
> electric-pair-mode and doesn't insert an extra closing pair if
> enabled. It seems to work on my system, and if there are no issues it
> would be great if something along these lines could be done to avoid
> this behaviour.

Thanks. Maybe the attached patch might be better so that
`LaTeX-insert-left-brace' can get rid of all unexpected interactions
with `self-insert-command'. Tassilo, what do you think about it?

Regards,
Ikumi Keita

[diff (text/x-diff, attachment)]

This bug report was last modified 4 years and 90 days ago.

Previous Next


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