Variable: load-path-filter-function

load-path-filter-function is a variable defined in lread.c.

Value

nil

Documentation

If non-nil, a function to filter load-path for load.

If this variable is a function, it is called when load is about to search for a file along load-path. This function is called with three arguments: the current value of load-path (a list of directories), the FILE argument to load, and the current list of load-suffixes.

It should return a (hopefully shorter) list of directories, which load will use instead of load-path to look for the file to load.

View in manual

Probably introduced at or before Emacs version 31.1.

Source Code

// Defined in /usr/src/emacs/src/lread.c
  DEFVAR_LISP ("load-path-filter-function",
	       Vload_path_filter_function,
	       doc: /* If non-nil, a function to filter `load-path' for `load'.

If this variable is a function, it is called when `load' is about to
search for a file along `load-path'.  This function is called with three
arguments: the current value of `load-path' (a list of directories),
the FILE argument to `load', and the current list of load-suffixes.

It should return a (hopefully shorter) list of directories, which `load'
will use instead of `load-path' to look for the file to load.  */);