Created
March 16, 2018 15:46
-
-
Save autosquid/d72e2e846b0692046563ee73d547a580 to your computer and use it in GitHub Desktop.
remove cpp header guard (once)
This file contains 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 remove-line() | |
(delete-region | |
(progn (forward-visible-line 0) (point)) | |
(progn (forward-visible-line 1) (point)))) | |
(defun remove-guard() | |
(interactive) | |
(progn | |
(goto-char (point-min)) | |
(search-forward-regexp "^#ifndef") | |
(remove-line) | |
(goto-char (point-min)) | |
(search-forward-regexp "^#define") | |
(remove-line ) | |
(goto-char (point-max)) | |
(search-backward-regexp "^#endif") | |
(remove-line))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment