Function: marginalia-cycle

marginalia-cycle is an autoloaded, interactive and byte-compiled function defined in marginalia.el.

Signature

(marginalia-cycle)

Documentation

Cycle between annotators in marginalia-annotators.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/marginalia-20260724.810/marginalia.el
;;;###autoload
(defun marginalia-cycle ()
  "Cycle between annotators in `marginalia-annotators'."
  ;; Only show `marginalia-cycle' in M-x in recursive minibuffers
  (declare (completion (lambda (&rest _) (> (minibuffer-depth) 1))))
  (interactive)
  (with-current-buffer (window-buffer
                        (or (active-minibuffer-window)
                            (user-error "Marginalia: No active minibuffer")))
    (let* ((md (marginalia--completion-metadata))
           (cat (or (completion-metadata-get md 'category)
                    (user-error "Marginalia: Unknown completion category")))
           (ann (or (assq cat marginalia-annotators)
                    (user-error "Marginalia: No annotators found for category `%s'" cat))))
      (setcdr ann (append (cddr ann) (list (cadr ann))))
      ;; When the builtin annotator is selected and no builtin function is
      ;; available, skip to the next annotator. Bypass the
      ;; `marginalia--completion-metadata-get' advice.
      (when (and (eq (cadr ann) 'builtin) (not (marginalia--builtin-annotator-p md)))
        (setcdr ann (append (cddr ann) (list (cadr ann)))))
      (marginalia--cache-reset)
      (message "Marginalia: Use annotator `%s' for category `%s'" (cadr ann) cat))))