(defvar insert-time-format "%T" "*Format for \\[insert-time] (c.f. 'format-time-string' for how to format).") (defvar insert-date-format "%Y %m %d" "*Format for \\[insert-date] (c.f. 'format-time-string' for how to format).") (defun insert-time () "Insert the current time according to the variable \"insert-time-format\"." (interactive "*") (insert (format-time-string insert-time-format (current-time)))) (defun insert-date () "Insert the current date according to the variable \"insert-date-format\"." (interactive "*") (insert (format-time-string insert-date-format (current-time)))) ;;; A macro to add a link to the top of the page: ;;; Up to the Top of the Page
(defun to-top () "add a link to the top of the page: \"Up to the Top of the Page
\\n\" It assumes you have already established the anchor for the link." (interactive "*") (insert "Up to the Top of the Page
\n") ) ;;; Given a hyperlink already in the ring buffer, and a region defined, ;;; makes the given region into a hyperlink pointing to the location in ;;; the ring buffer. (fset 'link "\C-u\C-c\C-al#\C-y") ;; Add a $(new) entry to a web page. (defun addnew () "Insert the text for a \"new\" splat. Use kill-new-splat to remove it when it has aged enough." (interactive "*") (insert ".- ") (let ((time (current-time-string))) (insert (substring time -4))) (insert "z$(bullet)\n$(new) ")) ;;; kill of the $(new) macro installed above when it has expired (fset 'kill-new-splat [?\C-a ?\M-z ?z down ?\M-z ?) ?\M-^]) (setq html-helper-new-buffer-template '(html-helper-htmldtd-version "
\n" "\n" "Up to the Top of the Page\n" "