[Top][All Lists]

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

Re: Extending TeX-read-key-val

From: Arash Esbati
Subject: Re: Extending TeX-read-key-val
Date: Wed, 27 Oct 2021 21:50:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50

Hi Tassilo and Keita,

Tassilo Horn <> writes:

> Arash Esbati <> writes:
> Hi Arash & Keita,
>>> Two minor points I noticed:
>>> 1. Maybe 
>>>      (symbol-value key-val-alist)
>>>    is more appropriate than
>>>      (eval key-val-alist t)
>>>    for its directness.
>> In general, you're right, but since we have turned on lexical binding in
>> AUCTeX, we have this situation:
>> ,----[ C-h f eval RET ]
>> | eval is a built-in function in ‘C source code’.
>> | 
>> | (eval FORM &optional LEXICAL)
>> | 
>> | Evaluate FORM and return its value.
>> | If LEXICAL is t, evaluate using lexical scoping.
>> | LEXICAL can also be an actual lexical environment, in the form of an
>> | alist mapping symbols to their value.
>> `----
>> and
>> ,----[ C-h f symbol-value RET ]
>> | symbol-value is a built-in function in ‘C source code’.
>> | 
>> | (symbol-value SYMBOL)
>> | 
>> | Return SYMBOL’s value.  Error if that is void.
>> | Note that if ‘lexical-binding’ is in effect, this returns the
>> | global value outside of any lexical scope.
>> `----
> Hm, I don't really understand that sentence.

I had a specific picture in my mind where that last sentence might
apply, but after taking your examples and playing with them, I see that
I was wrong.  Hence, I admit I don't understand that last sentence

Maybe I drop a line to emacs-devel mailing list and ask.  At any rate, I
think I can take the suggestion given by Keita once I update
`TeX-read-key-val' in latex.el.

> (info "(elisp) Accessing Variables") doesn't enlighten me, too.

Maybe a relevant sentence is this one in 12.10.3 Lexical Binding[1]:

    Note that unlike dynamic variables which are tied to the symbol
    object itself, the relationship between lexical variables and
    symbols is only present in the interpreter (or compiler).
    Therefore, functions which take a symbol argument (like
    symbol-value, boundp, and set) can only retrieve or modify a
    variable’s dynamic binding (i.e., the contents of its symbol’s value

Which then doesn't fit to the docstring above.

Best, Arash


reply via email to

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