[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-devel] Disable electric-pair-mode.
From: |
Mosè Giordano |
Subject: |
[AUCTeX-devel] Disable electric-pair-mode. |
Date: |
Fri, 29 Nov 2013 15:26:47 +0100 |
Hi Tassilo,
> diff --git a/tex.el b/tex.el
> index 07c452e..ea882f6 100644
> --- a/tex.el
> +++ b/tex.el
> @@ -3169,7 +3169,13 @@ The algorithm is as follows:
> (when (or (not (file-exists-p (buffer-file-name)))
> (eq TeX-master 'shared))
> (TeX-master-file nil nil t))
> - (TeX-update-style t)) nil t))
> + (TeX-update-style t)) nil t)
> + ;; AUCTeX brace pairing feature doesn't play nice with `electric-pair-mode'
> + ;; which is a global minor mode as of emacs 24.4.
> + (when (and (boundp 'electric-pair-mode)
> + (boundp 'electric-pair-inhibit-predicate))
> + (set (make-local-variable 'electric-pair-inhibit-predicate)
> + (lambda (char) t))))
>
>
> ;;; Hilighting
Actually `electric-pair-mode' was introduced in Emacs 24.1, but
`electric-pair-inhibit-predicate' was added to Emacs only in the
current development version. In my .emacs I have something like this:
(set (make-local-variable 'electric-pair-mode) nil)
to disable `electric-pair-mode' when `LaTeX-electric-left-right-brace'
is non-nil, as suggested by Stefan Monnier here:
https://lists.gnu.org/archive/html/bug-gnu-emacs/2011-11/msg00354.html
This is compatible also with Emacs < 24.4.
Bye,
Mosè
- [AUCTeX-devel] Disable electric-pair-mode.,
Mosè Giordano <=