From: Eli Zaretskii <eliz@gnu.org>
To: Ergus <spacibba@aol.com>
Cc: acm@muc.de, emacs-devel@gnu.org, mardani29@yahoo.es
Subject: Re: Issue with hide-ifdef and cc-mode
Date: Mon, 31 May 2021 14:56:18 +0300 [thread overview]
Message-ID: <83fsy32k2l.fsf@gnu.org> (raw)
In-Reply-To: <20210530192739.34xj5ndlca4gpicm@Ergus> (message from Ergus on Sun, 30 May 2021 21:27:39 +0200)
> 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.
next prev parent reply other threads:[~2021-05-31 11:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210530070822.h57mmtpp2n7dvpbf.ref@Ergus>
2021-05-30 7:08 ` Issue with hide-ifdef and cc-mode Ergus
2021-05-30 11:01 ` Daniel Martín
2021-05-30 18:14 ` Ergus
2021-05-30 18:53 ` Eli Zaretskii
2021-05-30 19:27 ` Ergus
2021-05-31 11:56 ` Eli Zaretskii [this message]
2021-05-30 19:42 ` Stefan Monnier
2021-05-30 20:26 ` Ergus
[not found] <20210527030630.ys6pbkbtqui66iuz.ref@Ergus>
2021-05-27 3:06 ` Ergus
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83fsy32k2l.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=acm@muc.de \
--cc=emacs-devel@gnu.org \
--cc=mardani29@yahoo.es \
--cc=spacibba@aol.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.