GNU bug report logs -
#47936
AucTeX and electric-pair-mode
Previous Next
Full log
View this message in rfc822 format
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.