From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#3808: 23.1.50; CC-mode: Impossible to set c-cleanup-list Date: Sun, 12 Jul 2009 14:06:38 +0000 Message-ID: <20090712140638.GA2524@muc.de> References: <200907101114.n6ABEjXQ030837@gaffa.localdomain> <20090711113638.GA1088@muc.de> <4A59BBDD.4080905@swipnet.se> Reply-To: Alan Mackenzie , 3808@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1247408272 2910 80.91.229.12 (12 Jul 2009 14:17:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 12 Jul 2009 14:17:52 +0000 (UTC) Cc: 3808@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org To: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 12 16:17:44 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MPzs5-0002cu-VR for geb-bug-gnu-emacs@m.gmane.org; Sun, 12 Jul 2009 16:17:42 +0200 Original-Received: from localhost ([127.0.0.1]:58581 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MPzs5-0006A3-78 for geb-bug-gnu-emacs@m.gmane.org; Sun, 12 Jul 2009 10:17:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MPzs0-00068I-6h for bug-gnu-emacs@gnu.org; Sun, 12 Jul 2009 10:17:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MPzru-00063t-U8 for bug-gnu-emacs@gnu.org; Sun, 12 Jul 2009 10:17:35 -0400 Original-Received: from [199.232.76.173] (port=60510 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MPzru-00063Y-KZ for bug-gnu-emacs@gnu.org; Sun, 12 Jul 2009 10:17:30 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:34908) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MPzru-0004Hl-3P for bug-gnu-emacs@gnu.org; Sun, 12 Jul 2009 10:17:30 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6CEHRpQ003539; Sun, 12 Jul 2009 07:17:28 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n6CEA6fc002277; Sun, 12 Jul 2009 07:10:06 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Alan Mackenzie Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 12 Jul 2009 14:10:06 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3808 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 3808-submit@emacsbugs.donarmstrong.com id=B3808.1247407498602 (code B ref 3808); Sun, 12 Jul 2009 14:10:06 +0000 Original-Received: (at 3808) by emacsbugs.donarmstrong.com; 12 Jul 2009 14:04:58 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mail.muc.de (qmailr@colin.muc.de [193.149.48.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6CE4qg3000595 for <3808@emacsbugs.donarmstrong.com>; Sun, 12 Jul 2009 07:04:54 -0700 Original-Received: (qmail 34798 invoked by uid 3782); 12 Jul 2009 14:04:49 -0000 Original-Received: from acm.muc.de (pD9E233A5.dip.t-dialin.net [217.226.51.165]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sun, 12 Jul 2009 16:04:43 +0200 Original-Received: (qmail 3987 invoked by uid 1000); 12 Jul 2009 14:06:38 -0000 Content-Disposition: inline In-Reply-To: <4A59BBDD.4080905@swipnet.se> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-MIME-Autoconverted: from 8bit to quoted-printable by rzlab.ucr.edu id n6CEHRpQ003539 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Sun, 12 Jul 2009 10:17:35 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:29352 gmane.emacs.pretest.bugs:24778 Archived-At: Hi, Jan! On Sun, Jul 12, 2009 at 12:33:01PM +0200, Jan Dj=E4rv 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 sur= e, > >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=20 > >>(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= =20 > that it doesn't work, it is just this situation (setting c-file-style a= s a=20 > file local variable has the same effect). 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 impossib= le to > >>set this variable. I also tried setting c-old-style-variable-behavio= r to=20 > >>t, > >>but it made no difference. > >>The manual needs to explain how to set variables in a manner that wor= ks, > >>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 i= n a > >style. The instructions on how to set "style variables" in general (o= f > >which c-cleanup-list is one) are on the page "Configuration Basics" an= d > >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=20 > .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 h= ook? 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. --=20 Alan Mackenzie (Nuremberg, Germany).