From: Michael S. <ml...@ko...> - 2001-08-13 07:20:51
|
>>>>> "Martin" == Martin Stjernholm <ma...@ly...> writes: Martin> Michael Schmitz <ml...@ko...> wrote: >> I did changed the regular expression in c-comment-prefix-regexp to >> >> "/\\(/\\(/\\|!\\)*\\)\\|\\**" >> >> which perfectly matches the entire comment prefix for standard c++ as >> well as doxygen-style c++-comments. >> >> Fillin the comment >> >> //! foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar >> >> results in >> >> //! foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar >> //foo bar Martin> I tried with this regexp and it works well for me. Perhaps Martin> you didn't reinitialize the mode? As the variable doc Martin> says, a change in c-comment-prefix-regexp doesn't take Martin> effect immediately; a reinitialization is necessary. Also, Martin> since c-comment-prefix-regexp often is buffer local, that Martin> implies that a change of it with setq or M-x set-variable Martin> is discarded; using setq-default is necessary when it's Martin> changed from within a CC Mode buffer. To verify whether I just forgot to reinitialize the mode, I just restarted my XEmacs and retried filling my test comment. The result is the same, it doesn't look like it should. My cc-mode initialization file is attached to this email, maybe this help identifying the problem (although I don't believe as the problem is there with a (setq c-comment-prefix-regexp ...) only as well). Martin> Btw, the regexp can be abbreviated to: Martin> "//[/!]*\\|\\**" I tried this as well, but it gives me a mysterious 'Invalid regexp: "Invalid preceding regular expression"'. Michael. |