Created
June 11, 2013 23:36
-
-
Save ymmt2005/5761766 to your computer and use it in GitHub Desktop.
Emacs skeleton for C++ header files.
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
(add-hook 'find-file-hook 'auto-insert) | |
(setq auto-insert-alist | |
'(("\\.hpp\\'" | |
nil | |
'(setq v1 (read-string "Namespace: " "cybozu")) | |
'(setq v2 (upcase (concat v1 "_" | |
(file-name-nondirectory | |
(file-name-sans-extension buffer-file-name)) | |
"_" (file-name-extension buffer-file-name)))) | |
"// " (file-name-nondirectory buffer-file-name) n | |
"// (C) " (format-time-string "%Y") " Cybozu." n n | |
"#ifndef " v2 n | |
"#define " v2 n n | |
"namespace " v1 " {" n n | |
_ n n | |
"} // namespace " v1 n n | |
"#endif // " v2))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This will insert the following skeleton to empty C++ header files.
NAMESPACE is inputted from the mini buffer.