tags:

views:

112

answers:

1

I'm using a recent version of NTEmacs. I wrote a file named ".dir-locals.el" like following.

((nil . ((tab-width . 8)
        (fill-column . 70)))
 (c-mode . ((c-file-style . "GNU"))))

and I opened a c file in the subdirectory, I got an error message :

Directory-local variables error: (wrong-type-argument listp message)

I can't find out what's wrong with that code.

+2  A: 

The second part of the expression is a list of variables so you need more brackets

((nil . 
  ((tag-width . 8)
  (fill-column . 70)))
 (c-mode . 
 ((c-file-style . "GNU"))))

This worked for me. To get it working I added a quote at the beginning and evaluated the expression, then tracked it down from there.

Then removed the quote when it was working.

justinhj
I tried with that exactly bracketed code, but it still says the same.
kjshim
You may have missed my edit a few minutes ago, as the first try was mis-paste.
justinhj
HaHa. Best thing to tell someone writing lisp: "...you need more brackets."
kjfletch