Last active
December 21, 2015 01:48
-
-
Save pogin503/6230075 to your computer and use it in GitHub Desktop.
Emacs Lispのファイルのヘッダ、フッタ情報が全く無い場合に挿入する関数。CheckDocでヘッダ、フッタがないと指摘されるので作ってみた。関連:http://aka-cs-blog.blogspot.jp/2009/12/emacs.html
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 insert-elisp-file-info () | |
"Insert Emacs Lisp header info." | |
(interactive) | |
(goto-char (point-min)) | |
(let ((f (file-name-nondirectory (buffer-file-name))) | |
(f-noext (file-name-base))) | |
(insert (format ";;; %s --- %s\n" f f)) | |
(insert (format ";; Author: %s\n" user-full-name)) | |
(insert ";; Version: \n") | |
(insert ";; Package-Requires: ()\n") | |
(insert ";;; Commentary:\n") | |
(insert ";; This program is free software\n") | |
(insert ";;; Code:\n\n") | |
(goto-char (point-max)) | |
(save-excursion | |
(insert (format "\n(provide '%s)\n" f-noext)) | |
(insert (format ";;; %s ends here\n" f)) | |
))) |
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
;;; myfile.el --- myfile.el | |
;; Author: pogin503 | |
;; Version: | |
;; Package-Requires: () | |
;;; Commentary: | |
;; This program is free software | |
;;; Code: | |
(provide 'myfile) | |
;;; myfile.el ends here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment