308 |
Normally causes exited folds to be hidden, but with ARG < 0, -ARG folds are |
Normally causes exited folds to be hidden, but with ARG < 0, -ARG folds are |
309 |
exited and text is left visible." |
exited and text is left visible." |
310 |
(interactive "p") |
(interactive "p") |
311 |
(let (start-marker end-marker (hide-fold t)) |
(let ((hide-fold t) start-marker end-marker |
312 |
|
beginning-of-heading end-of-subtree) |
313 |
|
|
314 |
;; check there are some folds to leave |
;; check there are some folds to leave |
315 |
(if (null foldout-fold-list) |
(if (null foldout-fold-list) |
356 |
;; is \n otherwise it will be hidden. If there is a newline |
;; is \n otherwise it will be hidden. If there is a newline |
357 |
;; before this one, make it visible too so we do the same as |
;; before this one, make it visible too so we do the same as |
358 |
;; outline.el and leave a blank line before the heading. |
;; outline.el and leave a blank line before the heading. |
359 |
(if (zerop num-folds) |
(when (zerop num-folds) |
360 |
(let ((beginning-of-heading (point)) |
(if end-marker |
361 |
(end-of-subtree (if end-marker |
(setq beginning-of-heading (point) |
362 |
(progn |
end-of-subtree (progn (forward-char -1) |
363 |
(forward-char -1) |
(if (memq (preceding-char) |
364 |
(if (memq (preceding-char) |
'(?\n ?\^M)) |
365 |
'(?\n ?\^M)) |
(forward-char -1)) |
366 |
(forward-char -1)) |
(point)))) |
367 |
(point)) |
;; hide the subtree |
368 |
(point-max)))) |
(when hide-fold |
369 |
;; hide the subtree |
(goto-char start-marker) |
370 |
(if hide-fold |
(hide-subtree)) |
371 |
(outline-flag-region start-marker end-of-subtree |
|
372 |
foldout-hide-flag)) |
;; make sure the next heading is exposed |
373 |
|
(if end-marker |
374 |
;; make sure the next heading is exposed |
(outline-flag-region end-of-subtree beginning-of-heading |
375 |
(if end-marker |
foldout-show-flag))) |
|
(outline-flag-region end-of-subtree beginning-of-heading |
|
|
foldout-show-flag)) |
|
|
)) |
|
376 |
|
|
377 |
;; zap the markers so they don't slow down editing |
;; zap the markers so they don't slow down editing |
378 |
(set-marker start-marker nil) |
(set-marker start-marker nil) |