Martin Stjernholm | 9 Apr 2005 20:01
Picon
Picon
Picon
Favicon

Re: CC Mode 5.30.9 (C++); Inconsistent syntax analysis of line with just ( -- normally topmost-intro-cont, but statement-cont when the function is named operator==

"Robert N. Mcdonnell" <RMcdonnell <at> beckcomputers.com> wrote:

> Given the following as the only text in a c++-mode buffer:
>
> bool operator==
>   (
> );
>
> \C-c\C-s on the second line produces ((statement-cont 1))
>
> If I change the function name, in particular to operator!=
>
> bool operator!=
> (
> );
>
> \C-c\C-s on the second line produces ((topmost-intro-cont 1))

Thanks for the report. The patch below fixes this case. However, other
operator declarations like operator<, operator<<, operator, and
operator() are still not treated correctly. That requires a larger fix
that I've only made in the development version.

diff -u -r5.419.2.33 cc-engine.el
--- cc-engine.el	7 Oct 2004 11:46:35 -0000	5.419.2.33
+++ cc-engine.el	9 Apr 2005 17:57:40 -0000
 <at>  <at>  -6103,7 +6103,9  <at>  <at> 
 		;; Note: We use the fact that lim is always after any
 		;; preceding brace sexp.
 		(while (and (zerop (c-backward-token-2 1 t lim))
(Continue reading)

Martin Stjernholm | 10 Apr 2005 13:17
Picon
Picon
Picon
Favicon

Re: cc-mode cvs c-lineup-argcont versus braces

Kevin Ryde <user42 <at> zip.com.au> wrote:

> 2005-02-14  Kevin Ryde  <user42 <at> zip.com.au>
>
>         * cc-align.el (c-lineup-argcont): Ignore conses for {} pairs from
>         c-parse-state, to avoid a lisp error (on bad code).

Got around to applying this at last, and your manual errata. Thanks.

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

Martin Stjernholm | 10 Apr 2005 14:17
Picon
Picon
Picon
Favicon

Re: CC Mode 5.30.9 (C++); Inconsistent syntax analysis of line with just ( -- normally topmost-intro-cont, but statement-cont when the function is named operator==

Martin Stjernholm <mast <at> lysator.liu.se> wrote:

> Thanks for the report. The patch below fixes this case. /.../

That patch was a bit hasty and broke some other cases. This one is
better.

diff -u -r5.419.2.33 cc-engine.el
--- cc-engine.el	7 Oct 2004 11:46:35 -0000	5.419.2.33
+++ cc-engine.el	10 Apr 2005 12:14:15 -0000
 <at>  <at>  -6103,7 +6103,12  <at>  <at> 
 		;; Note: We use the fact that lim is always after any
 		;; preceding brace sexp.
 		(while (and (zerop (c-backward-token-2 1 t lim))
-			    (not (looking-at "[;<,=]"))))
+			    (or (not (looking-at "[;<,=]"))
+				(and c-overloadable-operators-regexp
+				     (looking-at c-overloadable-operators-regexp)
+				     (save-excursion
+				       (zerop (c-backward-token-2 1 nil lim))
+				       (looking-at "operator\\>[^_]"))))))
 		(or (memq (char-after) '(?, ?=))
 		    (and (c-major-mode-is 'c++-mode)
 			 (zerop (c-backward-token-2 1 nil lim))

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
(Continue reading)

Martin Stjernholm | 11 Apr 2005 01:14
Picon
Picon
Picon
Favicon

Re: CC Mode 5.31 (C++); set-keymap-parents bug on Gnu Emacs

David Abrahams <dave <at> boost-consulting.com> wrote:

>> Afaics, that is only a problem if the function is actually run during
>> the compilation, i.e. it's called directly or indirectly from a macro.
>> I don't see how that could happen here.
>>
>> Have you encountered a situation that exhibits this? 
>
> Yes.
>
>> If so, could you describe it?
>
> No, I'm afraid not.  It's been so long I've forgotten the details.

I've encountered this situation myself now. It's when you evaluate
cc-mode.el with M-x eval-buffer. Fixed.

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

Martin Stjernholm | 10 Apr 2005 15:21
Picon
Picon
Picon
Favicon

Re: two questions/feature requests

Alan Mackenzie <acm <at> muc.de> wrote:

> If
> (i) the line is in a C-style comment; and
> (ii) "*/" is a comment ender in the current language; and
> (iii) the line consists of exactly the comment prefix followed
> optionally by whitespace; and
> (iv) the last non-ws character on the line is a `*' when the `/' is
> typed;
> then
>
> the space between the `*' and `/' should be removed, giving the comment
> end "*/".

Note that this cleanup would be ambiguous; it's not all that unlikely
that someone is writing a comment and wants to have "/" at the start
of a line inside it. The existing cleanups aren't ambiguous in that
regard since they only change the format of the code, not the
meaning(*).

Anyway, there's no requirement that a cleanup must be unambiguous to
exist, it's just that its usefulness becomes more limited (I for
instance wouldn't like it). So sure, go ahead and add it. It shouldn't
be enabled by default, though.

> Additionally, if auto-newline is enabled, a newline should be
> inserted after the "*/".

Only if enabled by a customization setting, like all the other auto
newlines. There's already c-hanging-braces-alist,
(Continue reading)

jaortega | 13 Apr 2005 01:10
Picon

CC Mode 5.30.9 (ObjC); Misalignment of method declaration


Hi. As I commented to Alan in a previous e-mail, CC mode is not
indenting some method declarations properly. Just create a .h file and
set it to objc-mode, and insert this code:

     <at> interface Foo
    {
    }

    
    // + (void) foo:(int) astring
    //        range:(NSRange) range;

    + (void) foobar:(int) text
              range:(NSRange) range;

     <at> end

Note how foobar: and range: are correctly aligned. Now, uncoment
foo:range:, go to the range: below foobar: and press TAB. This is what
you get:

+ (void) foobar:(int) text
       range:(NSRange) range;

I've tried various combinations, but haven't been able to find a
pattern. This kind of mis-alignment happens now and then in my code.

Thanks for your time,
jao
(Continue reading)

Dirk Farin | 16 Apr 2005 19:34
Picon
Picon
Favicon

Re: emacs hangs in c++ font-lock-mode


First the good news: the problem does not appear anymore in the current
Emacs CVS version 22.0.50 (with cc-mode 5.30.9).

>>I have got a C++ source file that causes "GNU Emacs 21.4.1" (current Debian
>>testing) to hang with 100% cpu. To reproduce the bug, load the attached
>>source file and turn font-lock-mode on in C++ mode. If you move the cursor
>>down, at some position, emacs will hang and accept no more keyboard inputs.
> 
> I know that everything will still be set up to their defaults, but could
> you perhaps give us some more details just the same:
> 
> How powerful is your computer?  (Processor speed in MHz or GHz).

2.6 GHz, x86, but I tested on a variety of different systems with the
same result.

> What version of CC Mode have you got?  (M-x c-version)

"Using CC Mode version 5.28"

> Did you start your session with "emacs -q --no-site-file"?  (I.e. without
> your .emacs and any site-lisp.el loaded.)  If not, do you still get the
> problem when you do?

Does not change anything.

> Does Emacs _always_ hang up, _usually_ hang up or _sometimes_ hang up?

always
(Continue reading)

Alan Mackenzie | 20 Apr 2005 23:24
Picon
Favicon

Re: two questions/feature requests

Hi, Frank!

On Thu, 24 Mar 2005, Frank Thieme wrote:

>On Mi 23 Mär 2005 22:24, Alan Mackenzie <acm <at> muc.de> writes:

[ .... ]

[Concerning your request for a new feature in Emacs's CC Mode, where
typing a `/' on a bare line in a C-style comment (i.e. it has only a
"comment prefix") should terminate the comment.]

>> Frank, what version of CC Mode have you got?  (Type "M-x c-version",
>> where "M-x" usually means "Alt-x" on most keyboards).  This will probably
>> be 5.28, but might be 5.30.n.  I am assuming here that you'll be willing
>> to upgrade to 5.30.9 (the current version) if necessary:  I can offer you
>> help by email if you need it.

>5.30.9 - I'm using GNU Emacs cvs version...

Brilliant!

OK, I've implemented this change, and have attached two patch files
cc-vars.el.diff and cc-cmds.el.diff so that you can test out the idea.
[Note that the change won't ever be part of 5.30.n, though.] 

[Aside for Martin: I've implemented this in the CC Mode CVS trunk, too,
but haven't commited it yet.]

#########################################################################
(Continue reading)

dgay | 27 Apr 2005 01:34
Picon
Favicon

CC Mode 5.30.9 (C); repeated warnings when using '=' inside enums


If I turn on font-lock-mode, and edit the following enum in C mode:

enum {
  IDLE,
  b = 
  SEND,
};

by typing, e.g., a space after the '=', I get the following warning:
  (1) (warning/warning) Error caught in `font-lock-pre-idle-hook':
(error Invalid search limit (wrong side of point))

This problem appeared in 5.30.9 (and a quick glance at the CVS head
suggests it's still there), and the following diff to 
c-lock-font-declarators in cc-fonts.el appears to be a fix:

--- orig9/cc-fonts.el   2005-04-26 14:59:37.478871000 -0700
+++ cc-mode-5.30.9/cc-fonts.el  2005-04-26 16:22:26.670783321 -0700
 <at>  <at>  -867,9 +867,14  <at>  <at> 
               ;; with array initializers.  Otherwise stop at braces
               ;; to avoid going past full function and class blocks.
               (and (if (and (eq got-init ?=)
-                            (= (c-forward-token-2) 0)
+                            (= (c-forward-token-2 nil nil limit) 0)
                             (looking-at "{"))
-                       (c-safe (c-forward-sexp) t)
+                       (c-safe
+                        (let ((p (point)))
+                          (c-forward-sexp)
(Continue reading)

Marlin, Thomas J | 28 Apr 2005 23:47
Picon
Favicon

byte compile errors on version 5.30.9


Hi: I'm a novice with (X)emacs and lisp. 

I've downloaded cc-mode, version 5.30.9 from source forge.net and I'm
trying to byte compile it.  I'm running into errors. I really need help.

enviroment:
Solaris 9
XEmacs 20.0
cc-mode 5.30.9 (a previous version, 4.315, is installed)

I'm compiling each individual file using a batch byte compile:

  xemacs -batch -no-site-file -q -f batch-byte-compile <file name>

only one file compiles without error, cc-bytecomp.el

all the other files, except cc-fix, product the following:
"While compiling Toplevel forms in file <file name>
  !! Symbol's function def is void ((eval-after-load)) "

cc-fix produces 
"While compiling the end of the data in file cc-fix.el
  ** the function eval-after-load is not known to be defined"

cc-fix.elc was written to disk.

any help you could provide will be greatly appreciated.

thanks
(Continue reading)


Gmane