开发者

emacs directory-local variable problem

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 开发者_C百科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.


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.


I had a very similar issue: emacs complaining with the same error on a .dir-locals.el file with similar content. In my case I've found the issue was in the invisible whitespace characters that were present in the file. (I've noticed Skype chat introduces weird space characters into text sometimes.) Once I've removed all extra whitespace, it worked.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