[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: some problems with label inserting for enumerate
From: |
Uwe Brauer |
Subject: |
Re: some problems with label inserting for enumerate |
Date: |
Tue, 24 Aug 2021 09:24:33 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
>>> "TH" == Tassilo Horn <tsdh@gnu.org> writes:
Hi Tassilo
> Uwe Brauer <oub@mat.ucm.es> writes:
> Hi Uwe,
>> |
>> | Debugger entered--Lisp error: (void-variable environment)
>> | (LaTeX-label environment 'environment)
>> | (save-excursion (LaTeX-label environment 'environment))
>> | ub/LaTeX-item-enumerate()
>> | LaTeX-insert-item()
>> | funcall-interactively(LaTeX-insert-item)
>> | call-interactively(LaTeX-insert-item nil nil)
>> | command-execute(LaTeX-insert-item)
>> `----
>>
>> What has changed?
> A lot! (In the current case, we're using lexical binding now so you
> can't access local variables of the calling function in the called
> function anymore.)
> 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.
Regards
Uwe
smime.p7s
Description: S/MIME cryptographic signature