emacs/site-lisp/header.el

27 lines
659 B
EmacsLisp
Raw Normal View History

2013-01-25 00:09:07 +00:00
;-------------[ This function creates headers like this one ]-------------;
(defun header ()
(interactive)
(beginning-of-line)
(if (and (eolp) (bolp))
(insert ";;")
(progn
(insert ";[ ")
(move-end-of-line 1)
(insert " ];")))
(add-dashes))
(defun add-dashes ()
;; lets wait, just for fun.
(sit-for 0.006)
(end-of-line)
(let ((line-length (current-column)))
(if (oddp line-length)
(progn
(beginning-of-line)
(forward-char))
(backward-char))
(insert "-")
(unless (< 73 line-length)
(add-dashes))))