Function: glc-adjust-list

glc-adjust-list is a byte-compiled function defined in goto-chg.el.

Signature

(glc-adjust-list R)

Documentation

R is list of edit entries in chronological order.

Pick the point of the first edit entry and update that point with the second, third, etc, edit entries. Return the final updated point, or nil if the point was closer than glc-current-span to some edit in R.

R is basically a reversed slice from the buffer-undo-list.

Source Code

;; Defined in ~/.emacs.d/elpa/goto-chg-20240407.1110/goto-chg.el
;; If recursive in stead of iterative (while), it tends to fill the call stack.
;; (Isn't it tail optimized?)
(defun glc-adjust-list (r)
  "R is list of edit entries in chronological order.
Pick the point of the first edit entry and update that point with
the second, third, etc, edit entries. Return the final updated point,
or nil if the point was closer than `glc-current-span' to some edit in R.
\nR is basically a reversed slice from the buffer-undo-list."
  (if r
      ;; Get pos
      (let ((pos (glc-get-pos (car r))))
        (setq r (cdr r))
        ;; Walk back in reverse list
        (while (and r pos)
          (setq pos (glc-adjust-pos pos (car r))
                r (cdr r)))
        pos)
    ;; else
    nil))