Similar to candidate generators, the list of known candidate mappings
is stored in the variable p-search-candidate-mappings
. Your p-search session may or may not have this list populated. You can press M to add a mapping.
p-search-add-mapping
) ¶Initiate the process of adding a candidate generator. You will first be prompted for a candidate mapping to add. The available mappings are retrieved from p-search-candidate-mappings
. Each mapping is defined to require certain document properties in order to function. For example, some mappings only work on operating system files and wouldn’t make sense to run on an info manual node. Only the mappings which have document’s that satisfy their requirements can be created.
After selecting the prior you want, you will the proceed to configure the mapping as you would candidate generators.
Mappings can be edited and killed simmilar to how candidate generators are, via e (p-search-edit-dwim
) and k (p-search-kill-entity-at-point
) respectively.
A mapping works simmilar to the map function in the functional programming paradigm. Each mapping has a function which takes in the candidate document (which is a set of key-value pairs), and returns one or more deriving documents, nil meaning nothing can be done, or :remove
, which explicitly removes a document. Every mapping can be created with the option -f (‘filter’). When on, a mapping that doesn’t do anything to a document will remove the document.