help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: List-of-lists data structure


From: Joost Kremers
Subject: Re: List-of-lists data structure
Date: 13 Apr 2014 07:49:43 GMT
User-agent: slrn/pre1.0.0-18 (Linux)

Jacob Gerlach wrote:
> However, if I try to expand the list:
>
> (setq name-and-keyword-list
>       '("pFoo" ("foo" "bar" "baz"))
>       '("pBar" ("apples" "pears" "orange")))
>
> Building the list gives:
> Wrong type argument: symbolp, (quote ("pBar" ("apples" "pears"
> "orange")))

The error message (which IMHO is a bit cryptic), says that it is
expecting a symbol but getting a list. The point is, your setq is wrong.
The arguments of setq need to be pairs of [symbol value]. You specify a
symbol and then two lists. What you (apparently) want is a list of
lists:

(setq name-and-keyword-list
      '(("pFoo" ("foo" "bar" "baz"))
        ("pBar" ("apples" "pears" "orange"))))

However, I was wondering the same thing as Stefan: why not use the
=-sign to anchor your font-lock entry? Seems much easier.

-- 
Joost Kremers                                   address@hidden
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


reply via email to

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