Subject: bug#37124: closed (Re: bug#37124: Lisp snippet for TeX-electric-math in manual)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 22 Aug 2019 22:33:02 +0000

Your bug report

#37124: Lisp snippet for TeX-electric-math in manual

which was filed against the auctex package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
37124: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=37124
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#37124: Lisp snippet for TeX-electric-math in manual
From: Arash Esbati <[email-masked]>
To: Mosè Giordano <[email-masked]>
Cc: [email-masked]
Date: Fri, 23 Aug 2019 00:20:29 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Mosè Giordano <[email-masked]> writes:

> On Tue, 20 Aug 2019 at 22:57, Arash Esbati <[email-masked]> wrote:
>>
>> Hi all,
>>
>> there is a lisp snippet in the manual for `TeX-electric-math'[1]:
>>
>>     (add-hook 'plain-TeX-mode-hook
>>               (lambda () (set (make-variable-buffer-local 'TeX-electric-math)
>>                               (cons "$" "$"))))
>>     (add-hook 'LaTeX-mode-hook
>>               (lambda () (set (make-variable-buffer-local 'TeX-electric-math)
>>                               (cons "\\(" "\\)"))))
>>
>> `make-variable-buffer-local' seems wrong to me, I think
>> `make-local-variable' is the intended function.
>
> I think you're correct.

Hi Mosè,

thanks for your response.  I've pushed the change.  Closing this one.

Best, Arash

Subject: Lisp snippet for TeX-electric-math in manual
From: Arash Esbati <[email-masked]>
To: auctex-bugs <[email-masked]>
Date: Tue, 20 Aug 2019 22:53:11 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi all,

there is a lisp snippet in the manual for `TeX-electric-math'[1]:

    (add-hook 'plain-TeX-mode-hook
              (lambda () (set (make-variable-buffer-local 'TeX-electric-math)
                              (cons "$" "$"))))
    (add-hook 'LaTeX-mode-hook
              (lambda () (set (make-variable-buffer-local 'TeX-electric-math)
                              (cons "\\(" "\\)"))))

`make-variable-buffer-local' seems wrong to me, I think
`make-local-variable' is the intended function.  Am I missing something?
Otherwise I'd install the following patch:

--8<---------------cut here---------------start------------->8---
diff --git a/doc/auctex.texi b/doc/auctex.texi
index 693fdf6b..cb257572 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -459,10 +459,10 @@ and @samp{\(...\)} in @LaTeX{} files by pressing @kbd{$}, add the
 following to your init file
 @lisp
 (add-hook 'plain-TeX-mode-hook
-         (lambda () (set (make-variable-buffer-local 'TeX-electric-math)
+         (lambda () (set (make-local-variable 'TeX-electric-math)
                          (cons "$" "$"))))
 (add-hook 'LaTeX-mode-hook
-         (lambda () (set (make-variable-buffer-local 'TeX-electric-math)
+         (lambda () (set (make-local-variable 'TeX-electric-math)
                          (cons "\\(" "\\)"))))
 @end lisp
--8<---------------cut here---------------end--------------->8---

Best, Arash

Footnotes:
[1]  https://www.gnu.org/software/auctex/manual/auctex.html#index-TeX_002delectric_002dmath