summaryrefslogtreecommitdiff
path: root/lisp/textmodes/outline.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-06-26 18:03:44 +0000
committerRichard M. Stallman <rms@gnu.org>1996-06-26 18:03:44 +0000
commit135906888e893230ca456cd4c7e75f18a2659def (patch)
tree9550d44144af05710f94a4a3fe02cdb5c0bbe340 /lisp/textmodes/outline.el
parentbb8684a89f1253a15b9a29f21298dc6f68f568e5 (diff)
downloademacs-135906888e893230ca456cd4c7e75f18a2659def.tar.gz
(outline-minor-mode): No longer permanent local.
Diffstat (limited to 'lisp/textmodes/outline.el')
-rw-r--r--lisp/textmodes/outline.el21
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.")
(defvar outline-minor-mode nil
"Non-nil if using Outline mode as a minor mode of some other mode.")
(make-variable-buffer-local 'outline-minor-mode)
-(put 'outline-minor-mode 'permanent-local t)
(or (assq 'outline-minor-mode minor-mode-alist)
(setq minor-mode-alist (append minor-mode-alist
(list '(outline-minor-mode " Outl")))))
@@ -251,6 +250,11 @@ See the command `outline-mode' for more information on this mode."
(> (prefix-numeric-value arg) 0)))
(if outline-minor-mode
(progn
+ (make-local-hook 'change-major-mode-hook)
+ ;; Turn off this mode if we change major modes.
+ (add-hook 'change-major-mode-hook
+ '(lambda () (outline-minor-mode -1))
+ nil t)
(make-local-variable 'line-move-ignore-invisible)
(setq line-move-ignore-invisible t)
;; Cause use of ellipses for invisible text.
@@ -308,13 +312,14 @@ Only visible heading lines are considered."
(beginning-of-line)
(or (outline-on-heading-p)
(let (found)
- (while (not found)
- (setq found
- (and (re-search-backward (concat "^\\(" outline-regexp "\\)")
- nil t)
- (outline-visible))))
- found)
- (error "before first heading")))
+ (save-excursion
+ (while (not found)
+ (or (re-search-backward (concat "^\\(" outline-regexp "\\)")
+ nil t)
+ (error "before first heading"))
+ (setq found (and (outline-visible) (point)))))
+ (goto-char found)
+ found)))
(defun outline-on-heading-p ()
"Return t if point is on a (visible) heading line."