Permalink
Browse files

Add helper command for adding minimal elisp boilerplate to the curren…

…t file
  • Loading branch information...
purcell committed Jan 7, 2019
1 parent 418dce3 commit d7eb22eb22454af82bae6181edc962d6abcfea46
Showing with 14 additions and 0 deletions.
  1. +14 −0 lisp/init-lisp.el
@@ -11,6 +11,20 @@
(concat ";; Happy hacking, " user-login-name " - Emacs ♥ you!\n\n"))


(defun sanityinc/headerise-elisp ()
"Add minimal header and footer to an elisp buffer in order to placate flycheck."
(interactive)
(let ((fname (if (buffer-file-name)
(file-name-nondirectory (buffer-file-name))
(error "This buffer is not visiting a file"))))
(save-excursion
(goto-char (point-min))
(insert ";;; " fname " --- Insert description here -*- lexical-binding: t -*-\n"
";;; Commentary:\n"
";;; Code:\n\n")
(goto-char (point-max))
(insert ";;; " fname " ends here\n"))))


;; Make C-x C-e run 'eval-region if the region is active

0 comments on commit d7eb22e

Please sign in to comment.