diff options
| author | Richard M. Stallman | 1996-06-26 18:03:44 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-06-26 18:03:44 +0000 |
| commit | be166d172626b2189fcb2be89f2cc14a080632da (patch) | |
| tree | 447e3d062cb1e5b03a60486b76cf56a0dd45ca9c | |
| parent | defccde391a243f40185b8c12080ffa74032a000 (diff) | |
| download | emacs-be166d172626b2189fcb2be89f2cc14a080632da.tar.gz emacs-be166d172626b2189fcb2be89f2cc14a080632da.zip | |
(outline-minor-mode): No longer permanent local.
| -rw-r--r-- | lisp/textmodes/outline.el | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lisp/textmodes/outline.el b/lisp/textmodes/outline.el index cb5f2daa211..02018d2d218 100644 --- a/lisp/textmodes/outline.el +++ b/lisp/textmodes/outline.el | |||
| @@ -132,7 +132,6 @@ in the file it applies to.") | |||
| 132 | (defvar outline-minor-mode nil | 132 | (defvar outline-minor-mode nil |
| 133 | "Non-nil if using Outline mode as a minor mode of some other mode.") | 133 | "Non-nil if using Outline mode as a minor mode of some other mode.") |
| 134 | (make-variable-buffer-local 'outline-minor-mode) | 134 | (make-variable-buffer-local 'outline-minor-mode) |
| 135 | (put 'outline-minor-mode 'permanent-local t) | ||
| 136 | (or (assq 'outline-minor-mode minor-mode-alist) | 135 | (or (assq 'outline-minor-mode minor-mode-alist) |
| 137 | (setq minor-mode-alist (append minor-mode-alist | 136 | (setq minor-mode-alist (append minor-mode-alist |
| 138 | (list '(outline-minor-mode " Outl"))))) | 137 | (list '(outline-minor-mode " Outl"))))) |
| @@ -251,6 +250,11 @@ See the command `outline-mode' for more information on this mode." | |||
| 251 | (> (prefix-numeric-value arg) 0))) | 250 | (> (prefix-numeric-value arg) 0))) |
| 252 | (if outline-minor-mode | 251 | (if outline-minor-mode |
| 253 | (progn | 252 | (progn |
| 253 | (make-local-hook 'change-major-mode-hook) | ||
| 254 | ;; Turn off this mode if we change major modes. | ||
| 255 | (add-hook 'change-major-mode-hook | ||
| 256 | '(lambda () (outline-minor-mode -1)) | ||
| 257 | nil t) | ||
| 254 | (make-local-variable 'line-move-ignore-invisible) | 258 | (make-local-variable 'line-move-ignore-invisible) |
| 255 | (setq line-move-ignore-invisible t) | 259 | (setq line-move-ignore-invisible t) |
| 256 | ;; Cause use of ellipses for invisible text. | 260 | ;; Cause use of ellipses for invisible text. |
| @@ -308,13 +312,14 @@ Only visible heading lines are considered." | |||
| 308 | (beginning-of-line) | 312 | (beginning-of-line) |
| 309 | (or (outline-on-heading-p) | 313 | (or (outline-on-heading-p) |
| 310 | (let (found) | 314 | (let (found) |
| 311 | (while (not found) | 315 | (save-excursion |
| 312 | (setq found | 316 | (while (not found) |
| 313 | (and (re-search-backward (concat "^\\(" outline-regexp "\\)") | 317 | (or (re-search-backward (concat "^\\(" outline-regexp "\\)") |
| 314 | nil t) | 318 | nil t) |
| 315 | (outline-visible)))) | 319 | (error "before first heading")) |
| 316 | found) | 320 | (setq found (and (outline-visible) (point))))) |
| 317 | (error "before first heading"))) | 321 | (goto-char found) |
| 322 | found))) | ||
| 318 | 323 | ||
| 319 | (defun outline-on-heading-p () | 324 | (defun outline-on-heading-p () |
| 320 | "Return t if point is on a (visible) heading line." | 325 | "Return t if point is on a (visible) heading line." |