Mercurial > emacs
comparison lisp/textmodes/outline.el @ 49599:5ade352e8d1c
Trailing whitespace deleted.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Tue, 04 Feb 2003 13:30:45 +0000 |
parents | 2cbcb30abe6f |
children | d32039b77774 |
comparison
equal
deleted
inserted
replaced
49598:0d8b17d428b5 | 49599:5ade352e8d1c |
---|---|
137 ;; Add a separator between each | 137 ;; Add a separator between each |
138 ;; part of the unified menu. | 138 ;; part of the unified menu. |
139 (cons '(--- "---") (cdr x)))) | 139 (cons '(--- "---") (cdr x)))) |
140 outline-mode-menu-bar-map)))))) | 140 outline-mode-menu-bar-map)))))) |
141 map)) | 141 map)) |
142 | 142 |
143 | 143 |
144 (defvar outline-mode-map | 144 (defvar outline-mode-map |
145 (let ((map (make-sparse-keymap))) | 145 (let ((map (make-sparse-keymap))) |
146 (define-key map "\C-c" outline-mode-prefix-map) | 146 (define-key map "\C-c" outline-mode-prefix-map) |
147 (define-key map [menu-bar] outline-mode-menu-bar-map) | 147 (define-key map [menu-bar] outline-mode-menu-bar-map) |
399 (up-head (or (car (rassoc (1- level) outline-heading-alist)) | 399 (up-head (or (car (rassoc (1- level) outline-heading-alist)) |
400 (save-excursion | 400 (save-excursion |
401 (save-match-data | 401 (save-match-data |
402 (outline-up-heading 1 t) | 402 (outline-up-heading 1 t) |
403 (match-string 0)))))) | 403 (match-string 0)))))) |
404 | 404 |
405 (unless (rassoc level outline-heading-alist) | 405 (unless (rassoc level outline-heading-alist) |
406 (push (cons head level) outline-heading-alist)) | 406 (push (cons head level) outline-heading-alist)) |
407 | 407 |
408 (replace-match up-head nil t) | 408 (replace-match up-head nil t) |
409 (when children | 409 (when children |
444 ;; Didn't work: keep it as is so it's still a heading. | 444 ;; Didn't work: keep it as is so it's still a heading. |
445 head)))))) | 445 head)))))) |
446 | 446 |
447 (unless (rassoc level outline-heading-alist) | 447 (unless (rassoc level outline-heading-alist) |
448 (push (cons head level) outline-heading-alist)) | 448 (push (cons head level) outline-heading-alist)) |
449 | 449 |
450 (replace-match down-head nil t) | 450 (replace-match down-head nil t) |
451 (when children | 451 (when children |
452 (outline-map-tree 'outline-demote level)))) | 452 (outline-map-tree 'outline-demote level)))) |
453 | 453 |
454 (defun outline-map-tree (fun level) | 454 (defun outline-map-tree (fun level) |
531 (if hidep | 531 (if hidep |
532 ;; When hiding the area again, we could just clean it up and let | 532 ;; When hiding the area again, we could just clean it up and let |
533 ;; reveal do the rest, by simply doing: | 533 ;; reveal do the rest, by simply doing: |
534 ;; (remove-overlays (overlay-start o) (overlay-end o) | 534 ;; (remove-overlays (overlay-start o) (overlay-end o) |
535 ;; 'invisible 'outline) | 535 ;; 'invisible 'outline) |
536 ;; | 536 ;; |
537 ;; That works fine as long as everything is in sync, but if the | 537 ;; That works fine as long as everything is in sync, but if the |
538 ;; structure of the document is changed while revealing parts of it, | 538 ;; structure of the document is changed while revealing parts of it, |
539 ;; the resulting behavior can be ugly. I.e. we need to make | 539 ;; the resulting behavior can be ugly. I.e. we need to make |
540 ;; sure that we hide exactly a subtree. | 540 ;; sure that we hide exactly a subtree. |
541 (progn | 541 (progn |