We have 15 line long copyright messages at the top of all our source-code files.
When I have them open in emacs, that wastes a lot of valuable space.
Is there any way to get emacs to always a hide a certain message but still leave it in the file?
On your Mac, select a file, then choose File > Get Info, or press Command-I. Click the arrow next to Name & Extension to expand the section. To show or hide the filename extension, select or deselect “Hide extension.”
Keep a JPG photo ready with you on your desktop as you'll be hiding your files in it. You'll need to add the files that you want to hide to a ZIP archive. To do this, right-click on your files, click on Send to, and choose Compressed (zipped) folder.
You can use hideshow minor mode which is a standard built-in package that has a generalized command called hs-hide-initial-comment-block
that will do what you want without having to know how long the top comment section is. You can add it to the mode-hook of any language, but here's an example using C:
(add-hook 'c-mode-common-hook 'hs-minor-mode t)
(add-hook 'c-mode-common-hook 'hs-hide-initial-comment-block t)
Note, it does not hide specifically just the copyrights, but the full initial comment block which may hide useful documentation, as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With