Function: allout-aberrant-container-p

allout-aberrant-container-p is a byte-compiled function defined in allout.el.gz.

Signature

(allout-aberrant-container-p)

Documentation

True if topic, or next sibling with children, contains them discontinuously.

Discontinuous means an immediate offspring that is nested more than one level deeper than the topic.

If topic has no offspring, then the next sibling with offspring will determine whether or not this one is determined to be aberrant.

If true, then the allout-recent-* settings are calibrated on the offspring that qualifies it as aberrant, ie with depth that exceeds the topic by more than one.

Source Code

;; Defined in /usr/src/emacs/lisp/allout.el.gz
;;;_     > allout-aberrant-container-p ()
(defun allout-aberrant-container-p ()
  "True if topic, or next sibling with children, contains them discontinuously.

Discontinuous means an immediate offspring that is nested more
than one level deeper than the topic.

If topic has no offspring, then the next sibling with offspring will
determine whether or not this one is determined to be aberrant.

If true, then the allout-recent-* settings are calibrated on the
offspring that qualifies it as aberrant, ie with depth that
exceeds the topic by more than one."

  ;; This is most clearly understood when considering standard-prefix-leader
  ;; low-level topics, which can all too easily match text not intended as
  ;; headers.  For example, any line with a leading '.' or '*' and lacking a
  ;; following bullet qualifies without this protection.  (A sequence of
  ;; them can occur naturally, eg a typical textual bullet list.)  We
  ;; disqualify such low-level sequences when they are followed by a
  ;; discontinuously contained child, inferring that the sequences are not
  ;; actually connected with their prospective context.

  (let ((depth (allout-depth))
        (start-point (point))
        done aberrant)
    (save-match-data
      (save-excursion
        (while (and (not done)
                    (re-search-forward allout-line-boundary-regexp nil 0))
          (allout-prefix-data)
          (goto-char allout-recent-prefix-beginning)
          (cond
           ;; sibling -- continue:
           ((eq allout-recent-depth depth))
           ;; first offspring is excessive -- aberrant:
           ((> allout-recent-depth (1+ depth))
            (setq done t aberrant t))
           ;; next non-sibling is lower-depth -- not aberrant:
           (t (setq done t))))))
    (if aberrant
        aberrant
      (goto-char start-point)
      ;; recalibrate allout-recent-*
      (allout-depth)
      nil)))