On 03/06/2012 11:22 PM, Eric M. Ludlam wrote:
> On 03/06/2012 09:17 AM, Widger, Niels wrote:
>> I've been trying to use the :local-variables slot in ede-project to
>> automatically set compile-command based on the current project. This
>> slot is defined to be a list such as
>>
>> ((VARIABLE VALUE) (VARIABLE VALUE)...)
>>
>> however the current definition of ede-set-project-variables in the BZR
>> repository winds up setting each VARIABLE to (VALUE) instead of VALUE:
>>
>> http://cedet.bzr.sourceforge.net/bzr/cedet/code/trunk/annotate/head%3A/ede/ede.el#L1422
>>
>> I believe that line 1422 should be changed from
>>
>> (set (car v) (cdr v)))))
>>
>> to
>>
>> (set (car v) (car (cdr v))))))
>
> Thanks for discovering that! It also points out another area I have no
> tests, so I will see if I can find a nice way to add tests along with
> your patch.
Hi again Niels,
To reply to myself, it turns out that the :local-variables slot is
supposed to be an ASSOCiation list, not a list of 2 element lists. That
means you should set the slot as:
((VARIABLE . VALUE) (VARIABLE . VALUE))
as opposed to what you have above. If you do that, it will match what
is in custom buffers.
As such, no patch is needed for this specific case. It is still true
that I need to add some tests, as there is dead non-functional code in
EDE I found while investigating this.
The local variable slot doesn't have a type. Some assoc list predicate
is needed to finish this off to prevent this class of mistake in the future.
Eric
|