From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.cc-mode.general,gmane.emacs.devel Subject: Re: comment-start redefined in cc-langs.el Date: Fri, 21 Jul 2006 23:52:12 +0100 Message-ID: <20060721225212.GA1347@muc.de> References: <44537B33.7080600@gmx.at> <20060720104433.GA1575@muc.de> <44C0FB62.8030602@gmx.at> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1153518687 16873 80.91.229.2 (21 Jul 2006 21:51:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 21 Jul 2006 21:51:27 +0000 (UTC) Cc: bug-cc-mode@gnu.org, emacs-devel Original-X-From: cc-mode-help-bounces@lists.sourceforge.net Fri Jul 21 23:51:23 2006 Return-path: Envelope-to: sf-cc-mode-help@m.gmane.org Original-Received: from lists-outbound.sourceforge.net ([66.35.250.225]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G42tz-0000p7-QY for sf-cc-mode-help@m.gmane.org; Fri, 21 Jul 2006 23:51:20 +0200 Original-Received: from sc8-sf-list1-new.sourceforge.net (unknown [10.3.1.93]) by sc8-sf-spam2.sourceforge.net (Postfix) with ESMTP id D5745F29C; Fri, 21 Jul 2006 14:51:18 -0700 (PDT) Original-Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.91] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1G42tx-0002l1-A7 for cc-mode-help@lists.sourceforge.net; Fri, 21 Jul 2006 14:51:17 -0700 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by mail.sourceforge.net with esmtps (TLSv1:RC4-SHA:128) (Exim 4.44) id 1G42tx-0007Aw-7b for cc-mode-help@lists.sourceforge.net; Fri, 21 Jul 2006 14:51:17 -0700 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.34) id 1G42tr-0005Vj-CF for bug-cc-mode@gnu.org; Fri, 21 Jul 2006 17:51:11 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.52) id 1G42uK-0007YX-I5 for bug-cc-mode@gnu.org; Fri, 21 Jul 2006 17:51:41 -0400 Original-Received: from [193.149.48.1] (helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1G42uK-0007YM-4l for bug-cc-mode@gnu.org; Fri, 21 Jul 2006 17:51:40 -0400 Original-Received: (qmail 3774 invoked from network); 21 Jul 2006 21:51:04 -0000 Original-Received: from acm.muc.de (HELO localhost.localdomain) (Debian-exim@193.149.49.134) by mail.muc.de with SMTP; 21 Jul 2006 21:51:04 -0000 Original-Received: from acm by localhost.localdomain with local (Exim 4.50) id 1G43qu-0000UI-Fb; Fri, 21 Jul 2006 23:52:12 +0100 Original-To: martin rudalics Content-Disposition: inline In-Reply-To: <44C0FB62.8030602@gmx.at> User-Agent: Mutt/1.5.9i X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on monty-python X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=failed version=3.0.4 X-Spam-Score: 1.0 (+) X-Spam-Report: Spam Filtering performed by sourceforge.net. See http://spamassassin.org/tag/ for more details. Report problems to http://sf.net/tracker/?func=add&group_id=1&atid=200001 1.0 FORGED_RCVD_HELO Received: contains a forged HELO X-BeenThere: cc-mode-help@lists.sourceforge.net X-Mailman-Version: 2.1.8 Precedence: list List-Id: "Bug reports, feature requests, and general talk about CC Mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: cc-mode-help-bounces@lists.sourceforge.net Errors-To: cc-mode-help-bounces@lists.sourceforge.net Xref: news.gmane.org gmane.emacs.cc-mode.general:3595 gmane.emacs.devel:57451 Archived-At: 'Evening, Martin! On Fri, Jul 21, 2006 at 06:05:54PM +0200, martin rudalics wrote: [ .... ] > >OK, here is a patch. > >Basically, the declarations like (c-lang-defvar comment-start ....) > >(in cc-langs.el ~L1131) were causing forms (defvar comment-start ...) > >to get generated in cc-engine.el (via the macro > >c-declare-lang-variables). > >I have added the macro c-lang-setvar which does all the fancy stuff > >that c-lang-defvar does, only without generating the defvar. > >Please let me know if there are any problems with this patch. > Good evening, Alan! > I'm afraid the patch doesn't change a thing in the behavior of my > Emacs. Would I have to do anything else but patch&recompile these two > files? Sorry! I should have given you a recipe here, since there's a rather intricate chain of macros involved. In particular, cc-engine.elc must be recompiled, since this contains the spurious (defvar comment-start). It is perhaps better to clear out the old cc-*.elc and recompile them all fresh: $ cd .../emacs/lisp/progmodes $ rm cc-*.elc $ emacs -batch -no-site-file -q -f batch-byte-compile cc-*.el > Anyway, if I look at `load-history', the definitions from cc-engine.elc > still precede textually those from newcomment.elc, doesn't that come > from (c-lang-defconst comment-start ... ? No, not directly. c-lang-defconst defines (or sets) a symbol in the obarray `c-lang-constants', and has no effect outside of that obarray. It is c-lang-defvar which (indirectly) (!used to) redefine `comment-start', thusly: (c-lang-defvar c-assignment-op-regexp) collects information from the aforementioned obarray `c-lang-constants', and dumps it into the list `c-lang-variable-inits'. This is later used: (i) in cc-engine.el, where macro `c-declare-lang-variables' generates (defvar c-assignment-op-regexp) (make-variable-buffer-local 'c-assignment-op-regexp) (ii) in macro `c-init-language-vars' (called from cc-mode.el), where an appropriate lisp form for one of the seven languages (C, C++, ...) is dumped into a setq. e.g., for C: (setq c-assignment-op-regexp "=\\([^=]\\|$\\)\\|\\(?:<<\\|>>\\|[%&*+/|^-]\\)=") One of my high priority TODOs is to document this mechanism more clearly in the source files (probably in cc-langs.el). Would you please try this again after recompiling cc-*.el. Thanks! > martin -- Alan. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV