[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#47936: AucTeX and electric-pair-mode
From: |
Ikumi Keita |
Subject: |
bug#47936: AucTeX and electric-pair-mode |
Date: |
Thu, 22 Apr 2021 13:33:34 +0900 |
Hi Philip,
>>>>> Philip Kaludercic <philipk@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
Description: Text Data