emacs/site-lisp/header.el
2013-01-25 01:09:07 +01:00

27 lines
659 B
EmacsLisp

;-------------[ 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))))