Function: allout-renumber-to-depth

allout-renumber-to-depth is a byte-compiled function defined in allout.el.gz.

Signature

(allout-renumber-to-depth &optional DEPTH)

Documentation

Renumber siblings at current depth.

Affects superior topics if optional arg DEPTH is less than current depth.

Returns final depth.

Source Code

;; Defined in /usr/src/emacs/lisp/allout.el.gz
;;;_    > allout-renumber-to-depth (&optional depth)
(defun allout-renumber-to-depth (&optional depth)
  "Renumber siblings at current depth.

Affects superior topics if optional arg DEPTH is less than current depth.

Returns final depth."

  ;; Proceed by level, processing subsequent siblings on each,
  ;; ascending until we get shallower than the start depth:

  (let ((ascender (allout-depth))
	was-eobp)
    (while (and (not (eobp))
		(allout-depth)
                (>= allout-recent-depth depth)
                (>= ascender depth))
                                        ; Skip over all topics at
                                        ; lesser depths, which can not
                                        ; have been disturbed:
      (while (and (not (setq was-eobp (eobp)))
		  (> allout-recent-depth ascender))
        (allout-next-heading))
                                        ; Prime ascender for ascension:
      (setq ascender (1- allout-recent-depth))
      (if (>= allout-recent-depth depth)
          (allout-rebullet-heading nil	;;; instead
                                    nil	;;; depth
                                    nil	;;; number-control
                                    nil	;;; index
                                    t)) ;;; do-successors
      (if was-eobp (goto-char (point-max)))))
  allout-recent-depth)