[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX-devel] Disable electric-pair-mode.
From: |
Tassilo Horn |
Subject: |
Re: [AUCTeX-devel] Disable electric-pair-mode. |
Date: |
Fri, 29 Nov 2013 18:07:06 +0100 |
User-agent: |
Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) |
Mosè Giordano <address@hidden> writes:
>> 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.
Ah, that's better. Feel free to change it.
Bye,
Tassilo