+2006-10-01 Stephen Berman <Stephen.Berman@gmx.net>
+
+ * allout.el (allout-expose-topic): Rectify implementation of "+"
+ spec, so that bodies are not exposed with headlines.
+
+2006-10-01 Ken Manheimer <ken.manheimer@gmail.com>
+
+ * allout.el (allout-current-depth): Do aberrent check only at or
+ below doublecheck depth.
+ (allout-chart-subtree): Make it explicit that LEVELS being nil
+ means unlimited depth. Drop undocumented support for LEVELS value
+ t meaning unlimited depth. (This is consistent with
+ allout-chart-to-reveal, but contrary to allout-show-children,
+ which needs to use nil to default to depth of 1.)
+ (allout-goto-prefix-doublechecked): Wrap long docstring line.
+ (allout-chart-to-reveal): Be explicit in docstring about meaning
+ of nil LEVELS, and drop support for LEVELS value t.
+ (allout-show-children): Translate the level spec used by this
+ routine to that used by allout-chart-subtree and
+ allout-chart-to-reveal.
+ (allout-show-to-offshoot): Retry once when stuck, after opening
+ subtree - improvements in discontinuity handling likely will
+ enable progress.
+
2006-09-30 Chong Yidong <cyd@stupidchicken.com>
* wid-edit.el (widget-button-click-moves-point): New variable.
(save-excursion
(allout-beginning-of-current-line)
(and (looking-at allout-regexp)
- (not (allout-aberrant-container-p))
- (allout-prefix-data))))
+ (allout-prefix-data)
+ (or (> allout-recent-depth allout-doublecheck-at-and-shallower)
+ (not (allout-aberrant-container-p))))))
;;;_ > allout-on-heading-p ()
(defalias 'allout-on-heading-p 'allout-on-current-heading-p)
;;;_ > allout-e-o-prefix-p ()
(save-excursion
(cond ((and depth (<= depth 0) 0))
- ((or (not depth) (= depth (allout-depth)))
+ ((or (null depth) (= depth (allout-depth)))
(let ((index 1))
(while (allout-previous-sibling allout-recent-depth nil)
(setq index (1+ index)))
(defun allout-chart-subtree (&optional levels visible orig-depth prev-depth)
"Produce a location \"chart\" of subtopics of the containing topic.
-Optional argument LEVELS specifies the depth \(relative to start
-depth) for the chart.
+Optional argument LEVELS specifies a depth limit \(relative to start
+depth) for the chart. Null LEVELS means no limit.
When optional argument VISIBLE is non-nil, the chart includes
only the visible subelements of the charted subjects.
-The remaining optional args are not for internal use by the function.
+The remaining optional args are for internal use by the function.
Point is left at the end of the subtree.
"Return a flat list of hidden points in subtree CHART, up to DEPTH.
+If DEPTH is nil, include hidden points at any depth.
+
Note that point can be left at any of the points on chart, or at the
start point."
(let (result here)
- (while (and (or (eq depth t) (> depth 0))
+ (while (and (or (null depth) (> depth 0))
chart)
(setq here (car chart))
(if (listp here)
- (let ((further (allout-chart-to-reveal here (or (eq depth t)
- (1- depth)))))
+ (let ((further (allout-chart-to-reveal here (if (null depth)
+ depth
+ (1- depth)))))
;; We're on the start of a subtree - recurse with it, if there's
;; more depth to go:
(if further (setq result (append further result)))
(defun allout-goto-prefix-doublechecked ()
"Put point at beginning of immediately containing outline topic.
-Like `allout-goto-prefix', but shallow topics \(according to `allout-doublecheck-at-and-shallower') are checked and disqualified for child containment discontinuity, according to `allout-aberrant-container-p'."
+Like `allout-goto-prefix', but shallow topics \(according to
+`allout-doublecheck-at-and-shallower') are checked and
+disqualified for child containment discontinuity, according to
+`allout-aberrant-container-p'."
(allout-goto-prefix)
(if (and (<= allout-recent-depth allout-doublecheck-at-and-shallower)
(allout-aberrant-container-p))
(allout-beginning-of-current-line)
(save-restriction
(let* (depth
- (chart (allout-chart-subtree (or level 1)))
- (to-reveal (or (allout-chart-to-reveal chart (or level 1))
+ ;; translate the level spec for this routine to the ones
+ ;; used by -chart-subtree and -chart-to-reveal:
+ (chart-level (cond ((not level) 1)
+ ((eq level t) nil)
+ (t level)))
+ (chart (allout-chart-subtree chart-level))
+ (to-reveal (or (allout-chart-to-reveal chart chart-level)
;; interactive, show discontinuous children:
(and chart
(interactive-p)
(orig-pt (point))
(orig-pref (allout-goto-prefix-doublechecked))
(last-at (point))
- bag-it)
- (while (or bag-it (allout-hidden-p))
+ (bag-it 0))
+ (while (or (> bag-it 1) (allout-hidden-p))
(while (allout-hidden-p)
(move-beginning-of-line 1)
(if (allout-hidden-p) (forward-char -1)))
(if (= last-at (setq last-at (point)))
- ;; Oops, we're not making any progress! Show the current
- ;; topic completely, and bag this try.
+ ;; Oops, we're not making any progress! Show the current topic
+ ;; completely, and try one more time here, if we haven't already.
(progn (beginning-of-line)
(allout-show-current-subtree)
(goto-char orig-pt)
- (setq bag-it t)
- (beep)
- (message "%s: %s"
- "allout-show-to-offshoot: "
- "Aberrant nesting encountered."))
+ (setq bag-it (1+ bag-it))
+ (if (> bag-it 1)
+ (error "allout-show-to-offshoot: %s"
+ "Stumped by aberrant nesting.")))
+ (if (> bag-it 0) (setq bag-it 0))
(allout-show-children)
(goto-char orig-pref)))
(goto-char orig-pt)))
(cond ((eq curr-elem '*) (allout-show-current-subtree)
(if (> allout-recent-end-of-subtree max-pos)
(setq max-pos allout-recent-end-of-subtree)))
- ((eq curr-elem '+) (allout-show-current-branches)
+ ((eq curr-elem '+)
+ (if (not (allout-hidden-p))
+ (save-excursion (allout-hide-current-subtree t)))
+ (allout-show-current-branches)
(if (> allout-recent-end-of-subtree max-pos)
(setq max-pos allout-recent-end-of-subtree)))
((eq curr-elem '-) (allout-show-current-entry))