Skip to content

Instantly share code, notes, and snippets.

@pogin503
Last active December 21, 2015 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pogin503/6230075 to your computer and use it in GitHub Desktop.
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
(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))
)))
;;; 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