GNU bug report logs - #3808
23.1.50; CC-mode: Impossible to set c-cleanup-list

Previous Next

Package: emacs;

Reported by: "Jan D." <jan.h.d <at> swipnet.se>

Date: Fri, 10 Jul 2009 11:20:04 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 3808 in the body.
You can then email your comments to 3808 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3808; Package emacs. (Fri, 10 Jul 2009 11:20:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Jan D." <jan.h.d <at> swipnet.se>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 10 Jul 2009 11:20:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Jan D." <jan.h.d <at> swipnet.se>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.1.50; CC-mode: Impossible to set c-cleanup-list
Date: Fri, 10 Jul 2009 13:14:45 +0200
I customize c-cleanup-list.  This is then the full contents of my
.emacs:
(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(c-cleanup-list (quote (scope-operator space-before-funcall))))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )

I start emacs with --no-site-file, open a .c-file.
Check the value of c-cleanup-list:

c-cleanup-list is a variable defined in `cc-vars.el'.
Its value is (scope-operator)

Local in buffer xftfont.c; global value is 
(scope-operator space-before-funcall)

And indeed, space-before-funcall is not in effect.  It seems impossible to
set this variable.  I also tried setting c-old-style-variable-behavior to t,
but it made no difference.

The manual needs to explain how to set variables in a manner that works,
an example with lisp to add to .emacs would be nice also.



In GNU Emacs 23.1.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.16.1)
 of 2009-07-10 on gaffa
Windowing system distributor `The X.Org Foundation', version 11.0.10600000
configured using `configure  '--prefix=/opt/emacs-cvs' '--verbose' '--enable-asserts' '--with-x-toolkit=gtk' 'CFLAGS=-g''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: C
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: sv_SE.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: C/l

Minor modes in effect:
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
C-h v c - c l e <tab> <return> C-x 1 <next> <next> 
<down-mouse-4> <mouse-4> <double-down-mouse-4> <double-mouse-4> 
<triple-down-mouse-4> <triple-mouse-4> <down-mouse-1> 
<mouse-1> s t a t i c SPC v o i d <return> f o o ( 
) <return> { <return> <tab> i n SPC <backspace> t SPC 
i SPC = S-SPC b a r ( ) ; <backspace> <backspace> a 
) ; C-a <up> <up> <up> C-_ C-_ C-_ C-_ C-_ C-_ C-_ 
C-_ C-_ C-_ C-_ C-_ C-_ C-_ C-_ C-_ C-_ C-_ C-_ C-_ 
C-_ C-x 1 M-x r e p o r t - e m <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Loading vc-cvs...done
Invalid image size (see `max-image-size') [30 times]
Type C-x 4 C-o RET to restore the other window, C-M-v to scroll help.
Undo! [20 times]
undo-more: No further undo information



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3808; Package emacs. (Sat, 11 Jul 2009 11:40:19 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alan Mackenzie <acm <at> muc.de>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sat, 11 Jul 2009 11:40:20 GMT) Full text and rfc822 format available.

Message #10 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: "Jan D." <jan.h.d <at> swipnet.se>, 3808 <at> debbugs.gnu.org
Cc: emacs-pretest-bug <at> gnu.org
Subject: Re: bug#3808: 23.1.50; CC-mode: Impossible to set c-cleanup-list
Date: Sat, 11 Jul 2009 11:36:38 +0000
Hi, Jan!

