;; setup stuff for outline mode ;; The following sets emin-outline-fontlock such that it ;; can be used by font-lock to highlight nodes in outline mode. (setq emin-outline-fontlock '((eval list (concat "^" outline-regexp ".+") 0 '(or (cdr (assq (outline-font-lock-level) '((1 . emin-outline-h1-face) (2 . font-lock-comment-face) (3 . font-lock-keyword-face) (4 . font-lock-function-name-face) (5 . font-lock-type-face) (6 . font-lock-builtin-face) (7 . font-lock-string-face) (8 . font-lock-variable-name-face)))) font-lock-warning-face) nil t))) (defun setup-my-outline-style () (progn (setq tab-width 2) ; (setq outline-regexp "^ *\\*+") (auto-fill-mode 't) (setq outline-font-lock-keywords emin-outline-fontlock) (local-set-key "\C-c\C-a" 'show-all) (local-set-key "\C-ca" 'outline-main-display) ) ) (defun outline-main-display () "Hide everything except the top level nodes." (interactive) (save-excursion (let (endpoint) (goto-char (point-max)) (beginning-of-line) (setq endpoint (point)) (goto-char 1) (goto-char (search-forward "*")) (while (< (point) endpoint) (next-line 1) (hide-subtree))))) (make-face 'emin-outline-h1-face) (make-face-bold 'emin-outline-h1-face) (set-face-foreground 'emin-outline-h1-face "white")