auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] Disable electric-pair-mode.


From: Mosè Giordano
Subject: Re: [AUCTeX-devel] Disable electric-pair-mode.
Date: Fri, 29 Nov 2013 18:44:49 +0100

2013/11/29 Tassilo Horn <address@hidden>:
> 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.
>

Ok, my only doubt is whether the condition should be

  (boundp 'electric-pair-mode)

or

  (and LaTeX-electric-left-right-brace
         (boundp 'electric-pair-mode))

In the latter case, I suppose the code should be moved to
`LaTeX-common-initialization'.

Bye,
Mosè



reply via email to

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