On Fri, Jul 10, 2009 at 01:14:45PM +0200, Jan D. wrote:
> I customize c-cleanup-list.  This is then the full contents of my
> .emacs:
> (custom-set-variables
>   ;; custom-set-variables was added by Custom.
>   ;; If you edit it by hand, you could mess it up, so be careful.
>   ;; Your init file should contain only one such instance.
>   ;; If there is more than one, they won't work right.
>  '(c-cleanup-list (quote (scope-operator space-before-funcall))))
> (custom-set-faces
>   ;; custom-set-faces was added by Custom.
>   ;; If you edit it by hand, you could mess it up, so be careful.
>   ;; Your init file should contain only one such instance.
>   ;; If there is more than one, they won't work right.
>  )

> I start emacs with --no-site-file, open a .c-file.

Just done this, in a new userid, having copied your .emacs.  To be sure,
I tried on a freshly updated CVS Emacs.

> Check the value of c-cleanup-list:

> c-cleanup-list is a variable defined in `cc-vars.el'.
> Its value is (scope-operator)

I can't reproduce the problem; I get:

    Its value is
    (scope-operator space-before-funcall)

, just as desired.

> Local in buffer xftfont.c; global value is 
> (scope-operator space-before-funcall)

Well, that looks OK.  :-)

Might it be that there's a local variables section at the end of
xftfont.c which is overriding c-cleanup-list?

> And indeed, space-before-funcall is not in effect.  It seems impossible to
> set this variable.  I also tried setting c-old-style-variable-behavior to t,
> but it made no difference.

> The manual needs to explain how to set variables in a manner that works,
> an example with lisp to add to .emacs would be nice also.

"The manual" being the CC Mode manual, of course.  In the appendix
"Sample .emacs File", there's an example of c-cleanup-list being set in a
style.  The instructions on how to set "style variables" in general (of
which c-cleanup-list is one) are on the page "Configuration Basics" and
its sup-page "Style Variables".

So I think the information is there, but perhaps it's not easy enough to
find.  Could you, perhaps, reconstruct how you went about looking for the
info?  Maybe the manual needs an extra hint or two somewhere.  Thanks!

-- 
Alan Mackenzie (Nuremberg, Germany).



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3808; Package emacs. (Sat, 11 Jul 2009 11:40:31 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alan Mackenzie <acm <at> muc.de>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sat, 11 Jul 2009 11:40:31 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3808; Package emacs. (Sun, 12 Jul 2009 10:40:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Djärv <jan.h.d <at> swipnet.se>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 12 Jul 2009 10:40:06 GMT) Full text and rfc822 format available.

Message #20 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 3808 <at> debbugs.gnu.org, emacs-pretest-bug <at> gnu.org
Subject: Re: bug#3808: 23.1.50; CC-mode: Impossible to set c-cleanup-list
Date: Sun, 12 Jul 2009 12:33:01 +0200

Alan Mackenzie skrev:
> Hi, Jan!
> 
> On Fri, Jul 10, 2009 at 01:14:45PM +0200, Jan D. wrote:
>> I customize c-cleanup-list.  This is then the full contents of my
>> .emacs:
>> (custom-set-variables
>>   ;; custom-set-variables was added by Custom.
>>   ;; If you edit it by hand, you could mess it up, so be careful.
>>   ;; Your init file should contain only one such instance.
>>   ;; If there is more than one, they won't work right.
>>  '(c-cleanup-list (quote (scope-operator space-before-funcall))))
>> (custom-set-faces
>>   ;; custom-set-faces was added by Custom.
>>   ;; If you edit it by hand, you could mess it up, so be careful.
>>   ;; Your init file should contain only one such instance.
>>   ;; If there is more than one, they won't work right.
>>  )
> 
>> I start emacs with --no-site-file, open a .c-file.
> 
> Just done this, in a new userid, having copied your .emacs.  To be sure,
> I tried on a freshly updated CVS Emacs.
> 
>> Check the value of c-cleanup-list:
> 
>> c-cleanup-list is a variable defined in `cc-vars.el'.
>> Its value is (scope-operator)
> 
> I can't reproduce the problem; I get:
> 
>     Its value is
>     (scope-operator space-before-funcall)
> 
> , just as desired.
> 
>> Local in buffer xftfont.c; global value is 
>> (scope-operator space-before-funcall)
> 
> Well, that looks OK.  :-)
> 
> Might it be that there's a local variables section at the end of
> xftfont.c which is overriding c-cleanup-list?
> 

No, but since this is in the emacs source tree, there is a .dir-locals.el
at the root of the source tree, and that comes in effect.  So it is not that 
it doesn't work, it is just this situation (setting c-file-style as a file 
local variable has the same effect).

