Function: consult--filter-find-file-hook

consult--filter-find-file-hook is a byte-compiled function defined in consult.el.

Signature

(consult--filter-find-file-hook ORIG &rest HOOKS)

Documentation

Filter find-file-hook by consult-preview-allowed-hooks.

This function is an advice for run-hooks. ORIG is the original function, HOOKS the arguments.

Source Code

;; Defined in ~/.emacs.d/elpa/consult-20260805.1130/consult.el
(defun consult--filter-find-file-hook (orig &rest hooks)
  "Filter `find-file-hook' by `consult-preview-allowed-hooks'.
This function is an advice for `run-hooks'.
ORIG is the original function, HOOKS the arguments."
  (if (memq 'find-file-hook hooks)
      (cl-letf* (((default-value 'find-file-hook)
                  (seq-filter #'consult--preview-allowed-p
                              (default-value 'find-file-hook)))
                 (find-file-hook (default-value 'find-file-hook)))
        (apply orig hooks))
    (apply orig hooks)))