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: Issue with hide-ifdef and cc-mode Date: Mon, 31 May 2021 14:56:18 +0300 Message-ID: <83fsy32k2l.fsf@gnu.org> References: <20210530070822.h57mmtpp2n7dvpbf.ref@Ergus> <20210530070822.h57mmtpp2n7dvpbf@Ergus> <20210530181411.jquh47dwgxtctmzc@Ergus> <83pmx82gv8.fsf@gnu.org> <20210530192739.34xj5ndlca4gpicm@Ergus> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18923"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, emacs-devel@gnu.org, mardani29@yahoo.es To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 31 13:57:02 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 1lngXW-0004cD-Nu for ged-emacs-devel@m.gmane-mx.org; Mon, 31 May 2021 13:57:02 +0200 Original-Received: from localhost ([::1]:34786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lngXU-0007FE-QT for ged-emacs-devel@m.gmane-mx.org; Mon, 31 May 2021 07:57:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lngWh-0006YL-F6 for emacs-devel@gnu.org; Mon, 31 May 2021 07:56:11 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:41702) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lngWg-0000JD-PA; Mon, 31 May 2021 07:56:10 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4267 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 1lngWc-0002kD-Bw; Mon, 31 May 2021 07:56:10 -0400 In-Reply-To: <20210530192739.34xj5ndlca4gpicm@Ergus> (message from Ergus on Sun, 30 May 2021 21:27:39 +0200) 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:270167 Archived-At: > Date: Sun, 30 May 2021 21:27:39 +0200 > From: Ergus > Cc: mardani29@yahoo.es, emacs-devel@gnu.org, acm@muc.de > > I mean: > > #if 0 > > #endif > > M-x hide-ifdef-mode > M-x hide-ifdef-toggle-shadowing > > does not shadows the region. > > I need to explicitly call > M-x hide-ifdefs If you want hide-ifdef-mode automatically hide the "#if 0" blocks when you turn it on, set hide-ifdef-initially non-nil. This is in the commentary in hideif.el > If I change after that #if 0 -> #if 1; the shadow does not disappears > inmediately. So I need to call: M-x hide-ifdefs again. If you want this to happen automatically, it could be provided as an optional feature, but we should decide what should trigger that. I'm not sure using JIT font-lock for this is a good idea, because it would mean blocks will appear and disappear as you type the preprocessor instructions, until you actually finish them. > This is the part that I think may be automatized. Calling hide-ifdefs > every time is annoying. Even if you bind that to some key like F7? > Emacs is smart enough to recognize when the user modifies a > cpp-macro. And multi-line code highlight is simple like /* */ does... I'm not sure we really want the annoyance that dynamic comment fontification causes, especially since in this case entire blocks of code will appear and disappear, rather than just be painted in a different color.