![[Home]](https://www.emacswiki.org/images/logo218x38.png)
This page is about library hide-comnt.el and related features.
hide-comnt.el provides two commands, a macro, and a user option:
‘hide/show-comments’ – Does what its name says. If the region is active then hiding is limited to the region. With a prefix argument, hidden comments are shown again.‘hide/show-comments-toggle’ – Toggles hiding/showing in the active region, or the whole buffer if the region is inactive.‘with-comments-hidden’ – Temporarily hides comments while it executes a body of code. You do not see the commented text disappear and reappear – it is effectively just ignored while processing the body. The macro uses ‘hide/show-comments’ to hide the comments.‘hide-whitespace-before-comment-flag’ – If non-‘nil’ then whitespace preceding a comment is hidden. Empty lines (newline chars) are not hidden, however.‘ignore-comments-flag’ – If ‘nil’ then ‘with-comments-hidden’ does not ignore comments.‘show-invisible-comments-shows-all’ – If non-‘nil’ then showing comments after hiding them shows all text that was invisible, however it was made so. The default is ‘nil’: make visible only text that was made invisible by ‘hide/show-comments’.‘next-visible-thing’ and ‘previous-visible-thing’, in library thing-cmds.el, use macro ‘with-comments-hidden’, so they ignore things that are in commented code.C-M-;’ in the minibuffer toggles option ‘ignore-comments-flag’.‘icicle-search-thing’ respects the option: when non-‘nil’ it ignores (does not search) ThingAtPoint things that are commented out.‘icicle-next-visible-thing’ and ‘icicle-previous-visible-thing’ are similar to ‘next-visible-thing’ and ‘previous-visible-thing’ from thing-cmds.el.Added an ELPA package of this library for download here: http://www.wisdomandwonder.com/link/6390/hide-or-ignore-comments-elpa-package – GrantRettke