auctex
[Top][All Lists]
Advanced

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

Re: add-to-list on lexical vars (Re: Error on loading polyglossia.el)


From: Ikumi Keita
Subject: Re: add-to-list on lexical vars (Re: Error on loading polyglossia.el)
Date: Sat, 09 Jan 2021 22:07:54 +0900

>>>>> Tassilo Horn <tsdh@gnu.org> writes:
> While you are at it, could you please add some TeX-add-to-alist tests to
> our suite.  Looking at your relevant diff hunk it is obvious that this
> function isn't trivial and some tests are justified.

OK, the attached revised patch includes a new test.

>> and `TeX-add-to-alist' runs without error for me, even without the
>> patch.

> Not for me.  Just eval in *scratch* which has lexical-binding at least
> in my emacs master checkout:
> (let ((alist nil))
>   (TeX-add-to-alist 'alist '((a 1)))
>   alist) ;; <== C-j here

Well, that wouldn't work even after my patch is applied. Here the symbol
`alist' is lexically scoped variable and the `symbol-value' causes
error, before `add-to-list' does.

When the first argument of `TeX-add-to-alist' is dynamic scope variable,
it runs without error in e.g. `LaTeX-arg-usepackage-insert', without my
patch.

(`TeX-add-to-alist' is used only for building
LaTeX-provided-{class,package}-options, thus I suppose it's enough that
`TeX-add-to-alist' allows only dynamic scope variable as its first
argument.)

Regards,
Ikumi Keita

Attachment: add-to-list-on-lexical-vars-2
Description: new test included


reply via email to

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