Function: org-list-struct-fix-ind

org-list-struct-fix-ind is a byte-compiled function defined in org-list.el.gz.

Signature

(org-list-struct-fix-ind STRUCT PARENTS &optional BULLET-SIZE)

Documentation

Verify and correct indentation in STRUCT.

PARENTS is the alist of parents, as returned by org-list-parents-alist.

If numeric optional argument BULLET-SIZE is set, assume all bullets in list have this length to determine new indentation.

This function modifies STRUCT.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-list.el.gz
(defun org-list-struct-fix-ind (struct parents &optional bullet-size)
  "Verify and correct indentation in STRUCT.

PARENTS is the alist of parents, as returned by
`org-list-parents-alist'.

If numeric optional argument BULLET-SIZE is set, assume all
bullets in list have this length to determine new indentation.

This function modifies STRUCT."
  (let* ((ancestor (org-list-get-top-point struct))
         (top-ind (org-list-get-ind ancestor struct))
         (new-ind
          (lambda (item)
            (let ((parent (org-list-get-parent item struct parents)))
              (if parent
                  ;; Indent like parent + length of parent's bullet +
		  ;; sub-list offset.
                  (org-list-set-ind
		   item struct (+ (or bullet-size
				      (length
				       (org-list-get-bullet parent struct)))
				  (org-list-get-ind parent struct)
				  org-list-indent-offset))
                ;; If no parent, indent like top-point.
		(org-list-set-ind item struct top-ind))))))
    (mapc new-ind (mapcar #'car (cdr struct)))))