From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master 87e7390: * lisp/progmodes/hideif.el: update for new C++ standards and extensions Date: Thu, 03 Jun 2021 09:40:19 +0300 Message-ID: <834kefxxgs.fsf@gnu.org> References: <20210602123045.16251.72470@vcs0.savannah.gnu.org> <20210602123047.2969E209AA@vcs0.savannah.gnu.org> <87lf7sguqd.fsf@tcd.ie> <877djbty64.fsf@lukehome> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30801"; mail-complaints-to="usenet@ciao.gmane.io" Cc: contovob@tcd.ie, chenzhiwei03@kuaishou.com, emacs-devel@gnu.org To: Luke Lee Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 03 08:41:55 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1loh3D-0007ok-92 for ged-emacs-devel@m.gmane-mx.org; Thu, 03 Jun 2021 08:41:55 +0200 Original-Received: from localhost ([::1]:60170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loh3C-0007UF-Cc for ged-emacs-devel@m.gmane-mx.org; Thu, 03 Jun 2021 02:41:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loh1v-0005nz-CF for emacs-devel@gnu.org; Thu, 03 Jun 2021 02:40:36 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58414) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loh1s-0000Q3-28; Thu, 03 Jun 2021 02:40:32 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4996 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loh1q-0007r7-Sl; Thu, 03 Jun 2021 02:40:31 -0400 In-Reply-To: <877djbty64.fsf@lukehome> (message from Luke Lee on Thu, 03 Jun 2021 11:38:43 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:270338 Archived-At: > From: Luke Lee > Date: Thu, 03 Jun 2021 11:38:43 +0800 > Cc: "Basil L. Contovounesios" , > emacs-devel > > 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?