* File local-variables broken?
@ 2008-04-28 13:17 Neal Becker
2008-04-29 3:48 ` Glenn Morris
2008-04-29 20:44 ` Alan Mackenzie
0 siblings, 2 replies; 6+ messages in thread
From: Neal Becker @ 2008-04-28 13:17 UTC (permalink / raw)
To: emacs-devel
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: **
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: File local-variables broken?
2008-04-28 13:17 File local-variables broken? Neal Becker
@ 2008-04-29 3:48 ` Glenn Morris
2008-04-29 11:50 ` Neal Becker
2008-04-29 20:44 ` Alan Mackenzie
1 sibling, 1 reply; 6+ messages in thread
From: Glenn Morris @ 2008-04-29 3:48 UTC (permalink / raw)
To: Neal Becker; +Cc: emacs-devel
Neal Becker wrote:
> Was file local-variables broken by a recent svn?
Since we don't use subversion, the answer can only be "no". ;)
> 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: **
Works for me.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: File local-variables broken?
2008-04-29 3:48 ` Glenn Morris
@ 2008-04-29 11:50 ` Neal Becker
2008-04-29 13:25 ` Juanma Barranquero
0 siblings, 1 reply; 6+ messages in thread
From: Neal Becker @ 2008-04-29 11:50 UTC (permalink / raw)
To: emacs-devel
Glenn Morris wrote:
> Neal Becker wrote:
>
>> Was file local-variables broken by a recent svn?
>
> Since we don't use subversion, the answer can only be "no". ;)
>
>> 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: **
>
> Works for me.
Tested again with emacs cvs as of this morning. Still broken.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: File local-variables broken?
2008-04-29 11:50 ` Neal Becker
@ 2008-04-29 13:25 ` Juanma Barranquero
2008-04-29 13:25 ` Juanma Barranquero
0 siblings, 1 reply; 6+ messages in thread
From: Juanma Barranquero @ 2008-04-29 13:25 UTC (permalink / raw)
To: Neal Becker; +Cc: bug-cc-mode, emacs-devel
On Tue, Apr 29, 2008 at 1:50 PM, Neal Becker <ndbecker2@gmail.com> wrote:
>> This is the offending code:
>> // Local Variables: **
>> // mode:c **
>> // c-file-style:linux **
>> // c-basic-offset:4 **
>> // End: **
I see the problem. `c-file-style' complains (correctly) because
`linux' is not a string. Using
// c-file-style:"linux" **
works as expected. Now, the problem can be trivially fixed either by
making `c-set-style' to accept also a symbol as first arg (and take
its name), or forcing `c-postprocess-file-styles' to pass a string to
`c-file-style'. Whether that would be a user convenience or an ugly
hack is for the CC maintainers to decide :-)
Juanma
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: File local-variables broken?
2008-04-28 13:17 File local-variables broken? Neal Becker
2008-04-29 3:48 ` Glenn Morris
@ 2008-04-29 20:44 ` Alan Mackenzie
1 sibling, 0 replies; 6+ messages in thread
From: Alan Mackenzie @ 2008-04-29 20:44 UTC (permalink / raw)
To: Neal Becker; +Cc: emacs-devel
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).
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-04-29 20:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-28 13:17 File local-variables broken? Neal Becker
2008-04-29 3:48 ` Glenn Morris
2008-04-29 11:50 ` Neal Becker
2008-04-29 13:25 ` Juanma Barranquero
2008-04-29 13:25 ` Juanma Barranquero
2008-04-29 20:44 ` Alan Mackenzie
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.