;;; Muse (require 'muse-mode) (require 'muse-project) (require 'muse-publish) (require 'muse-html) (require 'muse-wiki) (require 'muse-latex) (require 'muse-book) (muse-derive-style "cke-xhtml" "xhtml" :header 'muse-cke-xhtml-header :footer 'muse-cke-xhtml-footer) ;;; Project Configuration (setq muse-project-alist '(("unknownlamer.org" ("~/html/muse/src/unknownlamer.org" :default "index") (:base "cke-xhtml" :path "~/html/muse/site/unknownlamer.org-test")) ("unknownlamer.org-clean" ("~/html/muse/site/unknownlamer.org-repo" :default "index") (:base "cke-xhtml" :path "~/html/muse/site/unknownlamer.org")) ("clintons-plans" ("~/plans" :major-mode planner-mode :visit-link planner-visit-link :default "TaskPool") (:base "planner-html" :path "~/html/plan-pages")))) (setq muse-html-charset-default "utf-8") ; utf-8 is the only true way ; for the enlightened hacker (setq muse-cke-xhtml-header "~/html/muse/templates/header.html") (setq muse-cke-xhtml-footer "~/html/muse/templates/footer.html") ;;; Footer helper functions (require 'randomsig) (require 'psgml-html) (defun cke-muse-randomsig-signature () "Return randomsig from normal and web only collection" (with-temp-buffer (insert (randomsig-signature (cons "web-only" randomsig-files))) (html-quote-region (point-min) (point-max)) (buffer-substring-no-properties (point-min) (point-max)))) ;;; Hyperspec integration (require 'hyperspec) (defvar cke-clhs-root common-lisp-hyperspec-root "Root of clhs for interwiki links") (defun cke-clhs-get-urls (entry) "Hack to get a list of urls from `common-lisp-hyperspec'" (let ((cke-clhs-urls (list))) (flet ((browse-url (url) (add-to-list 'cke-clhs-urls url))) (common-lisp-hyperspec entry) cke-clhs-urls))) (defun cke-clhs-interwiki (entry) "Returns url to be used for muse interwiki link lookup up Hyperspec entries" (let ((common-lisp-hyperspec-root cke-clhs-root)) (let ((clhs-urls (cke-clhs-get-urls entry))) ;; todo: if more than one url be returned ;; fixme: use all urls (car clhs-urls)))) (add-to-list 'muse-wiki-interwiki-alist (cons "clhs" #'cke-clhs-interwiki)) (setq cke-clhs-root "http://www.lispworks.com/reference/HyperSpec/") ;;; Easy links to my darcsweb (defvar cke-darcsweb-root "http://unknownlamer.org/darcsweb/browse") (defun cke-darcsweb-interwiki (project/file) (destructuring-bind (project &rest files) (split-string project/file '"/" nil) (cond ((null files) (format "%s?r=%s;a=summary" cke-darcsweb-root (url-insert-entities-in-string project))) (files (format "%s?r=%s;a=%s;f=%s" cke-darcsweb-root (url-insert-entities-in-string project) (if (string= (car (last files)) "") "tree" "headblob") (url-insert-entities-in-string (apply #'concat (mapcan (lambda (e) (list "/" e)) files)))))))) (add-to-list 'muse-wiki-interwiki-alist (cons "darcsweb" #'cke-darcsweb-interwiki)) ;;; Local Keybindings (define-key muse-mode-map [?\C-j] #'muse-insert-list-item) (define-key muse-mode-map [?\C-c ?\C-c] #'comment-region) ;;; xhtml backend customizations (setq muse-xhtml-style-sheet "") ;;; Console Keybindings (when (null window-system) (define-key muse-mode-map [?\C-c ?>] #'muse-increase-list-item-indentation) (define-key muse-mode-map [?\C-c ?<] #'muse-decrease-list-item-indentation))