aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/outline.el20
2 files changed, 15 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c26efc42ece..7bea73a2329 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
12007-02-19 Stefan Monnier <monnier@iro.umontreal.ca> 12007-02-19 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * outline.el (hide-sublevels): Keep empty last line, if available.
4
3 * buff-menu.el (list-buffers-noselect): Use explicit unicode code 5 * buff-menu.el (list-buffers-noselect): Use explicit unicode code
4 rather than the corresponding unicode char, to make the code 6 rather than the corresponding unicode char, to make the code
5 more readable. 7 more readable.
diff --git a/lisp/outline.el b/lisp/outline.el
index 20dfb2429ef..579997754f2 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -856,19 +856,25 @@ Show the heading too, if it is currently invisible."
856 (t 1)))) 856 (t 1))))
857 (if (< levels 1) 857 (if (< levels 1)
858 (error "Must keep at least one level of headers")) 858 (error "Must keep at least one level of headers"))
859 (let (outline-view-change-hook) 859 (save-excursion
860 (save-excursion 860 (let* (outline-view-change-hook
861 (goto-char (point-min)) 861 (beg (progn
862 ;; Skip the prelude, if any. 862 (goto-char (point-min))
863 (unless (outline-on-heading-p t) (outline-next-heading)) 863 ;; Skip the prelude, if any.
864 (unless (outline-on-heading-p t) (outline-next-heading))
865 (point)))
866 (end (progn
867 (goto-char (point-max))
868 ;; Keep empty last line, if available.
869 (if (bolp) (1- (point)) (point)))))
864 ;; First hide everything. 870 ;; First hide everything.
865 (outline-flag-region (point) (point-max) t) 871 (outline-flag-region beg end t)
866 ;; Then unhide the top level headers. 872 ;; Then unhide the top level headers.
867 (outline-map-region 873 (outline-map-region
868 (lambda () 874 (lambda ()
869 (if (<= (funcall outline-level) levels) 875 (if (<= (funcall outline-level) levels)
870 (outline-show-heading))) 876 (outline-show-heading)))
871 (point) (point-max)))) 877 beg end)))
872 (run-hooks 'outline-view-change-hook)) 878 (run-hooks 'outline-view-change-hook))
873 879
874(defun hide-other () 880(defun hide-other ()