/[emacs]/emacs/lisp/foldout.el
ViewVC logotype

Diff of /emacs/lisp/foldout.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.15 by ttn, Sat Aug 6 22:13:42 2005 UTC revision 1.16 by cyd, Fri Dec 9 20:50:15 2005 UTC
# Line 308  optional arg EXPOSURE \(interactively wi Line 308  optional arg EXPOSURE \(interactively wi
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)
# Line 355  exited and text is left visible." Line 356  exited and text is left visible."
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)

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26