Function: ewoc-goto-prev

ewoc-goto-prev is a byte-compiled function defined in ewoc.el.gz.

Signature

(ewoc-goto-prev EWOC ARG)

Documentation

Move point to the ARGth previous element in EWOC.

Don't move if we are at the first element, or if EWOC is empty. Return the node we moved to.

View in manual

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/ewoc.el.gz
(defun ewoc-goto-prev (ewoc arg)
  "Move point to the ARGth previous element in EWOC.
Don't move if we are at the first element, or if EWOC is empty.
Return the node we moved to."
  (ewoc--set-buffer-bind-dll-let* ewoc
      ((node (ewoc-locate ewoc (point))))
    (when node
      ;; If we were past the last element, first jump to it.
      (when (>= (point) (ewoc--node-start-marker (ewoc--node-right node)))
	(setq arg (1- arg)))
      (while (and node (> arg 0))
	(setq arg (1- arg))
	(setq node (ewoc--node-prev dll node)))
      ;; Never step above the first element.
      (unless (ewoc--filter-hf-nodes ewoc node)
	(setq node (ewoc--node-nth dll 1)))
      (ewoc-goto-node ewoc node))))