Paste number 355494: outline problem

Paste number 355494: outline problem
Pasted by: thblt
When:1 month, 3 weeks ago
Share:Tweet this! | http://paste.lisp.org/+7MAU
Channel:None
Paste contents:
Raw Source | XML | Display As
(add-hook 'haskell-mode-hook
          (lambda ()
            (setq outline-heading-alist
                  (thblt/mk-outline-heading-alist "--" ?- " ")))) ;; (("---" . 1) ("----" . 2)), etc

(add-hook 'literate-haskell-mode-hook
          (lambda ()
            (setq outline-heading-alist
                  (thblt/mk-outline-heading-alist "" ?= " ")))) ;; (("= " . 1) ("== ")), etc

(add-hook 'lisp-mode-hook
          (lambda ()
            (setq outline-heading-alist
                  (thblt/mk-outline-heading-alist ";;" ?\; " "))))  ;; ((";;; " . 1) (";;;; " . 2)), etc

(defun thblt/mk-outline-heading-alist (before character after &optional start end)
  "Make an alist of (HEADING . LEVEL) usable as `outline-heading-alist.

For level n, BEFORE is concatenated with n times CHARACTER followed by AFTER.

Sequences start at START and end at END, default is 1--8."
  (unless start (setq start 1))
  (unless end (setq end 8))
  (mapcar (lambda (n) (cons (concat
                             before
                             (make-string n character)
                             after)
                            n))
          (number-sequence start end)))

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.