Function: org-list-struct-assoc-end

org-list-struct-assoc-end is a byte-compiled function defined in org-list.el.gz.

Signature

(org-list-struct-assoc-end STRUCT END-LIST)

Documentation

Associate proper ending point to items in STRUCT.

END-LIST is a pseudo-alist where car is indentation and cdr is ending position.

This function modifies STRUCT.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-list.el.gz
(defun org-list-struct-assoc-end (struct end-list)
  "Associate proper ending point to items in STRUCT.

END-LIST is a pseudo-alist where car is indentation and cdr is
ending position.

This function modifies STRUCT."
  (let ((endings end-list))
    (mapc
     (lambda (elt)
       (let ((pos (car elt))
	     (ind (nth 1 elt)))
	 ;; Remove end candidates behind current item.
	 (while (or (<= (cdar endings) pos))
	   (pop endings))
	 ;; Add end position to item assoc.
	 (let ((old-end (nthcdr 6 elt))
	       (new-end (assoc-default ind endings '<=)))
	   (if old-end
	       (setcar old-end new-end)
	     (setcdr elt (append (cdr elt) (list new-end)))))))
     struct)))