diff options
| author | Richard M. Stallman | 1993-05-19 16:19:00 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-05-19 16:19:00 +0000 |
| commit | 8f1e8ff04f817a100fecc700ccb36deff8148675 (patch) | |
| tree | 539482ba5da460251aedb88635e94012addb5c51 | |
| parent | 5320ab51064aa8be4d05a917f074c1453b6e9e9e (diff) | |
| download | emacs-8f1e8ff04f817a100fecc700ccb36deff8148675.tar.gz 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.
| -rw-r--r-- | lisp/textmodes/ooutline.el | 32 |
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. | |||
| 36 | The recommended way to set this is with a Local Variables: list | 36 | The recommended way to set this is with a Local Variables: list |
| 37 | in the file it applies to. See also outline-heading-end-regexp.") | 37 | in the file it applies to. See also outline-heading-end-regexp.") |
| 38 | 38 | ||
| 39 | (defvar outline-heading-end-regexp "[\n^M]" | 39 | (defvar outline-heading-end-regexp "[\n\^M]" |
| 40 | "*Regular expression to match the end of a heading line. | 40 | "*Regular expression to match the end of a heading line. |
| 41 | You can assume that point is at the beginning of a heading when this | 41 | You can assume that point is at the beginning of a heading when this |
| 42 | regexp is searched for. The heading ends at the end of the match. | 42 | 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 | |||
| 122 | outline-regexp "\\)")) | 122 | outline-regexp "\\)")) |
| 123 | (run-hooks 'text-mode-hook 'outline-mode-hook)) | 123 | (run-hooks 'text-mode-hook 'outline-mode-hook)) |
| 124 | 124 | ||
| 125 | (defun outline-minor-mode (arg) | 125 | (defvar outline-minor-mode-map nil) |
| 126 | (if outline-minor-mode-map | ||
| 127 | nil | ||
| 128 | (setq outline-minor-mode-map (make-sparse-keymap)) | ||
| 129 | (define-key outline-minor-mode-map "\C-c" | ||
| 130 | (lookup-key outline-mode-map "\C-c"))) | ||
| 131 | |||
| 132 | (or (assq 'outline-minor-mode minor-mode-map-alist) | ||
| 133 | (setq minor-mode-map-alist | ||
| 134 | (cons (cons 'outline-minor-mode outline-minor-mode-map) | ||
| 135 | minor-mode-map-alist))) | ||
| 136 | |||
| 137 | (defun outline-minor-mode (&optional arg) | ||
| 126 | (interactive "P") | 138 | (interactive "P") |
| 127 | (setq outline-minor-mode | 139 | (setq outline-minor-mode |
| 128 | (if (null arg) (not outline-minor-mode) | 140 | (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 | |||
| 130 | (if outline-minor-mode | 142 | (if outline-minor-mode |
| 131 | (progn | 143 | (progn |
| 132 | (setq selective-display t) | 144 | (setq selective-display t) |
| 133 | (make-local-variable 'outline-old-map) | ||
| 134 | (setq outline-old-map (current-local-map)) | ||
| 135 | (let ((new-map (copy-keymap outline-old-map))) | ||
| 136 | (define-key new-map "\C-c" | ||
| 137 | (lookup-key outline-mode-map "\C-c")) | ||
| 138 | (use-local-map new-map)) | ||
| 139 | (make-local-variable 'outline-regexp) | ||
| 140 | (setq outline-regexp "[ \t]*/\\*") | ||
| 141 | (make-local-variable 'outline-heading-end-regexp) | ||
| 142 | (setq outline-heading-end-regexp "\\*/[^\n\^M]*[\n\^M]") | ||
| 143 | (run-hooks 'outline-minor-mode-hook)) | 145 | (run-hooks 'outline-minor-mode-hook)) |
| 144 | (progn | 146 | (setq selective-display nil))) |
| 145 | (setq selective-display nil) | ||
| 146 | (use-local-map outline-old-map)))) | ||
| 147 | 147 | ||
| 148 | (defun outline-level () | 148 | (defun outline-level () |
| 149 | "Return the depth to which a statement is nested in the outline. | 149 | "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." | |||
| 407 | nil | 407 | nil |
| 408 | (point)))) | 408 | (point)))) |
| 409 | 409 | ||
| 410 | (provide 'outline) | ||
| 411 | |||
| 410 | ;;; outline.el ends here | 412 | ;;; outline.el ends here |