[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: File local-variables broken?
From: |
Alan Mackenzie |
Subject: |
Re: File local-variables broken? |
Date: |
Tue, 29 Apr 2008 20:44:04 +0000 |
User-agent: |
Mutt/1.5.9i |
Hi, Neal!
On Mon, Apr 28, 2008 at 09:17:30AM -0400, Neal Becker wrote:
> Was file local-variables broken by a recent svn?
> File local-variables error: (error "Argument to c-set-style was not a
> string")
> This is the offending code:
> // Local Variables: **
> // mode:c **
> // c-file-style:linux ** <===========
> // c-basic-offset:4 **
> // End: **
There are two bugs here. The first one is in your source, and the error
message tried to point it out. If you change the offending line to:
// c-file-style:"linux" **
it will work.
The second bug is in CC Mode, because it gives an unhelpful error
message. The patch below will give a more helpful message. Please try
it out and confirm it does the right thing.
*** cc-mode.el~ 2008-04-24 17:40:45.000000000 +0000
--- cc-mode.el 2008-04-29 20:40:16.781230872 +0000
***************
*** 713,720 ****
(when c-buffer-is-cc-mode
(if (or c-file-style c-file-offsets)
(c-make-styles-buffer-local t))
! (and c-file-style
! (c-set-style c-file-style))
(and c-file-offsets
(mapc
(lambda (langentry)
--- 713,722 ----
(when c-buffer-is-cc-mode
(if (or c-file-style c-file-offsets)
(c-make-styles-buffer-local t))
! (when c-file-style
! (or (stringp c-file-style)
! (error "c-file-style is not a string"))
! (c-set-style c-file-style))
(and c-file-offsets
(mapc
(lambda (langentry)
--
Alan Mackenzie (Nuremberg, Germany).