auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] Difficulties understanding the behavior of TeX-parse-


From: Tassilo Horn
Subject: Re: [AUCTeX-devel] Difficulties understanding the behavior of TeX-parse-argument
Date: Tue, 05 Nov 2013 09:43:33 +0100
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)

Mosè Giordano <address@hidden> 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




reply via email to

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