Function: evil-fold-action
evil-fold-action is a byte-compiled function defined in
evil-commands.el.
Signature
(evil-fold-action LIST ACTION)
Documentation
Perform fold ACTION for each matching major or minor mode in LIST.
ACTION will be performed for the first matching handler in LIST. For more
information on its features and format, see the documentation for
evil-fold-list.
If no matching ACTION is found in LIST, an error will signaled.
Handler errors will be demoted, so a problem in one handler will (hopefully) not interfere with another.
Source Code
;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-commands.el
;;; Folding
(defun evil-fold-action (list action)
"Perform fold ACTION for each matching major or minor mode in LIST.
ACTION will be performed for the first matching handler in LIST. For more
information on its features and format, see the documentation for
`evil-fold-list'.
If no matching ACTION is found in LIST, an error will signaled.
Handler errors will be demoted, so a problem in one handler will (hopefully)
not interfere with another."
(if (null list)
(user-error
"Enable one of the following modes for folding to work: %s"
(mapconcat #'symbol-name (mapcar #'caar evil-fold-list) ", "))
(let* ((modes (caar list)))
(if (evil--mode-p modes)
(let* ((actions (cdar list))
(fn (plist-get actions action)))
(when fn
(with-demoted-errors "Error: %S" (funcall fn))))
(evil-fold-action (cdr list) action)))))