Skip to content

Instantly share code, notes, and snippets.

@fakedrake
Created May 3, 2012 07:34
Show Gist options
  • Save fakedrake/2584033 to your computer and use it in GitHub Desktop.
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 ;
(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