unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* comment-start redefined in cc-langs.el
@ 2006-04-29 14:41 martin rudalics
  2006-05-02  7:58 ` Alan Mackenzie
  2006-07-20 10:44 ` Alan Mackenzie
  0 siblings, 2 replies; 9+ messages in thread
From: martin rudalics @ 2006-04-29 14:41 UTC (permalink / raw)
  Cc: bug-cc-mode

With emacs -Q do

C-h v comment-start RET

gets me

comment-start is a variable defined in `newcomment.el'
...

Now load cc-mode in a new buffer, return to scratch, and do again

C-h v comment-start RET

gets me

comment-start is a variable defined in `cc-engine.el'
...

If I now click on `cc-engine.el' I am told

find-function-search-for-symbol: Cannot find definition of `comment-start' in library `cc-engine.el'

The same holds for `comment-end' and `comment-start-skip'.

Would it be possible to rename these to `c-comment-start',
`c-comment-end', and `c-comment-start-skip' in `cc-langs.el'?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: comment-start redefined in cc-langs.el
  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-07-20 10:44 ` Alan Mackenzie
  1 sibling, 1 reply; 9+ messages in thread
From: Alan Mackenzie @ 2006-05-02  7:58 UTC (permalink / raw)
  Cc: bug-cc-mode, emacs-devel

Hi, Martin!

On Sat, 29 Apr 2006, martin rudalics wrote:

[ .... ]

>Now load cc-mode in a new buffer, return to scratch, and do again

>C-h v comment-start RET

>gets me

>comment-start is a variable defined in `cc-engine.el'
>...

Yes, me too.  This is indeed not funny (Ha ha ha ha!)  I'm not sure why
it reports cc-engine.el, but better just to fix it.

>If I now click on `cc-engine.el' I am told

>find-function-search-for-symbol: Cannot find definition of
>`comment-start' in library `cc-engine.el'

The definition is actually in cc-langs.el, ~L1106:

    (c-lang-defvar comment-start (c-lang-const comment-start)
      'dont-doc)

What seems needed is a new macro c-lang-SETvar, a sister to
c-lang-defvar.  I'll write this.

>The same holds for `comment-end' and `comment-start-skip'.

Yes, indeed.  A quick grep for "(c-lang-defvar " reveals that these are
the only non-CC Mode variables redefined in this way.

>Would it be possible to rename these to `c-comment-start',
>`c-comment-end', and `c-comment-start-skip' in `cc-langs.el'?

No, that's not the right thing.  The idea is to give the standard Emacs
variables the appropriate CC Mode settings (different for each CC mode).

Thanks for the bug report.

-- 
Alan Mackenzie (Munich, Germany)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: comment-start redefined in cc-langs.el
  2006-05-02  7:58 ` Alan Mackenzie
@ 2006-05-02 12:57   ` martin rudalics
  2006-05-02 15:55     ` Alan Mackenzie
  0 siblings, 1 reply; 9+ messages in thread
From: martin rudalics @ 2006-05-02 12:57 UTC (permalink / raw)
  Cc: emacs-devel, bug-cc-mode

Hi, Alan!

 > I'm not sure why it reports cc-engine.el, ...

... because symbol-file finds cc-engine.elc first in load-history, I
presume.

 > A quick grep for "(c-lang-defvar " reveals that these are
 > the only non-CC Mode variables redefined in this way.

While you're here: What about C-h v for non-non-CC Mode variables
defined this way?  And maybe

(put 'c-lang-defconst 'doc-string-elt 2)

and eventually

(put 'c-lang-defvar 'doc-string-elt 3)

for ease of reading cc-langs.el?

Sincerely, martin.




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: comment-start redefined in cc-langs.el
  2006-05-02 12:57   ` martin rudalics
@ 2006-05-02 15:55     ` Alan Mackenzie
  0 siblings, 0 replies; 9+ messages in thread
From: Alan Mackenzie @ 2006-05-02 15:55 UTC (permalink / raw)
  Cc: bug-cc-mode, emacs-devel

Hi, Martin!

On Tue, 2 May 2006, martin rudalics wrote:

>Hi, Alan!

> > I'm not sure why it reports cc-engine.el, ...

>... because symbol-file finds cc-engine.elc first in load-history, I
>presume.

I'm sure now!  Near the start of cc-engine.el, there's a macro
c-declare-lang-variables, which generates a defvar for each symbol stored
inside c-lang-variable-inits.  3 of these symbols are comment-start and
friends.

> > A quick grep for "(c-lang-defvar " reveals that these are
> > the only non-CC Mode variables redefined in this way.

>While you're here: What about C-h v for non-non-CC Mode variables
>defined this way?

Some of them (more precisely, those intended to be available to derived
modes) have doc-strings.  Others are specifically marked as _not_ having
doc strings.  This has been a little contentious on emacs-devel recently,
but if it is to change, it should be done over the whole code atomically.

>.. And maybe

>(put 'c-lang-defconst 'doc-string-elt 2)

What's doc-string-elt?  (OK, I can guess, but I can't find it in the
Elisp manual).

