From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: CC Mode and GCC/CEDET integration for evaluating macros Date: Fri, 1 May 2015 18:11:35 +0000 Message-ID: <20150501181135.GA6376@acm.fritz.box> References: <87k2wsi62e.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1430503907 4002 80.91.229.3 (1 May 2015 18:11:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 May 2015 18:11:47 +0000 (UTC) Cc: emacs-devel@gnu.org To: Oleh Krehel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 01 20:11:36 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YoFPT-0000vZ-5q for ged-emacs-devel@m.gmane.org; Fri, 01 May 2015 20:11:35 +0200 Original-Received: from localhost ([::1]:55090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoFPS-0004Fc-A5 for ged-emacs-devel@m.gmane.org; Fri, 01 May 2015 14:11:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoFPP-0004FN-Fq for emacs-devel@gnu.org; Fri, 01 May 2015 14:11:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YoFPM-0002Vb-7q for emacs-devel@gnu.org; Fri, 01 May 2015 14:11:31 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:39253 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoFPL-0002VK-UJ for emacs-devel@gnu.org; Fri, 01 May 2015 14:11:28 -0400 Original-Received: (qmail 55262 invoked by uid 3782); 1 May 2015 18:11:25 -0000 Original-Received: from acm.muc.de (p5B146B24.dip0.t-ipconnect.de [91.20.107.36]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 01 May 2015 20:11:24 +0200 Original-Received: (qmail 6464 invoked by uid 1000); 1 May 2015 18:11:35 -0000 Content-Disposition: inline In-Reply-To: <87k2wsi62e.fsf@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:186088 Archived-At: Hello, Oleh. I'm speaking here for CC Mode, not CEDET. On Fri, May 01, 2015 at 07:03:05PM +0200, Oleh Krehel wrote: > Hi all, > I just went through the whole CC Mode manual, just to make sure that I'm > not being silly asking for an existing feature. > I'd like to be able to evaluate the current symbolic constant at point > with "C-x C-e" for C/C++. There's nothing like that in CC Mode. But there is c-macro-expand in cmacexp.el which might have something like this, or be easily hackable to something like this. > Moreover, I remember when I was using Visual Studio 10 years ago, it > had a feature of parsing the macros and graying out #ifdef branches. I > found a screenshot of this if it's not clear what I mean: > http://stackoverflow.com/questions/11610549/ There is hide-ifdef-mode in Emacs which does something similar - It makes the "non-active" bits of #ifdef branches invisible rather than changing their appearance. Doubtless it would be easy enough to add the "greying out" facility as an option. > I think it would be really cool to add both these features to CC Mode. I'm not sure CC Mode would be the best place for these. hide-ifdef-mode nd c-macro-expand already exist. I suggest you look at these first. > So I'd like to ask: > 1. Is there any past progress towards these features? > 2. How viable is it to implement them? Could they work for the most > common build systems? > 3. Could / should they be implemented based on CEDET or GCC? > 4. How hard would it be to actually do it all? Are there any predictable > roadblocks? > 5. Would other people besides me find these features useful? > Oleh -- Alan Mackenzie (Nuremberg, Germany).