emacs-devel
[Top][All Lists]
Advanced

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

Re: Issue with hide-ifdef and cc-mode


From: Eli Zaretskii
Subject: Re: Issue with hide-ifdef and cc-mode
Date: Mon, 31 May 2021 14:56:18 +0300

> Date: Sun, 30 May 2021 21:27:39 +0200
> From: Ergus <spacibba@aol.com>
> Cc: mardani29@yahoo.es, emacs-devel@gnu.org, acm@muc.de
> 
> I mean:
> 
> #if 0
> <CODE>
> #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.



reply via email to

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