Function: clojure--goto-form

clojure--goto-form is a byte-compiled function defined in clojure-mode.el.

Signature

(clojure--goto-form NAME)

Documentation

Find the first surrounding form matching NAME or NAME-not.

NAME is a string like "if" or "when".

Source Code

;; Defined in ~/.emacs.d/elpa/clojure-mode-20260325.811/clojure-mode.el
(defun clojure--goto-form (name)
  "Find the first surrounding form matching NAME or NAME-not.
NAME is a string like \"if\" or \"when\"."
  (when (clojure--in-string-p)
    (while (or (not (looking-at "("))
               (clojure--in-string-p))
      (backward-char)))
  (let ((regexp (concat "\\((" name " \\)\\|\\((" name "-not \\)")))
    (while (not (looking-at regexp))
      (condition-case nil
          (backward-up-list)
        (scan-error (user-error "No %s or %s-not found" name name))))))