Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide long copyright message at top of all files

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?

like image 862
sligocki Avatar asked Feb 07 '11 16:02

sligocki


People also ask

How do I hide a .app extension on a Mac?

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.”

How do I hide data in a JPEG?

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.


1 Answers

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.

like image 179
aculich Avatar answered Sep 20 '22 06:09

aculich