(cons '(--- "---") (cdr x))))
outline-mode-menu-bar-map))))))
map))
-
+
(defvar outline-mode-map
(let ((map (make-sparse-keymap)))
(defvar outline-view-change-hook nil
"Normal hook to be run after outline visibility changes.")
+(defvar outline-mode-hook nil
+ "*This hook is run when outline mode starts.")
+
;;;###autoload
(define-derived-mode outline-mode text-mode "Outline"
"Set major mode for editing outlines with selective display.
'(outline-font-lock-keywords t nil nil backward-paragraph))
(setq imenu-generic-expression
(list (list nil (concat "^\\(?:" outline-regexp "\\).*$") 0)))
- (add-hook 'change-major-mode-hook 'show-all nil t))
+ (add-hook 'change-major-mode-hook 'show-all nil t)
+ (run-hooks 'outline-mode-hook))
(defcustom outline-minor-mode-prefix "\C-c@"
"*Prefix key to use for Outline commands in Outline minor mode.
(save-match-data
(outline-up-heading 1 t)
(match-string 0))))))
-
+
(unless (rassoc level outline-heading-alist)
(push (cons head level) outline-heading-alist))
-
+
(replace-match up-head nil t)))))
(defun outline-demote (&optional children)
"Move the currrent subtree down past ARG headlines of the same level."
(interactive "p")
(let ((re (concat "^" outline-regexp))
- (movfunc (if (> arg 0) 'outline-get-next-sibling
+ (movfunc (if (> arg 0) 'outline-get-next-sibling
'outline-get-last-sibling))
(ins-point (make-marker))
(cnt (abs arg))
;; Select the tree
(outline-back-to-heading)
(setq beg (point))
- (save-match-data
- (save-excursion (outline-end-of-heading)
+ (save-match-data
+ (save-excursion (outline-end-of-heading)
(setq folded (outline-invisible-p)))
(outline-end-of-subtree))
(if (= (char-after) ?\n) (forward-char 1))
(setq cnt (1- cnt)))
(if (> arg 0)
;; Moving forward - still need to move over subtree
- (progn (outline-end-of-subtree)
+ (progn (outline-end-of-subtree)
(if (= (char-after) ?\n) (forward-char 1))))
(move-marker ins-point (point))
(insert (delete-and-extract-region beg end))
;; reveal do the rest, by simply doing:
;; (remove-overlays (overlay-start o) (overlay-end o)
;; 'invisible 'outline)
- ;;
+ ;;
;; That works fine as long as everything is in sync, but if the
;; structure of the document is changed while revealing parts of it,
;; the resulting behavior can be ugly. I.e. we need to make