unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Luke Lee <luke.yx.lee@gmail.com>
Cc: contovob@tcd.ie, chenzhiwei03@kuaishou.com, emacs-devel@gnu.org
Subject: Re: master 87e7390: * lisp/progmodes/hideif.el: update for new C++ standards and extensions
Date: Thu, 03 Jun 2021 09:40:19 +0300	[thread overview]
Message-ID: <834kefxxgs.fsf@gnu.org> (raw)
In-Reply-To: <877djbty64.fsf@lukehome> (message from Luke Lee on Thu, 03 Jun 2021 11:38:43 +0800)

> 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	other threads:[~2021-06-03  6:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210602123045.16251.72470@vcs0.savannah.gnu.org>
     [not found] ` <20210602123047.2969E209AA@vcs0.savannah.gnu.org>
2021-06-02 15:19   ` master 87e7390: * lisp/progmodes/hideif.el: update for new C++ standards and extensions Basil L. Contovounesios
2021-06-03  2:50     ` Zhiwei Chen
2021-06-03  3:38       ` Luke Lee
2021-06-03  6:40         ` Eli Zaretskii [this message]
2021-06-03  9:10           ` Luke Lee
2021-06-03 10:52             ` Eli Zaretskii
2021-06-03  3:19     ` Luke Lee
2021-06-03  6:31       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=834kefxxgs.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=chenzhiwei03@kuaishou.com \
    --cc=contovob@tcd.ie \
    --cc=emacs-devel@gnu.org \
    --cc=luke.yx.lee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).