# HG changeset patch # User Stefan Monnier # Date 1171910938 0 # Node ID 00669875e4feb692b9371b82aed4a7c590fbdf02 # Parent 70e00d4c121646ab1ce0f4883ffaeb1cbdc895d0 (hide-sublevels): Keep empty last line, if available. diff -r 70e00d4c1216 -r 00669875e4fe lisp/ChangeLog --- a/lisp/ChangeLog Mon Feb 19 15:46:25 2007 +0000 +++ b/lisp/ChangeLog Mon Feb 19 18:48:58 2007 +0000 @@ -1,5 +1,7 @@ 2007-02-19 Stefan Monnier + * outline.el (hide-sublevels): Keep empty last line, if available. + * buff-menu.el (list-buffers-noselect): Use explicit unicode code rather than the corresponding unicode char, to make the code more readable. diff -r 70e00d4c1216 -r 00669875e4fe lisp/outline.el --- a/lisp/outline.el Mon Feb 19 15:46:25 2007 +0000 +++ b/lisp/outline.el Mon Feb 19 18:48:58 2007 +0000 @@ -856,19 +856,25 @@ (t 1)))) (if (< levels 1) (error "Must keep at least one level of headers")) - (let (outline-view-change-hook) - (save-excursion - (goto-char (point-min)) - ;; Skip the prelude, if any. - (unless (outline-on-heading-p t) (outline-next-heading)) + (save-excursion + (let* (outline-view-change-hook + (beg (progn + (goto-char (point-min)) + ;; Skip the prelude, if any. + (unless (outline-on-heading-p t) (outline-next-heading)) + (point))) + (end (progn + (goto-char (point-max)) + ;; Keep empty last line, if available. + (if (bolp) (1- (point)) (point))))) ;; First hide everything. - (outline-flag-region (point) (point-max) t) + (outline-flag-region beg end t) ;; Then unhide the top level headers. (outline-map-region (lambda () (if (<= (funcall outline-level) levels) (outline-show-heading))) - (point) (point-max)))) + beg end))) (run-hooks 'outline-view-change-hook)) (defun hide-other ()