Function: consult--preview-allowed-p

consult--preview-allowed-p is a byte-compiled function defined in consult.el.

Signature

(consult--preview-allowed-p FUN)

Documentation

Return non-nil if FUN is an allowed preview mode hook.

Source Code

;; Defined in ~/.emacs.d/elpa/consult-20260805.1130/consult.el
(defun consult--preview-allowed-p (fun)
  "Return non-nil if FUN is an allowed preview mode hook."
  (or (memq fun consult-preview-allowed-hooks)
      (when-let* (((symbolp fun))
                  (name (symbol-name fun))
                  ;; Global modes in Emacs 29 are activated via a
                  ;; `find-file-hook' ending with `-check-buffers'. This has been
                  ;; changed in Emacs 30. Now a `change-major-mode-hook' is used
                  ;; instead with the suffix `-check-buffers'.
                  (suffix (static-if (>= emacs-major-version 30)
                              "-enable-in-buffer"
                            "-check-buffers"))
                  ((string-suffix-p suffix name)))
        (memq (intern (string-remove-suffix suffix name))
              consult-preview-allowed-hooks))))