;;;; JCGS's html-helper-config ;;; Time-stamp: <2007-07-15 23:38:57 jcgs> (add-lispdir "$COMMON/emacs/webstuff") (require 'mailto-checker) (require 'seq-numbering) (defun john-html-helper-write-hook () "Fancy stuff on writing an HTML file." (html-find-bad-mailto) (number-sequentially) (update-recent-changes-file (buffer-file-name))) (defvar john-html-helper-short-directory-name nil "The last part of the name of the directory holding the file in this buffer. This is so that if the file is called index.html, we can add to the mode line an indication of which directory it is in. This variable has a different value for each buffer.") (make-variable-buffer-local 'john-html-helper-short-directory-name) (defun john-html-helper-mode-hook () (interactive) (add-hook 'local-write-file-hooks 'john-html-helper-write-hook) (setq john-html-helper-short-directory-name (file-name-nondirectory (substring (file-name-directory (buffer-file-name)) 0 -1))) (sidebrain-read-todo-from-comments) ;; (butterfly-note-file) (if (string-match "index\\..?html$" (file-name-nondirectory (buffer-file-name))) (setq mode-line-buffer-identification (list john-html-helper-short-directory-name ":" (car mode-line-buffer-identification)))) (let ((contact-pair (assoc webmaster:page-site-homepage-url webmaster:contact-addresses))) (if contact-pair (setq html-helper-address-string (cdr contact-pair)))) (auto-fill-mode 1) (font-lock-mode 1)) (add-hook 'html-helper-mode-hook 'john-html-helper-mode-hook) (defun one-blank-line (&optional n) (interactive) (delete-blank-lines) (delete-blank-lines) (open-line (if n n 1))) (defun jcgs-html-helper-load-hook () "Some setup to do on loading html-helper-mode" (mapcar (function (lambda (file) (load-file (expand-file-name file (substitute-in-file-name "$GATHERED/emacs/html-helper-mode"))))) '( ;; "tables.el" )) (html-helper-toggle-expert-menu 1) (html-helper-add-type-to-alist '(ssi . (html-helper-ssi-map "\C-c\C-v" html-helper-ssi-menu "Insert Server Include"))) (html-helper-install-type 'ssi) (mapcar 'html-helper-add-tag '( ;; make paragraphs be containers (textel "\e\C-m" nil "Paragraph" ((one-blank-line) "\n

" p "

" (one-blank-line))) (ssi "\C-c\C-vv" nil "Include Virtual" ("\n")) (ssi "\C-c\C-vx" nil "Exec" ("\n")) (ssi "\C-c\C-vc" nil "Config" ("\n")) (ssi "\C-c\C-vi" nil "If" ("\n")) (ssi "\C-c\C-vl" nil "Else" ("\n")) (ssi "\C-c\C-vn" nil "Endif" ("\n")) (ssi "\C-c\C-vi" nil "If-Else-Endif" ("\n" "\n" "\n")) (ssi "\C-c\C-vs" nil "Set" ("\n")) )) (html-helper-rebuild-menu) (require 'handsfree-html-helper)) (add-hook 'html-helper-load-hook 'jcgs-html-helper-load-hook) (setq html-helper-address-string (format "John Sturdy\n" ;; (user-login-name) (system-domain-name) ;; todo: work out what address to give, by which directory we are in "john" "cb1.com" ) html-helper-do-write-file-hooks t html-helper-timestamp-start "" html-helper-timestamp-end "" html-use-font-lock t html-helper-do-write-file-hooks t html-helper-build-new-buffer t ;; todo: work this one out according to which directory I'm in ;; html-helper-new-buffer-template html-helper-new-buffer-template ) ;;; end of html-helper-config.el