So what happens is:
c-mode sets style to GNU.
My customization is applied.
.dir-locals.el sets style to GNU, thus erasing my customization.

>> And indeed, space-before-funcall is not in effect.  It seems impossible to
>> set this variable.  I also tried setting c-old-style-variable-behavior to t,
>> but it made no difference.
> 
>> The manual needs to explain how to set variables in a manner that works,
>> an example with lisp to add to .emacs would be nice also.
> 
> "The manual" being the CC Mode manual, of course.  In the appendix
> "Sample .emacs File", there's an example of c-cleanup-list being set in a
> style.  The instructions on how to set "style variables" in general (of
> which c-cleanup-list is one) are on the page "Configuration Basics" and
> its sup-page "Style Variables".
> 
> So I think the information is there, but perhaps it's not easy enough to
> find.  Could you, perhaps, reconstruct how you went about looking for the
> info?  Maybe the manual needs an extra hint or two somewhere.  Thanks!
> 

The situation above, i.e. how to preserve my customization when .dir-locals.el 
or file variables are in effect is not described.

I tried the mode hook, it didn't work either.  Is there a c-set-style hook?

	Jan D.



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3808; Package emacs. (Sun, 12 Jul 2009 10:40:10 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Djärv <jan.h.d <at> swipnet.se>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 12 Jul 2009 10:40:10 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3808; Package emacs. (Sun, 12 Jul 2009 14:10:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alan Mackenzie <acm <at> muc.de>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 12 Jul 2009 14:10:05 GMT) Full text and rfc822 format available.

Message #30 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Jan Djärv <jan.h.d <at> swipnet.se>
Cc: 3808 <at> debbugs.gnu.org, emacs-pretest-bug <at> gnu.org
Subject: Re: bug#3808: 23.1.50; CC-mode: Impossible to set c-cleanup-list
Date: Sun, 12 Jul 2009 14:06:38 +0000
Hi, Jan!

On Sun, Jul 12, 2009 at 12:33:01PM +0200, Jan Djärv wrote:


> Alan Mackenzie skrev:
> >Hi, Jan!

> >On Fri, Jul 10, 2009 at 01:14:45PM +0200, Jan D. wrote:
> >>I customize c-cleanup-list.  This is then the full contents of my
> >>.emacs:
> >>(custom-set-variables
> >>  ;; custom-set-variables was added by Custom.
> >>  ;; If you edit it by hand, you could mess it up, so be careful.
> >>  ;; Your init file should contain only one such instance.
> >>  ;; If there is more than one, they won't work right.
> >> '(c-cleanup-list (quote (scope-operator space-before-funcall))))
> >>(custom-set-faces
> >>  ;; custom-set-faces was added by Custom.
> >>  ;; If you edit it by hand, you could mess it up, so be careful.
> >>  ;; Your init file should contain only one such instance.
> >>  ;; If there is more than one, they won't work right.
> >> )

> >>I start emacs with --no-site-file, open a .c-file.

> >Just done this, in a new userid, having copied your .emacs.  To be sure,
> >I tried on a freshly updated CVS Emacs.

> >>Check the value of c-cleanup-list:

> >>c-cleanup-list is a variable defined in `cc-vars.el'.
> >>Its value is (scope-operator)

> >I can't reproduce the problem; I get:

> >    Its value is
> >    (scope-operator space-before-funcall)

> >, just as desired.

> >>Local in buffer xftfont.c; global value is 
> >>(scope-operator space-before-funcall)

> >Well, that looks OK.  :-)

> >Might it be that there's a local variables section at the end of
> >xftfont.c which is overriding c-cleanup-list?

> No, but since this is in the emacs source tree, there is a .dir-locals.el
> at the root of the source tree, and that comes in effect.  So it is not 
> that it doesn't work, it is just this situation (setting c-file-style as a 
> file local variable has the same effect).

<MASSIVE GROAN>  Ohhh nooooooo.  I wasn't aware of this .dir-locals.el
facility.  I suppose I should have been - it's been discussed on
emacs-devel before now.  Complexity upon complexity!  Who needs this?
Who wants it?

> So what happens is:
> c-mode sets style to GNU.
> My customization is applied.
> .dir-locals.el sets style to GNU, thus erasing my customization.

The bug would appear to be the time at which these directory level
customisations are done.

I think it makes some sort of sense for _file_ local variables to be
highest priority - It's a fairly rare thing, only done for a particular
need, and if somebody specifies a particular setting of, say,
`c-cleanup-list' in the file locals, there'll be a damn good reason for
it.

But directory level?  Surely they are of LOWEST priority - to have them
overriding things set in hooks etc., is insanity.

> >>And indeed, space-before-funcall is not in effect.  It seems impossible to
> >>set this variable.  I also tried setting c-old-style-variable-behavior to 
> >>t,
> >>but it made no difference.

> >>The manual needs to explain how to set variables in a manner that works,
> >>an example with lisp to add to .emacs would be nice also.

> >"The manual" being the CC Mode manual, of course.  In the appendix
> >"Sample .emacs File", there's an example of c-cleanup-list being set in a
> >style.  The instructions on how to set "style variables" in general (of
> >which c-cleanup-list is one) are on the page "Configuration Basics" and
> >its sup-page "Style Variables".

> >So I think the information is there, but perhaps it's not easy enough to
> >find.  Could you, perhaps, reconstruct how you went about looking for the
> >info?  Maybe the manual needs an extra hint or two somewhere.  Thanks!


> The situation above, i.e. how to preserve my customization when 
> .dir-locals.el or file variables are in effect is not described.

Yes.  In the case of file local variables, the FM states (page "Config
Basics") that they supersede settings made in other ways.  This is surely
their point - they're intended for rare (high priority) use.  For
example, you might want to use a different style (C style, as described
on page "Styles" in the fine manual) for a particular source file that
was imported from somewhere else, so as not to cause masses of
reformatting diffs.

> I tried the mode hook, it didn't work either.  Is there a c-set-style hook?

Now, you're being sarcastic here, aren't you?  PLEASE tell me you're
being sarcastic.  :-)  (Note, I don't blame you.  I would be too, in your
position.)

I'll bring this matter up on emacs-devel.  Bare with me!

> 	Jan D.

-- 
Alan Mackenzie (Nuremberg, Germany).



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3808; Package emacs. (Sun, 12 Jul 2009 14:10:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alan Mackenzie <acm <at> muc.de>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 12 Jul 2009 14:10:06 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3808; Package emacs. (Sun, 12 Jul 2009 15:30:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Djärv <jan.h.d <at> swipnet.se>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 12 Jul 2009 15:30:04 GMT) Full text and rfc822 format available.

Message #40 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 3808 <at> debbugs.gnu.org, emacs-pretest-bug <at> gnu.org
Subject: Re: bug#3808: 23.1.50; CC-mode: Impossible to set c-cleanup-list
Date: Sun, 12 Jul 2009 17:21:23 +0200
Alan Mackenzie skrev:
> Hi, Jan!

Hi.

> 
>> I tried the mode hook, it didn't work either.  Is there a c-set-style hook?
> 
> Now, you're being sarcastic here, aren't you?  PLEASE tell me you're
> being sarcastic.  :-)  (Note, I don't blame you.  I would be too, in your
> position.)

Not really, I could think of uses for such a hook.

> 
> I'll bring this matter up on emacs-devel.  Bare with me!
> 

Okay.

	Jan D.



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3808; Package emacs. (Sun, 12 Jul 2009 15:30:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Djärv <jan.h.d <at> swipnet.se>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 12 Jul 2009 15:30:08 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to "Jan D." <jan.h.d <at> swipnet.se> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> emacsbugs.donarmstrong.com. (Mon, 20 Jul 2009 14:00:06 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Mon, 17 Aug 2009 14:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 308 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.