From d292d28fedd4bc7ab8c3bdff5fcc0ba4534cf21e Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 8 Jun 2020 23:47:46 +0200 Subject: Replace custom copyright comment hiding with HideShow mode --- gui/conf/init.el | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/gui/conf/init.el b/gui/conf/init.el index 3142d00..dfc886d 100644 --- a/gui/conf/init.el +++ b/gui/conf/init.el @@ -209,17 +209,5 @@ (use-package ag :ensure t) -(defun copyright-message-p () - "Returns t when the current buffer starts with a Copyright note" - (save-excursion - (goto-char (point-min)) - (looking-at "\\s */\\*\\(:?\\s \\|\\*\\)*\\(This file\\|Copyright\\)\\b"))) - -(defun hide-copyright-note () - "Tries to narrow the current buffer so that the copyright comment is hidden" - (interactive) - (when (copyright-message-p) - (save-excursion - (let* ((start (progn (goto-char (point-min)) (forward-comment (buffer-size)) (point))) - (end (progn (end-of-buffer) (point)))) - (narrow-to-region start end))))) +(add-hook 'c-mode-common-hook 'hs-minor-mode t) +(add-hook 'c-mode-common-hook 'hs-hide-initial-comment-block t) -- cgit v1.2.3