unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* c-macro-expand isn't part of CC Mode  [Was: cpp use in cc-mode is broken]
       [not found] <d69e7f6a05042907184bd4842d@mail.gmail.com>
@ 2005-05-03 21:00 ` Alan Mackenzie
  2005-05-03 22:05   ` Nick Roberts
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Alan Mackenzie @ 2005-05-03 21:00 UTC (permalink / raw)
  Cc: bug-cc-mode, emacs-devel, emacs-pretest-bug

Hi Tim, Hi Nick, Hi Emacs, Hi Martin!

On Fri, 29 Apr 2005, Tim Van Holder wrote:

>As of a few days ago, the cc-mode in cvs emacs seems to preprocess the
>source file in order to determine the C macros present.

Please Note: `c-macro-expand', despite its name, is _NOT_ part of CC
Mode.  Its name prefix "c-" is misleading here.  That, and the fact that
it has a binding in some of the CC Mode keymaps, is its only connection
with CC Mode.  (If you look carefully, you'll find it's not in the CC
Mode manual.  ;-)

`c-macro-expand' actually lives in the file
.../list/progmodes/cmacexp.el.  This file was last updated 3 years 8
months ago by Eli.

There seem to have been a lot of patches to cc-mode.el and friends for
c-macro-expand in the last week.  Would somebody please take all these
changes out of the CC Mode files and put them into cmacexp.el instead.
Otherwise, there's going to be confusion and significant lack of
happiness when the time comes to merge the upcoming version of CC Mode
(5.31) into savannah.

Thanks in Advance!

[ .... ]

>The patches below resolve the immediate problem, just not optimally.

I couldn't have put it better myself.  ;-)

>Index: cc-vars.el
>===================================================================
>RCS file: /cvsroot/emacs/emacs/lisp/progmodes/cc-vars.el,v
>retrieving revision 1.37
>diff -u -u -p -d -r1.37 cc-vars.el
>--- cc-vars.el	31 Dec 2004 14:52:17 -0000	1.37
>+++ cc-vars.el	29 Apr 2005 14:11:11 -0000

[ .... ]

>Index: cc-mode.el
>===================================================================
>RCS file: /cvsroot/emacs/emacs/lisp/progmodes/cc-mode.el,v
>retrieving revision 1.34
>diff -u -u -p -d -r1.34 cc-mode.el
>--- cc-mode.el	27 Apr 2005 21:59:43 -0000	1.34
>+++ cc-mode.el	29 Apr 2005 14:11:39 -0000

-- 
Alan Mackenzie (Munich, Germany)





-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20


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

* c-macro-expand isn't part of CC Mode  [Was: cpp use in cc-mode is broken]
  2005-05-03 21:00 ` c-macro-expand isn't part of CC Mode [Was: cpp use in cc-mode is broken] Alan Mackenzie
@ 2005-05-03 22:05   ` Nick Roberts
  2005-05-10 21:56     ` c-macro-expand isn't part of CC Mode Martin Stjernholm
  2005-05-04 20:54   ` c-macro-expand isn't part of CC Mode [Was: cpp use in cc-mode is broken] Eli Zaretskii
  2005-05-05 19:44   ` Richard Stallman
  2 siblings, 1 reply; 5+ messages in thread
From: Nick Roberts @ 2005-05-03 22:05 UTC (permalink / raw)
  Cc: Tim Van Holder, bug-cc-mode, emacs-devel, emacs-pretest-bug

Alan Mackenzie writes:
 > >As of a few days ago, the cc-mode in cvs emacs seems to preprocess the
 > >source file in order to determine the C macros present.

Actually to generate a list of #define directives.

 > Please Note: `c-macro-expand', despite its name, is _NOT_ part of CC
 > Mode.  Its name prefix "c-" is misleading here.  That, and the fact that
 > it has a binding in some of the CC Mode keymaps, is its only connection
 > with CC Mode.  (If you look carefully, you'll find it's not in the CC
 > Mode manual.  ;-)

Within Emacs CVS, I think both cc-mode.el and cmacexp.el are part of
Emacs.

 > `c-macro-expand' actually lives in the file
 > .../list/progmodes/cmacexp.el.  This file was last updated 3 years 8
 > months ago by Eli.

Thats why I'm interested in updating the variable c-macro-preprocessor.

 > There seem to have been a lot of patches to cc-mode.el and friends for
 > c-macro-expand in the last week.  Would somebody please take all these
 > changes out of the CC Mode files and put them into cmacexp.el instead.
 > Otherwise, there's going to be confusion and significant lack of
 > happiness when the time comes to merge the upcoming version of CC Mode
 > (5.31) into savannah.

They wouldn't work in cmacexp.el because they were part of c-mode. I've
already moved them now into gud.el and gdb-ui.el, anyway. Not because
cc-mode.el is part of CC Mode but because they were bad changes. If someone
makes good changes to cc-*.el files in Emacs CVS, then they would presumably
become part of your merge.

Nick


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20


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

* Re: c-macro-expand isn't part of CC Mode [Was: cpp use in cc-mode is broken]
  2005-05-03 21:00 ` c-macro-expand isn't part of CC Mode [Was: cpp use in cc-mode is broken] Alan Mackenzie
  2005-05-03 22:05   ` Nick Roberts
@ 2005-05-04 20:54   ` Eli Zaretskii
  2005-05-05 19:44   ` Richard Stallman
  2 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2005-05-04 20:54 UTC (permalink / raw)
  Cc: tim.vanholder, bug-cc-mode, emacs-pretest-bug, emacs-devel

> Date: Tue, 3 May 2005 21:00:50 +0000 (GMT)
> From: Alan Mackenzie <acm@muc.de>
> Cc: bug-cc-mode@gnu.org, emacs-pretest-bug@gnu.org, emacs-devel@gnu.org
> 
> `c-macro-expand' actually lives in the file
> .../list/progmodes/cmacexp.el.  This file was last updated 3 years 8
> months ago by Eli.

Yes, that's when I fixed a similar problem in cmacexp.el with
invoking cpp.


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20


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

* Re: c-macro-expand isn't part of CC Mode [Was: cpp use in cc-mode is broken]
  2005-05-03 21:00 ` c-macro-expand isn't part of CC Mode [Was: cpp use in cc-mode is broken] Alan Mackenzie
  2005-05-03 22:05   ` Nick Roberts
  2005-05-04 20:54   ` c-macro-expand isn't part of CC Mode [Was: cpp use in cc-mode is broken] Eli Zaretskii
@ 2005-05-05 19:44   ` Richard Stallman
  2 siblings, 0 replies; 5+ messages in thread
From: Richard Stallman @ 2005-05-05 19:44 UTC (permalink / raw)
  Cc: tim.vanholder, nickrob, bug-cc-mode, emacs-pretest-bug,
	emacs-devel

    Please Note: `c-macro-expand', despite its name, is _NOT_ part of CC
    Mode.  Its name prefix "c-" is misleading here.

It has this name because it is specifically for C code and C mode.
This function and its name antedate CC Mode.


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20


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

* Re: c-macro-expand isn't part of CC Mode
  2005-05-03 22:05   ` Nick Roberts
@ 2005-05-10 21:56     ` Martin Stjernholm
  0 siblings, 0 replies; 5+ messages in thread
From: Martin Stjernholm @ 2005-05-10 21:56 UTC (permalink / raw)
  Cc: Alan Mackenzie, Tim Van Holder, bug-cc-mode, emacs-devel,
	emacs-pretest-bug

Nick Roberts <nickrob@snap.net.nz> wrote:

> Within Emacs CVS, I think both cc-mode.el and cmacexp.el are part of
> Emacs.

Maybe so, but it's more relevant to note what the respective
maintainers are inclined to support. If the CC Mode maintainers aren't
prepared to support a certain feature then it's better to not add that
feature to the cc-*.el files. That avoids confusion with bug reports
sent to the wrong places, bitrot and possible lossage in merges.

In this particular case the added feature was outside the scope of CC
Mode, so it's good that it was taken out again (although I'm sure the
feature in itself is very neat). The scope of CC Mode isn't spelled
out anywhere, so I don't blame anyone for missing it. Anyway, it is
something like this:

o  Provide functionality for syntax parsing in the supported
   languages.
o  Implement basic major mode operations for the supported languages,
   meaning buffer setup, movement/mark commands and miscellaneous
   simple tools for handling language constructs (e.g. aligning the
   backslashes in cpp macros).
o  Implement syntactically sensitive indentation and font locking.

Some noteworthy things that are outside the scope:

o  Tracking of symbols, e.g. for providing tooltips containing symbol
   docs and type info etc, or for locating symbol definitions.
o  Stuff that requires knowledge of the compilation environment, e.g.
   pulling in include files, expand macros, tracking cross file
   references.
o  Templates for source constructs, e.g. to quickly insert a more or
   less complete class or method.

These are not left out just because I personally don't consider them
nice features (I do), but because implementing those things well is
nontrivial and requires quite a bit of dedicated effort. I, and I
probably speak for Alan Mackenzie as well here, have enough with
getting the things inside the current scope to work as well as we
would like. Also, there's no particular reason why stuff like that
can't be in separate packages.


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click


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

end of thread, other threads:[~2005-05-10 21:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <d69e7f6a05042907184bd4842d@mail.gmail.com>
2005-05-03 21:00 ` c-macro-expand isn't part of CC Mode [Was: cpp use in cc-mode is broken] Alan Mackenzie
2005-05-03 22:05   ` Nick Roberts
2005-05-10 21:56     ` c-macro-expand isn't part of CC Mode Martin Stjernholm
2005-05-04 20:54   ` c-macro-expand isn't part of CC Mode [Was: cpp use in cc-mode is broken] Eli Zaretskii
2005-05-05 19:44   ` Richard Stallman

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