Niels Skou Olsen | 2 Jul 2003 06:57
Picon

CC Mode 5.30 - problem fontifying pointer initialization

Hi,

Just installed 5.30 and byte compiled it.

I start emacs -q and load 5.30. When I enter this in a new .cpp file

  bar* x = 0;

bar is not colored green as expected. If I remove the * then it is. If I
don't initialize the pointer then it is.

I'm running emacs 21.3.1 on Windows 2000 SP3.

Best regards,

Niels
--

-- 
Niels Skou Olsen, M.Sc.
Intelligent Engine, R&D
MAN B&W Diesel A/S

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01

Norbert Koch | 2 Jul 2003 16:37
X-Face
Picon
Favicon

Re: [ANNOUNCE] Updated Packages in Pre-Release 20030702

Jake Colman <colman <at> ppllc.com> writes:

Hi Jake!

> What about cc-mode v5.30?  I don't think that this is the version currently
> in the official XEmacs package distribution.  Will it be included in the next
> upcoming distribution?  And when might that be released?

I have no pending commits wrt cc-mode.  Martin?

norbert.

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01

Martin Stjernholm | 2 Jul 2003 23:57
Picon
Picon
Picon
Favicon

Re: CC Mode 5.30 (C++); imenu bug

Patrick Hinchy <pnhinchy <at> raytheon.com> wrote:

> The signature of the cc-imenu-init function was changed, but the corresponding
> calls were not set (except for objc-mode).  For c++-mode, this results in
> imenu-create-index-function being set to nil, which breaks imenu for all C++ files.

Seems I was a bit sloppy. Fixed now. Thank you.

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01

Martin Stjernholm | 3 Jul 2003 00:24
Picon
Picon
Picon
Favicon

Re: CC Mode 5.30 - problem fontifying pointer initialization

Niels Skou Olsen <nso <at> manbw.dk> wrote:

> I start emacs -q and load 5.30. When I enter this in a new .cpp file
>
>   bar* x = 0;
>
> bar is not colored green as expected. If I remove the * then it is. If I
> don't initialize the pointer then it is.

The following patch should fix this. Thanks for the report.

