[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#47936: AucTeX and electric-pair-mode

From: Tassilo Horn
Subject: bug#47936: AucTeX and electric-pair-mode
Date: Wed, 21 Apr 2021 21:54:57 +0200
User-agent: mu4e 1.5.11; emacs 28.0.50

Philip Kaludercic <philipk@posteo.net> writes:

Hi Philip,

> 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.

Ok, makes sense.

> The attached patch would propose a solution that respects
> electric-pair-mode and doesn't insert an extra closing pair if
> enabled.

> @@ -2979,6 +2979,8 @@ is nil, consult user which brace should be used."
>      (if rmacro
>          (insert TeX-esc rmacro))
>      (cond
> +     ((and (string= (char-to-string last-command-event) lbrace)
> +           electric-pair-mode))
>       ((and TeX-arg-right-insert-p rbrace)
>        (insert rbrace))
>       (rmacro

LGTM, I've applied it with slight modifications and a ChangeLog style
commit message following our/Emacs conventions.

Thanks a lot, Philip!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]