>>> "TH" == Tassilo Horn <[email protected]> writes:
Hi Tassilo


> Uwe Brauer <[email protected]> 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 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to