>and eventually

>(put 'c-lang-defvar 'doc-string-elt 3)

>for ease of reading cc-langs.el?

I'm in the middle of documenting the entire language variable mechanism.
This thing is a tremendous achievement and saves hours of work, but it is
somewhat sparsely commented, and hence difficult to debug.  Give me a few
days!

>Sincerely, martin.

-- 
Alan (Munich, Germany).

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: comment-start redefined in cc-langs.el
  2006-04-29 14:41 comment-start redefined in cc-langs.el martin rudalics
  2006-05-02  7:58 ` Alan Mackenzie
@ 2006-07-20 10:44 ` Alan Mackenzie
  2006-07-21 16:05   ` martin rudalics
  1 sibling, 1 reply; 9+ messages in thread
From: Alan Mackenzie @ 2006-07-20 10:44 UTC (permalink / raw)
  Cc: bug-cc-mode, emacs-devel

Good Morning, Martin!

On Sat, Apr 29, 2006 at 04:41:55PM +0200, martin rudalics wrote:
> With emacs -Q do

> C-h v comment-start RET

> gets me

> comment-start is a variable defined in `newcomment.el'
> ...

> Now load cc-mode in a new buffer, return to scratch, and do again

> C-h v comment-start RET

> gets me

> comment-start is a variable defined in `cc-engine.el'
> ...

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.


2006-07-20  Alan Mackenzie  <acm@muc.de>

	* progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
	(c-lang-setvar): new macro.
	(c-make-init-lang-vars-fun): Use the initialization forms in
	c-emacs-variable-inits in addition to those in c-lang-variable-inits.
	(comment-start, comment-end, comment-start-skip): Change these from
	c-lang-defvar's to c-lang-setvar's.

	* progmodes/cc-mode.el (c-make-emacs-variables-local): new macro,
	which calls make-local-variable on the elements of
	c-emacs-variable-inits.
	(c-init-language-vars-for): Call this new macro.


Index: cc-langs.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/cc-langs.el,v
retrieving revision 1.39
diff -c -r1.39 cc-langs.el
*** cc-langs.el	10 Jul 2006 13:17:09 -0000	1.39
--- cc-langs.el	20 Jul 2006 09:18:43 -0000
***************
*** 134,145 ****
  
  (eval-and-compile
    ;; These are used to collect the init forms from the subsequent
!   ;; `c-lang-defvar'.  They are used to build the lambda in
!   ;; `c-make-init-lang-vars-fun' below.
    (defvar c-lang-variable-inits nil)
    (defvar c-lang-variable-inits-tail nil)
    (setq c-lang-variable-inits (list nil)
! 	c-lang-variable-inits-tail c-lang-variable-inits))
  
  (defmacro c-lang-defvar (var val &optional doc)
    "Declares the buffer local variable VAR to get the value VAL.  VAL is
--- 134,151 ----
  
  (eval-and-compile
    ;; These are used to collect the init forms from the subsequent
!   ;; `c-lang-defvar' and `c-lang-setvar'.  They are used to build the
!   ;;  lambda in `c-make-init-lang-vars-fun' below, and to build `defvar's
!   ;;  and `make-variable-buffer-local's in cc-engine and
!   ;;  `make-local-variable's in `c-init-language-vars-for'.
    (defvar c-lang-variable-inits nil)
    (defvar c-lang-variable-inits-tail nil)
    (setq c-lang-variable-inits (list nil)
! 	c-lang-variable-inits-tail c-lang-variable-inits)
!   (defvar c-emacs-variable-inits nil)
!   (defvar c-emacs-variable-inits-tail nil)
!   (setq c-emacs-variable-inits (list nil)
! 	c-emacs-variable-inits-tail c-emacs-variable-inits))
  
  (defmacro c-lang-defvar (var val &optional doc)
    "Declares the buffer local variable VAR to get the value VAL.  VAL is
***************
*** 172,177 ****
--- 178,202 ----
    ;; Return the symbol, like the other def* forms.
    `',var)
  
+ (defmacro c-lang-setvar (var val)
+   "Causes the variable VAR to be made buffer local and to get set to the
+ value VAL.  VAL is evaluated and assigned at mode initialization.  More
+ precisely, VAL is evaluated and bound to VAR when the result from the
+ macro `c-init-language-vars' is evaluated.  VAR is typically a standard
+ Emacs variable like `comment-start'.
+ 
+ `c-lang-const' is typically used in VAL to get the right value for the
+ language being initialized, and such calls will be macro expanded to
+ the evaluated constant value at compile time."
+   (let ((elem (assq var (cdr c-emacs-variable-inits))))
+     (if elem
+ 	(setcdr elem (list val)) ; Maybe remove "list", sometime. 2006-07-19
+       (setcdr c-emacs-variable-inits-tail (list (list var val)))
+       (setq c-emacs-variable-inits-tail (cdr c-emacs-variable-inits-tail))))
+ 
+   ;; Return the symbol, like the other def* forms.
+   `',var)
+ 
  (put 'c-lang-defvar 'lisp-indent-function 'defun)
  ; (eval-after-load "edebug" ; 2006-07-09: def-edebug-spec is now in subr.el.
  ;  '
***************
*** 1103,1110 ****
    ;; In C we still default to the block comment style since line
    ;; comments aren't entirely portable.
    c "/* ")
! (c-lang-defvar comment-start (c-lang-const comment-start)
!   'dont-doc)
  
  (c-lang-defconst comment-end
    "String that ends comments inserted with M-; etc.
--- 1128,1134 ----
    ;; In C we still default to the block comment style since line
    ;; comments aren't entirely portable.
    c "/* ")
! (c-lang-setvar comment-start (c-lang-const comment-start))
  
  (c-lang-defconst comment-end
    "String that ends comments inserted with M-; etc.
***************
*** 1117,1124 ****
  		      (c-lang-const comment-start))
  	(concat " " (c-lang-const c-block-comment-ender))
        ""))
! (c-lang-defvar comment-end (c-lang-const comment-end)
!   'dont-doc)
  
  (c-lang-defconst comment-start-skip
    "Regexp to match the start of a comment plus everything up to its body.
--- 1141,1147 ----
  		      (c-lang-const comment-start))
  	(concat " " (c-lang-const c-block-comment-ender))
        ""))
! (c-lang-setvar comment-end (c-lang-const comment-end))
  
  (c-lang-defconst comment-start-skip
    "Regexp to match the start of a comment plus everything up to its body.
***************
*** 1134,1141 ****
  			   (c-lang-const c-block-comment-starter)))
  	     "\\|")
  	    "\\)\\s *"))
! (c-lang-defvar comment-start-skip (c-lang-const comment-start-skip)
!   'dont-doc)
  
  (c-lang-defconst c-syntactic-ws-start
    ;; Regexp matching any sequence that can start syntactic whitespace.
--- 1157,1163 ----
  			   (c-lang-const c-block-comment-starter)))
  	     "\\|")
  	    "\\)\\s *"))
! (c-lang-setvar comment-start-skip (c-lang-const comment-start-skip))
  
  (c-lang-defconst c-syntactic-ws-start
    ;; Regexp matching any sequence that can start syntactic whitespace.
***************
*** 2806,2814 ****
  ;;; Wrap up the `c-lang-defvar' system.
  
  ;; Compile in the list of language variables that has been collected
! ;; with the `c-lang-defvar' macro.  Note that the first element is
! ;; nil.
  (defconst c-lang-variable-inits (cc-eval-when-compile c-lang-variable-inits))
  
  (defun c-make-init-lang-vars-fun (mode)
    "Create a function that initializes all the language dependent variables
--- 2828,2837 ----
  ;;; Wrap up the `c-lang-defvar' system.
  
  ;; Compile in the list of language variables that has been collected
! ;; with the `c-lang-defvar' and `c-lang-setvar' macros.  Note that the
! ;; first element of each is nil.
  (defconst c-lang-variable-inits (cc-eval-when-compile c-lang-variable-inits))
+ (defconst c-emacs-variable-inits (cc-eval-when-compile c-emacs-variable-inits))
  
  (defun c-make-init-lang-vars-fun (mode)
    "Create a function that initializes all the language dependent variables
***************
*** 2841,2852 ****
  			     ;; `c-lang-const' will expand to the evaluated
  			     ;; constant immediately in `cl-macroexpand-all'
  			     ;; below.
! 			     (mapcan
! 			      (lambda (init)
! 				`(current-var ',(car init)
! 				  ,(car init) ,(cl-macroexpand-all
! 						(elt init 1))))
! 			      (cdr c-lang-variable-inits))))
  
  		 ;; This diagnostic message isn't useful for end
  		 ;; users, so it's disabled.
--- 2864,2879 ----
  			     ;; `c-lang-const' will expand to the evaluated
  			     ;; constant immediately in `cl-macroexpand-all'
  			     ;; below.
! 			      (mapcan
! 			       (lambda (init)
! 				 `(current-var ',(car init)
! 				   ,(car init) ,(cl-macroexpand-all
! 						 (elt init 1))))
! 			       ;; Note: The following `append' copies the
! 			       ;; first argument.  That list is small, so
! 			       ;; this doesn't matter too much.
! 			      (append (cdr c-emacs-variable-inits)
! 				      (cdr c-lang-variable-inits)))))
  
  		 ;; This diagnostic message isn't useful for end
  		 ;; users, so it's disabled.
***************
*** 2859,2865 ****
  
  		 (require 'cc-langs)
  		 (setq source-eval t)
! 		 (let ((init (cdr c-lang-variable-inits)))
  		   (while init
  		     (setq current-var (caar init))
  		     (set (caar init) (eval (cadar init)))
--- 2886,2893 ----
  
  		 (require 'cc-langs)
  		 (setq source-eval t)
! 		 (let ((init (append (cdr c-emacs-variable-inits)
! 				     (cdr c-lang-variable-inits))))
  		   (while init
  		     (setq current-var (caar init))
  		     (set (caar init) (eval (cadar init)))
***************
*** 2867,2873 ****
  
  	     (error
  	      (if current-var
! 		  (message "Eval error in the `c-lang-defvar' for `%s'%s: %S"
  			   current-var
  			   (if source-eval
  			       (format "\
--- 2895,2901 ----
  
  	     (error
  	      (if current-var
! 		  (message "Eval error in the `c-lang-defvar' or `c-lang-setvar' for `%s'%s: %S"
  			   current-var
  			   (if source-eval
  			       (format "\
***************
*** 2883,2889 ****
      `(lambda ()
         (require 'cc-langs)
         (let ((c-buffer-is-cc-mode ',mode)
! 	     (init (cdr c-lang-variable-inits))
  	     current-var)
  	 (condition-case err
  
--- 2911,2918 ----
      `(lambda ()
         (require 'cc-langs)
         (let ((c-buffer-is-cc-mode ',mode)
! 	     (init (append (cdr c-emacs-variable-inits)
! 			   (cdr c-lang-variable-inits)))
  	     current-var)
  	 (condition-case err
  
***************
*** 2895,2901 ****
  	   (error
  	    (if current-var
  		(message
! 		 "Eval error in the `c-lang-defvar' for `%s' (source eval): %S"
  		 current-var err)
  	      (signal (car err) (cdr err)))))))
      ))
--- 2924,2930 ----
  	   (error
  	    (if current-var
  		(message
! 		 "Eval error in the `c-lang-defvar' or `c-lang-setver' for `%s' (source eval): %S"
  		 current-var err)
  	      (signal (car err) (cdr err)))))))
      ))
Index: cc-mode.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/cc-mode.el,v
retrieving revision 1.48
diff -c -r1.48 cc-mode.el
*** cc-mode.el	10 Jul 2006 13:17:09 -0000	1.48
--- cc-mode.el	20 Jul 2006 09:18:47 -0000
***************
*** 153,164 ****
--- 153,173 ----
  (defun c-leave-cc-mode-mode ()
    (setq c-buffer-is-cc-mode nil))
  
+ ;; Make the `c-lang-setvar' variables buffer local in the current buffer.
+ ;; These are typically standard emacs variables such as `comment-start'.
+ (defmacro c-make-emacs-variables-local ()
+   `(progn
+      ,@(mapcan (lambda (init)
+ 		 `((make-local-variable ',(car init))))
+ 	       (cdr c-emacs-variable-inits))))
+ 
  (defun c-init-language-vars-for (mode)
    "Initialize the language variables for one of the language modes
  directly supported by CC Mode.  This can be used instead of the
  `c-init-language-vars' macro if the language you want to use is one of
  those, rather than a derived language defined through the language
  variable system (see \"cc-langs.el\")."
+   (c-make-emacs-variables-local)
    (cond ((eq mode 'c-mode)    (c-init-language-vars c-mode))
  	((eq mode 'c++-mode)  (c-init-language-vars c++-mode))
  	((eq mode 'objc-mode) (c-init-language-vars objc-mode))



-- 
Alan.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: comment-start redefined in cc-langs.el
  2006-07-20 10:44 ` Alan Mackenzie
@ 2006-07-21 16:05   ` martin rudalics
  2006-07-21 22:52     ` Alan Mackenzie
  0 siblings, 1 reply; 9+ messages in thread
From: martin rudalics @ 2006-07-21 16:05 UTC (permalink / raw)
  Cc: bug-cc-mode, emacs-devel

> Good Morning, Martin!
> 
> On Sat, Apr 29, 2006 at 04:41:55PM +0200, martin rudalics wrote:
> 
>>With emacs -Q do
> 
> 
>>C-h v comment-start RET
> 
> 
>>gets me
> 
> 
>>comment-start is a variable defined in `newcomment.el'
>>...
> 
> 
>>Now load cc-mode in a new buffer, return to scratch, and do again
> 
> 
>>C-h v comment-start RET
> 
> 
>>gets me
> 
> 
>>comment-start is a variable defined in `cc-engine.el'
>>...
> 
> 
> 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?

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 ... ?

martin



-------------------------------------------------------------------------
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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: comment-start redefined in cc-langs.el
  2006-07-21 22:52     ` Alan Mackenzie
@ 2006-07-21 22:13       ` martin rudalics
  2006-07-24  6:59       ` martin rudalics
  1 sibling, 0 replies; 9+ messages in thread
From: martin rudalics @ 2006-07-21 22:13 UTC (permalink / raw)
  Cc: bug-cc-mode, emacs-devel

'Evening to you, Alan!

> 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

For some reason clearing some of them old cc-*.elc files seems necessary.
It's probably been too hot today to think of that myself.

> Would you please try this again after recompiling cc-*.el.  Thanks!

Everything works as intended.  Thank you!

martin


-------------------------------------------------------------------------
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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: comment-start redefined in cc-langs.el
  2006-07-21 16:05   ` martin rudalics
@ 2006-07-21 22:52     ` Alan Mackenzie
  2006-07-21 22:13       ` martin rudalics
  2006-07-24  6:59       ` martin rudalics
  0 siblings, 2 replies; 9+ messages in thread
From: Alan Mackenzie @ 2006-07-21 22:52 UTC (permalink / raw)
  Cc: bug-cc-mode, emacs-devel

'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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: comment-start redefined in cc-langs.el
  2006-07-21 22:52     ` Alan Mackenzie
  2006-07-21 22:13       ` martin rudalics
@ 2006-07-24  6:59       ` martin rudalics
  1 sibling, 0 replies; 9+ messages in thread
From: martin rudalics @ 2006-07-24  6:59 UTC (permalink / raw)
  Cc: bug-cc-mode, emacs-devel

'Evening to you, Alan!

> 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

For some reason clearing some of them old cc-*.elc files seems necessary.
It's probably been too hot today to think of that myself.

> Would you please try this again after recompiling cc-*.el.  Thanks!

Everything works as intended.  Thank you!

martin




-------------------------------------------------------------------------
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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-07-24  6:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2006-07-21 22:13       ` martin rudalics
2006-07-24  6:59       ` martin rudalics

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).