emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 87e7390: * lisp/progmodes/hideif.el: update for new C++ stand


From: Eli Zaretskii
Subject: Re: master 87e7390: * lisp/progmodes/hideif.el: update for new C++ standards and extensions
Date: Thu, 03 Jun 2021 09:40:19 +0300

> From: Luke Lee <luke.yx.lee@gmail.com>
> Date: Thu, 03 Jun 2021 11:38:43 +0800
> Cc: "Basil L. Contovounesios" <contovob@tcd.ie>,
>  emacs-devel <emacs-devel@gnu.org>
> 
> Personally I never use `hide-ifdef-define', it's what it originally was
> so I kept it.  I only use `hide-ifdefs' and EmacsSession to save/restore
> `hide-ifdef-env' as I described long ago in EmacsWiki
> https://www.emacswiki.org/emacs/HideIfDef (haven't got
> time to update it yet).  Plus the newly described method in the
> comment of the beginning of hideif.el:
> [...]
> ;;   $ gcc -dM -E hello.c -o hello.hh
> [...]
> Then I open the hello.hh and `hide-ifdefs' it.  With EmacsSession I only
> need to do that once.  Next time when I launch Emacs it will automatically
> bring back my earlier defines.  As EmacsSession is not standard thus I
> didn't mention that in the hideif.el comment.  I am sure there are now
> some other packages able to save/restore the global `hide-ifdef-env'.

How about making hideif.el capable of running a GCC command such as
above automatically, and using the output to find which macros should
be defined and which shouldn't?

Btw, the example above is simplistic: you actually need to supply all
the relevant compiler switches on the GCC command" the -I switches,
the -D and -U switches, etc.; otherwise, the results will be
inaccurate.

As another "btw", we have cpp.el which provides a similar
functionality; perhaps hideif.el could learn something from there?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]