--- cc-fonts.el	2 Jul 2003 21:44:16 -0000
+++ cc-fonts.el	2 Jul 2003 22:20:56 -0000
 <at>  <at>  -1500,7 +1500,7  <at>  <at> 
 		    (progn
 		      (when (and got-prefix-before-parens
 				 at-type
-				 at-decl-end
+				 (or at-decl-end (looking-at "=[^=]"))
 				 (not arglist-type)
 				 (not got-suffix))
 			;; Got something like "foo * bar;".  Since we're not
 <at>  <at>  -1512,9 +1512,7  <at>  <at> 
 			(throw 'at-decl-or-cast t))

 		      (when (and (or got-suffix-after-parens
-				     ;; Due to test above this is equivalent
-				     ;; to (looking-at "=[^=]").
-				     (not at-decl-end))
+				     (looking-at "=[^=]"))
(Continue reading)

Niels Skou Olsen | 3 Jul 2003 08:29
Picon

Re: CC Mode 5.30 - problem fontifying pointer initialization

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

> Niels Skou Olsen <nso <at> manbw.dk> wrote:
> > bar is not colored green as expected. If I remove the * then it is. If I
> > don't initialize the pointer then it is.
> 
> The following patch should fix this. Thanks for the report.

It does. Thanks for the fix.

Best regards,

Niels
--

-- 
Niels Skou Olsen, M.Sc.
Intelligent Engine, R&D
MAN B&W Diesel A/S

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01

Niels Skou Olsen | 3 Jul 2003 10:46
Picon

CC Mode 5.30 - problem fontifying C++ enum

Hi,

Running 5.30 with patch to "pointer initialization" problem reported
yesterday.

There seems to be some weird behaviour when fontifying enums.

Start emacs -q and evaluate this in *scratch*:

  (setq load-path (cons (expand-file-name "/path/to/cc-mode-5.30") load-path))
  (global-font-lock-mode t)

Then paste these enums into a new .cpp file

-------- begin paste
enum {
   X_00,
   X_01,
   X_02,
   X_03,
   X_04,
   X_05,
   X_06,
   X_07,
   X_08,
   X_09,
   X_10,
   X_11,
   X_12,
   X_13,
(Continue reading)

Martin Stjernholm | 3 Jul 2003 14:11
Picon
Picon
Picon
Favicon

Re: CC Mode 5.30 - problem fontifying C++ enum

Niels Skou Olsen <nso <at> manbw.dk> wrote:

> In the enums only some items are orange, the rest are black. If you repeat
> the excercise several times you will see that the number of items colored
> orange vary. Oftentimes the number of orange items vary a couple of seconds
> after pasting.

That's due to the Just-in-time Lock mode. It breaks up the buffer in
sections which are fontified in separate runs. If such a section
starts inside an enum, the font lock code will only see something like

     XXXXXXXXXX_14,
     XXXXXXXXXX_15,
     XXXXXXXXXX_16,
     XXXXXXXXXX_17,
     XXXXXXXXXX_18,
     XXXXXXXXXX_19
  };

which it doesn't recognize as an enum.

I've now added some more use of text properties to cope with this.
Thanks for the report.

--- cc-fonts.el	19 Jun 2003 00:35:29 -0000
+++ cc-fonts.el	3 Jul 2003 12:09:24 -0000
 <at>  <at>  -665,6 +665,16  <at>  <at> 
   ;; and it's near the point most of the time.
   (c-parse-state)

(Continue reading)

Martin Stjernholm | 3 Jul 2003 14:56
Picon
Picon
Picon
Favicon

Re: CC Mode 5.30

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

> Needless to say, there'll be some things to clear up when this is
> committed in the Emacs cvs. /.../

Done, but I haven't yet cleaned up the old font lock patterns in
font-lock.el or the old AWK mode. Please add bug-cc-mode <at> gnu.org to
the recipient list for problems concerning C, C++, Objective-C, Java,
IDL, Pike and AWK modes.

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01

Martin Stjernholm | 3 Jul 2003 16:39
Picon
Picon
Picon
Favicon

Re: [ANNOUNCE] Updated Packages in Pre-Release 20030702

Norbert Koch <viteno <at> xemacs.org> wrote:

>> What about cc-mode v5.30?  I don't think that this is the version currently
>> in the official XEmacs package distribution.  Will it be included in the next
>> upcoming distribution?  And when might that be released?
>
> I have no pending commits wrt cc-mode.  Martin?

It's updated now. I hope I haven't done anything wrong; I'm new to
XEmacs package maintenance and I couldn't find much doc about it.

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01

Martin Stjernholm | 3 Jul 2003 17:20
Picon
Picon
Picon
Favicon

Re: CC-mode conflict with lucid.el

Masayuki Ataka <ataka <at> milk.freemail.ne.jp> wrote:

> cc-engine.el and lucid.el conflicts.
> 
> [TRIGER]
> (0) $ emacs -q
> (1) (require 'lucid) at first.
> (2) Open C file and write struct out of function.
> --- test.c ---
> struct a {
> -!-
> --------------
> (3) Hit TAB for indentation at the place of -!-.
> (4) ERORR: Args out of range
> 
> 
> [BACKTRACE]
> Debugger entered--Lisp error: (args-out-of-range 1 12)
>   parse-partial-sexp(1 12 nil nil (0 nil nil nil nil nil 0 nil nil nil))
>   syntax-ppss(12)
>   buffer-syntactic-context()
>   c-in-literal(12)
>   c-guess-basic-syntax()
>   c-indent-line()
>   #[nil "Â>ƒ)C ��x� � )iÆ Xƒ\"Ç	!‚'G	!))‡ ‡"
[indent-line-function column (indent-relative indent-relative-maybe) beginning-of-line "\n 	"
nil current-indentation indent-line-to] 2 680988 nil]()
>   c-indent-command(1)
>   call-interactively(c-indent-command)
> 
(Continue reading)


Gmane