[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: some problems with label inserting for enumerate
From: |
Arash Esbati |
Subject: |
Re: some problems with label inserting for enumerate |
Date: |
Tue, 24 Aug 2021 09:47:39 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 |
Uwe Brauer <oub@mat.ucm.es> writes:
>>>> "TH" == Tassilo Horn <tsdh@gnu.org> writes:
>
>> So use (LaTeX-current-environment) instead of the undefined variable
>> `environment'.
>
> Ah, lexical binding is a concept, that I should study more in detail for sure.
>
> So I tried
>
> (defun ub/LaTeX-item-enumerate ()
> (TeX-insert-macro "item")
> (save-excursion
> ; (LaTeX-label environment 'environment))) change to lexical binding
> (LaTeX-label LaTeX-current-environment 'LaTeX-current-environment)))
>
> Or
>
> (defun ub/LaTeX-item-enumerate ()
> (TeX-insert-macro "item")
> (save-excursion
> ; (LaTeX-label environment 'environment))) change to lexical binding
> (LaTeX-label LaTeX-current-environment 'environment)))
>
> Both worked in the sense that they inserted a item and did not return
> an error. However, no label was inserted, so the original functionality
> does not really work.
See the parentheses in Tassilo's message? Try:
(defun ub/LaTeX-item-enumerate ()
(TeX-insert-macro "item")
(save-excursion
;; (LaTeX-label environment 'environment))) change to lexical binding
(LaTeX-label (LaTeX-current-environment) 'environment)))
Best, Arash