comparison lisp/textmodes/outline.el @ 15518:d01e58c9e431

(outline-minor-mode): No longer permanent local.
author Richard M. Stallman <rms@gnu.org>
date Wed, 26 Jun 1996 18:03:44 +0000
parents 5affe3230dfb
children 9785672a3b84
comparison
equal deleted inserted replaced
15517:d9bb8f6b05a0 15518:d01e58c9e431
130 (define-key outline-mode-map [menu-bar] outline-mode-menu-bar-map)) 130 (define-key outline-mode-map [menu-bar] outline-mode-menu-bar-map))
131 131
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")))))
139 138
140 (defvar outline-font-lock-keywords 139 (defvar outline-font-lock-keywords
249 (setq outline-minor-mode 248 (setq outline-minor-mode
250 (if (null arg) (not outline-minor-mode) 249 (if (null arg) (not outline-minor-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.
257 (setq buffer-invisibility-spec '((t . t))) 261 (setq buffer-invisibility-spec '((t . t)))
258 (run-hooks 'outline-minor-mode-hook)) 262 (run-hooks 'outline-minor-mode-hook))
306 "Move to previous heading line, or beg of this line if it's a heading. 310 "Move to previous heading line, or beg of this line if it's a heading.
307 Only visible heading lines are considered." 311 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."
321 (save-excursion 326 (save-excursion
322 (beginning-of-line) 327 (beginning-of-line)