Created
May 3, 2012 07:34
-
-
Save fakedrake/2584033 to your computer and use it in GitHub Desktop.
a defun to find the next C function declaration in a copy of a .h file's contents and insert the brackets intead of ;
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 my-prepeare-function () | |
"if next function not prepared, prepare it for implementation" | |
(interactive) | |
(save-excursion | |
(search-forward ")" nil (lambda () (message "No more functions after point")) 1) | |
(cond ((looking-at "[\n\t ]*;") | |
(progn | |
(zap-to-char 1 ?\;) | |
(move-end-of-line) | |
(newline) (insert "{") (newline) (insert "}") (newline)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment