summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-05-19 16:19:00 +0000
committerRichard M. Stallman <rms@gnu.org>1993-05-19 16:19:00 +0000
commit8f1e8ff04f817a100fecc700ccb36deff8148675 (patch)
tree539482ba5da460251aedb88635e94012addb5c51 /lisp
parent5320ab51064aa8be4d05a917f074c1453b6e9e9e (diff)
downloademacs-8f1e8ff04f817a100fecc700ccb36deff8148675.tar.gz
emacs-8f1e8ff04f817a100fecc700ccb36deff8148675.tar.bz2
emacs-8f1e8ff04f817a100fecc700ccb36deff8148675.zip
(outline-heading-end-regexp): Fix typo.
(outline-minor-mode-map): New variable. (minor-mode-map-alist): Add new entry. (outline-minor-mode): Work with above change. Do not set outline-regexp or outline-header-end-regexp.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/textmodes/ooutline.el32
1 files changed, 17 insertions, 15 deletions
diff --git a/lisp/textmodes/ooutline.el b/lisp/textmodes/ooutline.el
index 19ee1f70b29..7867652ea62 100644
--- a/lisp/textmodes/ooutline.el
+++ b/lisp/textmodes/ooutline.el
@@ -36,7 +36,7 @@ Any line whose beginning matches this regexp is considered to start a heading.
The recommended way to set this is with a Local Variables: list
in the file it applies to. See also outline-heading-end-regexp.")
-(defvar outline-heading-end-regexp "[\n^M]"
+(defvar outline-heading-end-regexp "[\n\^M]"
"*Regular expression to match the end of a heading line.
You can assume that point is at the beginning of a heading when this
regexp is searched for. The heading ends at the end of the match.
@@ -122,7 +122,19 @@ Turning on outline mode calls the value of `text-mode-hook' and then of
outline-regexp "\\)"))
(run-hooks 'text-mode-hook 'outline-mode-hook))
-(defun outline-minor-mode (arg)
+(defvar outline-minor-mode-map nil)
+(if outline-minor-mode-map
+ nil
+ (setq outline-minor-mode-map (make-sparse-keymap))
+ (define-key outline-minor-mode-map "\C-c"
+ (lookup-key outline-mode-map "\C-c")))
+
+(or (assq 'outline-minor-mode minor-mode-map-alist)
+ (setq minor-mode-map-alist
+ (cons (cons 'outline-minor-mode outline-minor-mode-map)
+ minor-mode-map-alist)))
+
+(defun outline-minor-mode (&optional arg)
(interactive "P")
(setq outline-minor-mode
(if (null arg) (not outline-minor-mode)
@@ -130,20 +142,8 @@ Turning on outline mode calls the value of `text-mode-hook' and then of
(if outline-minor-mode
(progn
(setq selective-display t)
- (make-local-variable 'outline-old-map)
- (setq outline-old-map (current-local-map))
- (let ((new-map (copy-keymap outline-old-map)))
- (define-key new-map "\C-c"
- (lookup-key outline-mode-map "\C-c"))
- (use-local-map new-map))
- (make-local-variable 'outline-regexp)
- (setq outline-regexp "[ \t]*/\\*")
- (make-local-variable 'outline-heading-end-regexp)
- (setq outline-heading-end-regexp "\\*/[^\n\^M]*[\n\^M]")
(run-hooks 'outline-minor-mode-hook))
- (progn
- (setq selective-display nil)
- (use-local-map outline-old-map))))
+ (setq selective-display nil)))
(defun outline-level ()
"Return the depth to which a statement is nested in the outline.
@@ -407,4 +407,6 @@ and return that position or nil if it cannot be found."
nil
(point))))
+(provide 'outline)
+
;;; outline.el ends here