Function: cider-history-search-forward

cider-history-search-forward is an interactive and byte-compiled function defined in cider-history.el.

Signature

(cider-history-search-forward REGEXP &optional BACKWARDS)

Documentation

Move to the next command history entry matching REGEXP from point.

If optional arg BACKWARDS is non-nil, move to the previous matching entry.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260822.1520/cider-history.el
(defun cider-history-search-forward (regexp &optional backwards)
  "Move to the next command history entry matching REGEXP from point.
If optional arg BACKWARDS is non-nil, move to the previous matching
entry."
  (interactive
   (list (cider-history-read-regexp "Search forward" t)
         current-prefix-arg))
  (let ((orig (point)))
    (cider-history-forward (if backwards -1 1))
    (let ((over (cider-history-target-overlay-at (point) t)))
      (while (and over
                  (not (if backwards (bobp) (eobp)))
                  (not (string-match regexp
                                     (overlay-get over
                                                  'cider-history-target))))
        (cider-history-forward (if backwards -1 1))
        (setq over (cider-history-target-overlay-at (point) t)))
      (unless (and over
                   (string-match regexp
                                 (overlay-get over
                                              'cider-history-target)))
        (goto-char orig)
        (message "No more command history entries matching %s" regexp)))))