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


Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 47936-done <at> debbugs.gnu.org, bug-auctex <at> gnu.org
Subject: Re: bug#47936: AucTeX and electric-pair-mode
Date: Wed, 21 Apr 2021 21:54:57 +0200
Philip Kaludercic <philipk <at> 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!

Bye,
Tassilo




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.