all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
Cc: bug-cc-mode@gnu.org, emacs-devel <emacs-devel@gnu.org>
Subject: Re: comment-start redefined in cc-langs.el
Date: Fri, 21 Jul 2006 23:52:12 +0100	[thread overview]
Message-ID: <20060721225212.GA1347@muc.de> (raw)
In-Reply-To: <44C0FB62.8030602@gmx.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


  reply	other threads:[~2006-07-21 22:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-29 14:41 comment-start redefined in cc-langs.el martin rudalics
2006-05-02  7:58 ` Alan Mackenzie
2006-05-02 12:57   ` martin rudalics
2006-05-02 15:55     ` Alan Mackenzie
2006-07-20 10:44 ` Alan Mackenzie
2006-07-21 16:05   ` martin rudalics
2006-07-21 22:52     ` Alan Mackenzie [this message]
2006-07-21 22:13       ` martin rudalics
2006-07-24  6:59       ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060721225212.GA1347@muc.de \
    --to=acm@muc.de \
    --cc=bug-cc-mode@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.