Mosè Giordano <giordano.m...@libero.it> writes:

Hi Mosè,

> I'm having a hard time understanding why this code
>
>     (let ((foo '(("foo") ("bar"))))
>       (TeX-parse-argument t '(TeX-read-key-val foo)))
>
> works but this
>
>     (TeX-parse-argument t '(TeX-read-key-val '(("foo") ("bar"))))
>
> doesn't, resulting in a wrong-type-argument error.  In the outer
> `cond` of `TeX-parse-argument', both codes enter the `(listp arg)'
> branch and in the next `cond' they enter then the `(symbolp head)'
> branch, but the two codes run differently if the CDR of `arg' is a
> symbol or a lisp expression.  Why?

In the first call, arg is (TeX-read-key-val foo), which is interpreted
as a funcall of the CAR to the symbol value of the CDR.

In the second call, arg is (TeX-read-key-val (quote (("foo") ("bar")))).
Note that the list is quoted!  To make both calls equivalent, don't
double-quote:

  (TeX-parse-argument t '(TeX-read-key-val (("foo") ("bar"))))

It seems your coffee reservoirs are nearly empty. ;-)

Bye,
Tassilo


_______________________________________________
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to