Created
February 6, 2026 12:06
-
-
Save cabo/05ad768883421ab7af270fb6cc657584 to your computer and use it in GitHub Desktop.
hideshow-hide-initial-comment-nxml.el
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun hs-hide-initial-comment-block () | |
| "Hide the first block of comments in a file. | |
| This can be useful if you have huge RCS logs in those comments. | |
| Extended to work with XML, where there often is an XML declaration | |
| before the initial comment. | |
| " | |
| (interactive) | |
| (hs-life-goes-on | |
| (let ((c-reg (save-excursion | |
| (or (progn | |
| (goto-char (point-min)) | |
| (skip-chars-forward " \t\n\f") | |
| (hs-inside-comment-p)) | |
| (and nxml-prolog-regions | |
| (cl-loop for entry in nxml-prolog-regions | |
| when (eq (aref entry 0) 'comment) | |
| return (list (aref entry 1) (aref entry 2)))))))) | |
| (when c-reg | |
| (let ((beg (car c-reg)) (end (cadr c-reg))) | |
| ;; see if we have enough comment lines to hide | |
| (when (> (count-lines beg end) 1) | |
| (hs-hide-comment-region beg end))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment