Function: hl-todo-previous

hl-todo-previous is an interactive and natively compiled function defined in hl-todo.el.

Signature

(hl-todo-previous ARG)

Documentation

Jump to the previous TODO or similar keyword.

The prefix argument ARG specifies how many keywords to move. A negative argument means move forward that many keywords.

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/b97f5zr6snxdbh1bgqmj50mq949vd13i-emacs-packages-deps/share/emacs/site-lisp/elpa/hl-todo-20261001.1547/hl-todo.el
;;;###autoload
(defun hl-todo-previous (arg)
  "Jump to the previous TODO or similar keyword.
The prefix argument ARG specifies how many keywords to move.
A negative argument means move forward that many keywords."
  (interactive "p")
  (if (< arg 0)
      (hl-todo-next (- arg))
    (while (and (> arg 0)
                (not (bobp))
                (let ((start (point)))
                  (hl-todo--search (concat (hl-todo--regexp) "\\=") nil t)
                  (or (hl-todo--search nil nil t)
                      (progn (goto-char start)
                             (if hl-todo-wrap-movement
                                 nil
                               (user-error "No more matches"))))))
      (goto-char (match-end 0))
      (decf arg))
    (when (> arg 0)
      (let ((pos (save-excursion
                   (goto-char (point-max))
                   (let ((hl-todo-wrap-movement nil))
                     (hl-todo-previous arg))
                   (point))))
        (goto-char pos)))))