Next: Overview of Helm Classes [Contents][Index]
Next: class helm-source, Previous: Top, Up: Top [Contents][Index]
Next: class helm-source-sync, Previous: Overview of Helm Classes, Up: Top [Contents][Index]
Main interface to define helm sources.
This class has following slots.
t
nil
Function called with no parameters when helm is started.
It is useful for collecting current state information which can be
used to create the list of candidates later.
Initialization of candidates-in-buffer
is done here
with helm-init-candidates-in-buffer
.
t
nil
The name of the source. A string which is also the heading which appears above the list of matches from the source. Must be unique.
t
’identity
An alist of (DISPLAY . FUNCTION) pairs, a variable name or a function. FUNCTION is called with one parameter: the selected candidate.
An action other than the default can be chosen from this list of actions for the currently selected candidate (by default with TAB). The DISPLAY string is shown in the completions buffer and the FUNCTION is invoked when an action is selected. The first action of the list is the default.
You should use helm-make-actions
to build this alist easily.
t
nil
It’s a function or a list of functions called with two arguments when the action list from the source is assembled. The first argument is the list of actions, the second is the current selection. If it is a list of functions, it calls each function sequentially.
The function should return a transformed action list.
This can be used to customize the list of actions based on the currently selected candidate.
t
nil
A local hook that run at end of initilization of this source.
i.e After the creation of helm-buffer
.
Should be a variable. Can be also an anonymous function or a list of functions directly added to slot, this is not recommended though.
t
nil
Allow helm collecting duplicates candidates.
t
nil
A local hook that run at beginning of initilization of this source.
i.e Before the creation of helm-buffer
.
Should be a variable (defined with defvar). Can be also an anonymous function or a list of functions directly added to slot, this is not recommended though.
t
nil
Override helm-candidate-number-limit
only for this source.
t
nil
It’s a function or a list of functions called with one argument when the completion list from the source is built. The argument is the list of candidates retrieved from the source. The function should return a transformed list of candidates which will be used for the actual completion. If it is a list of functions, it calls each function sequentially.
This can be used to transform or remove items from the list of candidates.
Note that candidates
is run already, so the given transformer
function should also be able to handle candidates with (DISPLAY
. REAL) format.
t
nil
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
nil
Function called with no parameters when helm buffer is closed. It is useful for killing unneeded candidates buffer.
Note that the function is executed BEFORE performing action.
t
nil
It’s a function called with one argument: the selected candidate. This function is intended for type convertion. In normal case, the selected candidate (string) is passed to action function. If coerce function is specified, it is called just before action function.
Example: converting string to symbol (coerce . intern)
t
nil
This slot have no more effect and is just kept for backward compatibility. Please don’t use it.
t
nil
Transform the selected candidate when passing it to action.
Function called with one parameter, the selected candidate.
Avoid recomputing all candidates with candidate-transformer or filtered-candidate-transformer to give a new value to REAL, instead the selected candidate is transformed only when passing it to action. This works (and make sense) only with plain string candidates, it will NOT work when candidate is a cons cell, in this case the real value of candidate will be used. Example:
(helm :sources (helm-build-sync-source “test” :candidates ’(a b c d e) :display-to-real (lambda (c) (concat c “:modified by d-t-r”))) :buffer “helm test”)
Note that this is NOT a transformer, so the display will not be modified by this function.
t
nil
A transformer function that treat candidates one by one.
It is called with one arg the candidate.
It is faster than filtered-candidate-transformer
or
candidate-transformer
, but should be used only in sources
that recompute constantly their candidates, e.g helm-source-find-files
.
Filtering happen early and candidates are treated
one by one instead of re-looping on the whole list.
If used with filtered-candidate-transformer
or candidate-transformer
these functions should treat the candidates transformed by the
filter-one-by-one
function in consequence.
t
nil
It has the same format as candidate-transformer
, except the
function is called with two parameters: the candidate list and
the source.
This transformer is run on the candidate list which is already
filtered by the current pattern. While candidate-transformer
is run only once, it is run every time the input pattern is
changed.
It can be used to transform the candidate list dynamically, for example, based on the current pattern.
In some cases it may also be more efficent to perform candidate
transformation here, instead of with candidate-transformer
even if this transformation is done every time the pattern is
changed. For example, if a candidate set is very large then
candidate-transformer
transforms every candidate while only
some of them will actually be displayed due to the limit
imposed by helm-candidate-number-limit
.
Note that candidates
and candidate-transformer
is run
already, so the given transformer function should also be able
to handle candidates with (DISPLAY . REAL) format.
t
nil
Enable helm-follow-mode
for this source only.
With a value of 1 enable, a value of -1 or nil disable the mode.
See helm-follow-mode
for more infos.
t
nil
helm-follow-mode
will execute persistent-action after this delay.
Otherwise value of helm-follow-input-idle-delay
is used if non–nil,
If none of these are found fallback to helm-input-idle-delay
.
t
nil
Enable fuzzy matching in this source.
This will overwrite settings in MATCH slot, and for
sources built with child class helm-source-in-buffer
the SEARCH slot.
This is an easy way of enabling fuzzy matching, but you can use the MATCH
or SEARCH slots yourself if you want something more elaborated, mixing
different type of match (See helm-source-buffers
class for example).
This attribute is not supported for asynchronous sources since they perform pattern matching themselves.
t
helm
The current source group, default to helm
when not specified.
t
nil
Source local header-line-format
.
It will be displayed in header-line
or in minibuffer
depending
of value of helm-echo-input-in-header-line
and helm-display-header-line
.
It accepts also variable/function name.
t
nil
A function returning the display string of the header. Its argument is the name of the source. This attribute is useful to add an additional information with the source name. It doesn’t modify the name of the source.
t
nil
Help message for this source.
If not present, helm-help-message
value will be used.
t
nil
Allow passing history variable to helm from source.
It should be a quoted symbol.
Passing the history variable here have no effect
so add it also in the helm
call with the :history keyword.
The main point of adding the variable here
is to make it available when resuming.
t
helm-map
Specific keymap for this source.
default value is helm-map
.
t
nil
Get candidates with their properties in helm-marked-candidates
.
Allow using the FORCE-DISPLAY-PART of helm-get-selection
in marked
candidates, use t or ’withprop to pass it to helm-get-selection
.
t
nil
List of functions called with one parameter: a candidate. The
function should return non-nil if the candidate matches the
current pattern (see variable helm-pattern
).
When using candidates-in-buffer
its default value is identity
and
don’t have to be changed, use the search
slot instead.
This attribute allows the source to override the default
pattern matching based on string-match
. It can be used, for
example, to implement a source for file names and do the
pattern matching on the basename of files, since it’s more
likely one is typing part of the basename when searching for a
file, instead of some string anywhere else in its path.
If the list contains more than one function then the list of matching candidates from the source is constructed by appending the results after invoking the first function on all the potential candidates, then the next function, and so on. The matching candidates supplied by the first function appear first in the list of results and then results from the other functions, respectively.
This attribute has no effect for asynchronous sources (see
attribute candidates
), and sources using match-dynamic
since they perform pattern matching themselves.
Note that FUZZY-MATCH slot will overhide value of this slot.
t
nil
Match the real value of candidates when non nil.
t
nil
Allow matching only one part of candidate. If source contain match-part attribute, match is computed only on part of candidate returned by the call of function provided by this attribute. The function should have one arg, candidate, and return only a specific part of candidate. On async sources, as matching is done by the backend, this have no effect apart for highlighting matches.
t
nil
Source local helm-mode-line-string
(included in
mode-line-format
). It accepts also variable/function name.
t
nil
Allow multiline candidates.
When non-nil candidates will be separated by helm-candidate-separator
.
You can customize the color of this separator with helm-separator
face.
Value of multiline can be an integer which specify the maximum size of the
multiline string to display, if multiline string is longer than this value
it will be truncated.
t
t
Use the multi-match algorithm when non-nil. I.e Allow specifying multiple patterns separated by spaces. When a pattern is prefixed by “!” the negation of this pattern is used, i.e match anything but this pattern. It is the standard way of matching in helm and is enabled by default. It can be used with fuzzy-matching enabled, but as soon helm detect a space, each pattern will match by regexp and will not be fuzzy.
t
nil
Same as completing-read
require-match arg.
Possible values are:
t
which prevent exiting with an empty helm-buffer i.e. no matches.
confirm
which ask for confirmation i.e. need to press a second
time RET.
nil
is the default and is doing nothing i.e. returns nil when
pressing RET with an empty helm-buffer.
ignore
allow exiting with
minibuffer contents as candidate value (in this case helm-buffer
is empty).
t
nil
Disable highlighting matches in this source.
This will disable generic highlighting of matches,
but some specialized highlighting can be done from elsewhere,
i.e from filtered-candidate-transformer
or filter-one-by-one
slots.
So use this to either disable completely highlighting in your source,
or to disable highlighting and use a specialized highlighting matches
function for this source.
Remember that this function should run AFTER all filter functions if those
filter functions are modifying face properties, though it is possible to
avoid this by using new add-face-text-property
in your filter functions.
t
nil
Don’t allow marking candidates when this attribute is present.
t
nil
It’s a function or a list of functions called with one argument
before computing matches. Its argument is helm-pattern
.
Functions should return transformed helm-pattern
.
It is useful to change interpretation of helm-pattern
.
t
nil
Can be a either a Function called with one parameter (the
selected candidate) or a cons cell where first element is this
same function and second element a symbol (e.g never-split)
that inform helm-execute-persistent-action
to not split his
window to execute this persistent action.
Example:
(defun foo-persistent-action (candidate) (do-something candidate))
:persistent-action ’(foo-persistent-action . never-split) ; Don’t split or :persistent-action ’foo-persistent-action ; Split
When specifying :persistent-action by slot directly, foo-persistent-action
will be executed without quitting helm when hitting C-j
.
Note that other persistent actions can be defined using other
bindings than C-j
by simply defining an interactive function bound
to a key in the keymap source.
The function should create a new attribute in source before calling
helm-execute-persistent-action
on this attribute.
Example:
(defun helm-ff-persistent-delete () “Delete current candidate without quitting.” (interactive) (with-helm-alive-p (helm-set-attr ’quick-delete ’(helm-ff-quick-delete . never-split)) (helm-execute-persistent-action ’quick-delete)))
This function is then bound in helm-find-files-map
.
t
nil
Similar from persistent action but it is a function that should return an object suitable for persistent action when called , i.e. a function or a cons cell. Example:
(defun foo-persistent-action (candidate) (cond (something ;; Don’t split helm-window. (cons (lambda (_ignore) (do-something candidate)) ’no-split)) ;; Split helm-window. (something-else (lambda (_ignore) (do-something-else candidate)))))
:persistent-action-if ’foo-persistent-action
Here when hitting C-j
one of the lambda’s will be executed
depending on something or something-else condition, splitting or not
splitting as needed.
See helm-find-files-persistent-action-if
definition as another example.
t
nil
A string to explain persistent-action of this source. It also
accepts a function or a variable name.
It will be displayed in header-line
or in minibuffer
depending
of value of helm-echo-input-in-header-line
and helm-display-header-line
.
t
nil
Recompute all candidates computed previously with other transformers.
Function called with one parameter, the selected candidate.
The real value of candidates will be shown in display and of course be used by action. Example:
(helm :sources (helm-build-sync-source “test” :candidates ’((“foo” . 1) (“bar” . 2) (“baz”. 3)) :real-to-display (lambda (c) (format “%s” (1+ c)))) :buffer “helm test”)
Mostly deprecated, kept only for backward compatibility.
t
’identity
A function or a list of functions to apply to current list
of candidates when redisplaying buffer with helm-redisplay-buffer
.
This is only interesting for modifying and redisplaying the whole list
of candidates in async sources.
It uses identity
by default for when async sources are mixed with
normal sources, in this case these normal sources are not modified and
redisplayed as they are.
t
0
If present matches from the source are shown only if the pattern is not empty. Optionally, it can have an integer parameter specifying the required length of input which is useful in case of sources with lots of candidates.
t
nil
Function called with no parameters at end of initialization
when helm-resume
is started.
If this function try to do something against helm-buffer
, (e.g updating,
searching etc…) probably you should run it in a timer to ensure
helm-buffer
is ready.
t
nil
Function called with no parameters at before “init” function
when helm-force-update
is called.
t
nil
Indicates the source assembles the candidate list dynamically, so it shouldn’t be cached within a single Helm invocation. It is only applicable to synchronous sources, because asynchronous sources are not cached.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-source-async, Previous: class helm-source, Up: Top [Contents][Index]
Use this class to make helm sources using a list of candidates.
This list should be given as a normal list, a variable handling a list
or a function returning a list.
Matching is done basically with string-match
against each candidate.
The following are some interesting slots of this class. Note that not all slots are shown here.
t
’(“ERROR: You must specify the candidates
slot, either with a list or a function”)
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
nil
Disable all helm matching functions when non nil.
The :candidates function in this case is in charge of fetching
candidates dynamically according to helm-pattern
.
Note that :volatile is automatically enabled when using this, so no
need to specify it.
t
nil
When specifying a match function within a source and
helm-multi-match is enabled, the result of all matching
functions will be concatened, which in some cases is not what
is wanted. When using match-strict
only this or these
functions will be used. You can specify those functions as a
list of functions or a single symbol function.
NOTE: This have the same effect as using :MULTIMATCH nil.
t
nil
Enable migemo.
When multimatch is disabled, you can give the symbol ’nomultimatch as value
to force not using generic migemo matching function.
In this case you have to provide your own migemo matching funtion
that kick in when helm-migemo-mode
is enabled.
Otherwise it will be available for this source once helm-migemo-mode
is enabled when non-nil.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-sync))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-source-in-buffer, Previous: class helm-source-sync, Up: Top [Contents][Index]
Use this class to define a helm source calling an external process.
The external process is called typically in a start-process
call to be
asynchronous.
Note that using multiples asynchronous sources is not fully working, expect weird behavior if you try this.
The :candidates slot is not allowed even if described because this class
inherit from helm-source
.
The following are some interesting slots of this class. Note that not all slots are shown here.
t
nil
This attribute is used to define a process as candidate.
The function called with no arguments must return a process
i.e. processp
, it use typically start-process
or make-process
,
see (info “(elisp) Asynchronous Processes”).
NOTE:
When building the source at runtime you can give directly a process
as value, otherwise wrap the process call into a function.
The process buffer should be nil, otherwise, if you use
helm-buffer
give to the process a sentinel.
t
nil
Use the multi-match algorithm when non-nil. I.e Allow specifying multiple patterns separated by spaces. When a pattern is prefixed by “!” the negation of this pattern is used, i.e match anything but this pattern. It is the standard way of matching in helm and is enabled by default. It can be used with fuzzy-matching enabled, but as soon helm detect a space, each pattern will match by regexp and will not be fuzzy.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-async))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-source-dummy, Previous: class helm-source-async, Up: Top [Contents][Index]
Use this source to make helm sources storing candidates inside a buffer.
The buffer storing candidates is generated by helm-candidate-buffer
function
and all search are done in this buffer, results are transfered to the helm-buffer
when done.
Contrarily to helm-source-sync
candidates are matched using a function
like re-search-forward
(see below documentation of :search
slot) which makes
the search much faster than matching candidates one by one.
If you want to add search functions to your sources, don’t use :match
which
will raise an error, but :search
.
See helm-candidates-in-buffer
for more infos.
The following are some interesting slots of this class. Note that not all slots are shown here.
t
’helm-default-init-source-in-buffer-function
Function called with no parameters when helm is started.
It is useful for collecting current state information which can be
used to create the list of candidates later.
Initialization of candidates-in-buffer
is done here
with helm-init-candidates-in-buffer
.
t
’helm-candidates-in-buffer
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
nil
A string, a list or a buffer that will be used to feed the helm-candidates-buffer
.
This data will be passed in a function added to the init slot and
the buffer will be build with helm-init-candidates-in-buffer
or directly
with helm-candidates-buffer
if data is a buffer.
This is an easy and fast method to build a candidates-in-buffer
source.
t
’buffer-substring-no-properties
A function like buffer-substring-no-properties
or buffer-substring
.
This function converts region from point at line-beginning and point
at line-end in the helm-candidate-buffer
to a string which will be displayed
in the helm-buffer
, it takes two args BEG and END.
By default, helm-candidates-in-buffer
uses
buffer-substring-no-properties
which does no conversion and doesn’t carry
text properties.
t
’(identity)
List of functions called with one parameter: a candidate. The
function should return non-nil if the candidate matches the
current pattern (see variable helm-pattern
).
When using candidates-in-buffer
its default value is identity
and
don’t have to be changed, use the search
slot instead.
This attribute allows the source to override the default
pattern matching based on string-match
. It can be used, for
example, to implement a source for file names and do the
pattern matching on the basename of files, since it’s more
likely one is typing part of the basename when searching for a
file, instead of some string anywhere else in its path.
If the list contains more than one function then the list of matching candidates from the source is constructed by appending the results after invoking the first function on all the potential candidates, then the next function, and so on. The matching candidates supplied by the first function appear first in the list of results and then results from the other functions, respectively.
This attribute has no effect for asynchronous sources (see
attribute candidates
), and sources using match-dynamic
since they perform pattern matching themselves.
Note that FUZZY-MATCH slot will overhide value of this slot.
t
nil
Enable migemo.
When multimatch is disabled, you can give the symbol ’nomultimatch as value
to force not using generic migemo matching function.
In this case you have to provide your own migemo matching funtion
that kick in when helm-migemo-mode
is enabled.
Otherwise it will be available for this source once helm-migemo-mode
is enabled when non-nil.
t
’(helm-candidates-in-buffer-search-default-fn)
List of functions like re-search-forward
or search-forward
.
Buffer search function used by helm-candidates-in-buffer
.
By default, helm-candidates-in-buffer
uses re-search-forward
.
The function should take one arg PATTERN.
If your search function needs to handle negation like multimatch,
this function should returns in such case a cons cell of two integers defining
the beg and end positions to match in the line previously matched by
re-search-forward
or similar, and move point to next line
(See how the helm-mm-3-search-base
and helm-fuzzy-search
functions are working).
NOTE: FUZZY-MATCH slot will overhide value of this slot.
t
nil
When specifying a search function within a source and
helm-multi-match is enabled, the result of all searching
functions will be concatened, which in some cases is not what
is wanted. When using search-strict
only this or these
functions will be used. You can specify those functions as a
list of functions or a single symbol function.
NOTE: This have the same effect as using a nil value for :MULTIMATCH slot.
t
t
Indicates the source assembles the candidate list dynamically, so it shouldn’t be cached within a single Helm invocation. It is only applicable to synchronous sources, because asynchronous sources are not cached.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-in-buffer))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-source-in-file, Previous: class helm-source-in-buffer, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
t
Allow exiting with an empty string. You should keep the default value.
t
’(“dummy”)
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
(lambda (_candidates _source) (list helm-pattern))
It has the same format as candidate-transformer
, except the
function is called with two parameters: the candidate list and
the source.
This transformer is run on the candidate list which is already
filtered by the current pattern. While candidate-transformer
is run only once, it is run every time the input pattern is
changed.
It can be used to transform the candidate list dynamically, for example, based on the current pattern.
In some cases it may also be more efficent to perform candidate
transformation here, instead of with candidate-transformer
even if this transformation is done every time the pattern is
changed. For example, if a candidate set is very large then
candidate-transformer
transforms every candidate while only
some of them will actually be displayed due to the limit
imposed by helm-candidate-number-limit
.
Note that candidates
and candidate-transformer
is run
already, so the given transformer function should also be able
to handle candidates with (DISPLAY . REAL) format.
t
’identity
List of functions called with one parameter: a candidate. The
function should return non-nil if the candidate matches the
current pattern (see variable helm-pattern
).
When using candidates-in-buffer
its default value is identity
and
don’t have to be changed, use the search
slot instead.
This attribute allows the source to override the default
pattern matching based on string-match
. It can be used, for
example, to implement a source for file names and do the
pattern matching on the basename of files, since it’s more
likely one is typing part of the basename when searching for a
file, instead of some string anywhere else in its path.
If the list contains more than one function then the list of matching candidates from the source is constructed by appending the results after invoking the first function on all the potential candidates, then the next function, and so on. The matching candidates supplied by the first function appear first in the list of results and then results from the other functions, respectively.
This attribute has no effect for asynchronous sources (see
attribute candidates
), and sources using match-dynamic
since they perform pattern matching themselves.
Note that FUZZY-MATCH slot will overhide value of this slot.
t
nil
Use the multi-match algorithm when non-nil. I.e Allow specifying multiple patterns separated by spaces. When a pattern is prefixed by “!” the negation of this pattern is used, i.e match anything but this pattern. It is the standard way of matching in helm and is enabled by default. It can be used with fuzzy-matching enabled, but as soon helm detect a space, each pattern will match by regexp and will not be fuzzy.
t
t
Indicates the source assembles the candidate list dynamically, so it shouldn’t be cached within a single Helm invocation. It is only applicable to synchronous sources, because asynchronous sources are not cached.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-dummy))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-type-file, Previous: class helm-source-dummy, Up: Top [Contents][Index]
The contents of the FILE will be used as candidates in buffer.
The following are some interesting slots of this class. Note that not all slots are shown here.
t
(lambda nil (let ((file (helm-get-attr ’candidates-file)) (count 1)) (with-current-buffer (helm-candidate-buffer ’global) (insert-file-contents file) (goto-char (point-min)) (while (not (eobp)) (add-text-properties (point-at-bol) (point-at-eol) ‘(helm-linum ,count)) (cl-incf count) (forward-line 1)))))
Function called with no parameters when helm is started.
It is useful for collecting current state information which can be
used to create the list of candidates later.
Initialization of candidates-in-buffer
is done here
with helm-init-candidates-in-buffer
.
t
nil
A filename. Each line number of FILE is accessible with helm-linum property from candidate display part.
t
#’buffer-substring
A function like buffer-substring-no-properties
or buffer-substring
.
This function converts region from point at line-beginning and point
at line-end in the helm-candidate-buffer
to a string which will be displayed
in the helm-buffer
, it takes two args BEG and END.
By default, helm-candidates-in-buffer
uses
buffer-substring-no-properties
which does no conversion and doesn’t carry
text properties.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-in-buffer))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-type-bookmark, Previous: class helm-source-in-file, Up: Top [Contents][Index]
A class to define helm type file.
The following are some interesting slots of this class. Note that not all slots are shown here.
helm-source-get-action-from-type
:
((object helm-type-file))
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((_source helm-type-file)) :before ((source helm-type-file))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-type-buffer, Previous: class helm-type-file, Up: Top [Contents][Index]
A class to define type bookmarks.
The following are some interesting slots of this class. Note that not all slots are shown here.
helm-source-get-action-from-type
:
((object helm-type-bookmark))
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((_source helm-type-bookmark)) :before ((source helm-type-bookmark))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-type-function, Previous: class helm-type-bookmark, Up: Top [Contents][Index]
A class to define type buffer.
The following are some interesting slots of this class. Note that not all slots are shown here.
helm-source-get-action-from-type
:
((object helm-type-buffer))
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((_source helm-type-buffer)) :before ((source helm-type-buffer))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-type-command, Previous: class helm-type-buffer, Up: Top [Contents][Index]
A class to define helm type function.
The following are some interesting slots of this class. Note that not all slots are shown here.
helm-source-get-action-from-type
:
((object helm-type-function))
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((_source helm-type-function)) :before ((source helm-type-function))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-type-timers, Previous: class helm-type-function, Up: Top [Contents][Index]
A class to define helm type command.
The following are some interesting slots of this class. Note that not all slots are shown here.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((_source helm-type-command)) :before ((source helm-type-command))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-files-dired-source, Previous: class helm-type-command, Up: Top [Contents][Index]
A class to define helm type timers.
The following are some interesting slots of this class. Note that not all slots are shown here.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((_source helm-type-timers)) :before ((source helm-type-timers))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-source-session-class, Previous: class helm-type-timers, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
#’helm-files-in-all-dired-candidates
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
nil
Disable all helm matching functions when non nil.
The :candidates function in this case is in charge of fetching
candidates dynamically according to helm-pattern
.
Note that :volatile is automatically enabled when using this, so no
need to specify it.
t
nil
When specifying a match function within a source and
helm-multi-match is enabled, the result of all matching
functions will be concatened, which in some cases is not what
is wanted. When using match-strict
only this or these
functions will be used. You can specify those functions as a
list of functions or a single symbol function.
NOTE: This have the same effect as using :MULTIMATCH nil.
t
nil
Enable migemo.
When multimatch is disabled, you can give the symbol ’nomultimatch as value
to force not using generic migemo matching function.
In this case you have to provide your own migemo matching funtion
that kick in when helm-migemo-mode
is enabled.
Otherwise it will be available for this source once helm-migemo-mode
is enabled when non-nil.
helm-source-get-action-from-type
:
((object helm-type-file))
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-sync)) ((_source helm-type-file)) :before ((source helm-type-file))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-mac-spotlight-source, Previous: class helm-files-dired-source, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
’helm-type-file-actions
An alist of (DISPLAY . FUNCTION) pairs, a variable name or a function. FUNCTION is called with one parameter: the selected candidate.
An action other than the default can be chosen from this list of actions for the currently selected candidate (by default with TAB). The DISPLAY string is shown in the completions buffer and the FUNCTION is invoked when an action is selected. The first action of the list is the default.
You should use helm-make-actions
to build this alist easily.
t
(lambda nil (cl-delete-if-not (lambda (f) (or (string-match helm-tramp-file-name-regexp f) (file-exists-p f))) (mapcar ’car session-file-alist)))
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
helm-generic-file-help-message
Help message for this source.
If not present, helm-help-message
value will be used.
t
helm-generic-files-map
Specific keymap for this source.
default value is helm-map
.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-sync))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-source-basic-bookmarks, Previous: class helm-source-session-class, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
(lambda nil (start-process “mdfind-process” nil “mdfind” helm-pattern))
This attribute is used to define a process as candidate.
The function called with no arguments must return a process
i.e. processp
, it use typically start-process
or make-process
,
see (info “(elisp) Asynchronous Processes”).
NOTE:
When building the source at runtime you can give directly a process
as value, otherwise wrap the process call into a function.
The process buffer should be nil, otherwise, if you use
helm-buffer
give to the process a sentinel.
t
nil
Use the multi-match algorithm when non-nil. I.e Allow specifying multiple patterns separated by spaces. When a pattern is prefixed by “!” the negation of this pattern is used, i.e match anything but this pattern. It is the standard way of matching in helm and is enabled by default. It can be used with fuzzy-matching enabled, but as soon helm detect a space, each pattern will match by regexp and will not be fuzzy.
t
3
If present matches from the source are shown only if the pattern is not empty. Optionally, it can have an integer parameter specifying the required length of input which is useful in case of sources with lots of candidates.
helm-source-get-action-from-type
:
((object helm-type-file))
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-async)) ((_source helm-type-file)) :before ((source helm-type-file))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-source-filtered-bookmarks, Previous: class helm-mac-spotlight-source, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
(lambda nil (bookmark-maybe-load-default-file) (helm-init-candidates-in-buffer ’global (bookmark-all-names)))
Function called with no parameters when helm is started.
It is useful for collecting current state information which can be
used to create the list of candidates later.
Initialization of candidates-in-buffer
is done here
with helm-init-candidates-in-buffer
.
t
’helm-candidates-in-buffer
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
nil
A string, a list or a buffer that will be used to feed the helm-candidates-buffer
.
This data will be passed in a function added to the init slot and
the buffer will be build with helm-init-candidates-in-buffer
or directly
with helm-candidates-buffer
if data is a buffer.
This is an easy and fast method to build a candidates-in-buffer
source.
t
’helm-bookmark-transformer
It has the same format as candidate-transformer
, except the
function is called with two parameters: the candidate list and
the source.
This transformer is run on the candidate list which is already
filtered by the current pattern. While candidate-transformer
is run only once, it is run every time the input pattern is
changed.
It can be used to transform the candidate list dynamically, for example, based on the current pattern.
In some cases it may also be more efficent to perform candidate
transformation here, instead of with candidate-transformer
even if this transformation is done every time the pattern is
changed. For example, if a candidate set is very large then
candidate-transformer
transforms every candidate while only
some of them will actually be displayed due to the limit
imposed by helm-candidate-number-limit
.
Note that candidates
and candidate-transformer
is run
already, so the given transformer function should also be able
to handle candidates with (DISPLAY . REAL) format.
t
’buffer-substring-no-properties
A function like buffer-substring-no-properties
or buffer-substring
.
This function converts region from point at line-beginning and point
at line-end in the helm-candidate-buffer
to a string which will be displayed
in the helm-buffer
, it takes two args BEG and END.
By default, helm-candidates-in-buffer
uses
buffer-substring-no-properties
which does no conversion and doesn’t carry
text properties.
t
’(identity)
List of functions called with one parameter: a candidate. The
function should return non-nil if the candidate matches the
current pattern (see variable helm-pattern
).
When using candidates-in-buffer
its default value is identity
and
don’t have to be changed, use the search
slot instead.
This attribute allows the source to override the default
pattern matching based on string-match
. It can be used, for
example, to implement a source for file names and do the
pattern matching on the basename of files, since it’s more
likely one is typing part of the basename when searching for a
file, instead of some string anywhere else in its path.
If the list contains more than one function then the list of matching candidates from the source is constructed by appending the results after invoking the first function on all the potential candidates, then the next function, and so on. The matching candidates supplied by the first function appear first in the list of results and then results from the other functions, respectively.
This attribute has no effect for asynchronous sources (see
attribute candidates
), and sources using match-dynamic
since they perform pattern matching themselves.
Note that FUZZY-MATCH slot will overhide value of this slot.
t
nil
Enable migemo.
When multimatch is disabled, you can give the symbol ’nomultimatch as value
to force not using generic migemo matching function.
In this case you have to provide your own migemo matching funtion
that kick in when helm-migemo-mode
is enabled.
Otherwise it will be available for this source once helm-migemo-mode
is enabled when non-nil.
t
’(helm-candidates-in-buffer-search-default-fn)
List of functions like re-search-forward
or search-forward
.
Buffer search function used by helm-candidates-in-buffer
.
By default, helm-candidates-in-buffer
uses re-search-forward
.
The function should take one arg PATTERN.
If your search function needs to handle negation like multimatch,
this function should returns in such case a cons cell of two integers defining
the beg and end positions to match in the line previously matched by
re-search-forward
or similar, and move point to next line
(See how the helm-mm-3-search-base
and helm-fuzzy-search
functions are working).
NOTE: FUZZY-MATCH slot will overhide value of this slot.
t
nil
When specifying a search function within a source and
helm-multi-match is enabled, the result of all searching
functions will be concatened, which in some cases is not what
is wanted. When using search-strict
only this or these
functions will be used. You can specify those functions as a
list of functions or a single symbol function.
NOTE: This have the same effect as using a nil value for :MULTIMATCH slot.
t
t
Indicates the source assembles the candidate list dynamically, so it shouldn’t be cached within a single Helm invocation. It is only applicable to synchronous sources, because asynchronous sources are not cached.
helm-source-get-action-from-type
:
((object helm-type-bookmark))
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-in-buffer)) ((_source helm-type-bookmark)) :before ((source helm-type-bookmark))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-bookmark-override-inheritor, Previous: class helm-source-basic-bookmarks, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
’helm-default-init-source-in-buffer-function
Function called with no parameters when helm is started.
It is useful for collecting current state information which can be
used to create the list of candidates later.
Initialization of candidates-in-buffer
is done here
with helm-init-candidates-in-buffer
.
t
’helm-candidates-in-buffer
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
nil
A string, a list or a buffer that will be used to feed the helm-candidates-buffer
.
This data will be passed in a function added to the init slot and
the buffer will be build with helm-init-candidates-in-buffer
or directly
with helm-candidates-buffer
if data is a buffer.
This is an easy and fast method to build a candidates-in-buffer
source.
t
’(helm-adaptive-sort helm-highlight-bookmark)
It has the same format as candidate-transformer
, except the
function is called with two parameters: the candidate list and
the source.
This transformer is run on the candidate list which is already
filtered by the current pattern. While candidate-transformer
is run only once, it is run every time the input pattern is
changed.
It can be used to transform the candidate list dynamically, for example, based on the current pattern.
In some cases it may also be more efficent to perform candidate
transformation here, instead of with candidate-transformer
even if this transformation is done every time the pattern is
changed. For example, if a candidate set is very large then
candidate-transformer
transforms every candidate while only
some of them will actually be displayed due to the limit
imposed by helm-candidate-number-limit
.
Note that candidates
and candidate-transformer
is run
already, so the given transformer function should also be able
to handle candidates with (DISPLAY . REAL) format.
t
’buffer-substring-no-properties
A function like buffer-substring-no-properties
or buffer-substring
.
This function converts region from point at line-beginning and point
at line-end in the helm-candidate-buffer
to a string which will be displayed
in the helm-buffer
, it takes two args BEG and END.
By default, helm-candidates-in-buffer
uses
buffer-substring-no-properties
which does no conversion and doesn’t carry
text properties.
t
’(identity)
List of functions called with one parameter: a candidate. The
function should return non-nil if the candidate matches the
current pattern (see variable helm-pattern
).
When using candidates-in-buffer
its default value is identity
and
don’t have to be changed, use the search
slot instead.
This attribute allows the source to override the default
pattern matching based on string-match
. It can be used, for
example, to implement a source for file names and do the
pattern matching on the basename of files, since it’s more
likely one is typing part of the basename when searching for a
file, instead of some string anywhere else in its path.
If the list contains more than one function then the list of matching candidates from the source is constructed by appending the results after invoking the first function on all the potential candidates, then the next function, and so on. The matching candidates supplied by the first function appear first in the list of results and then results from the other functions, respectively.
This attribute has no effect for asynchronous sources (see
attribute candidates
), and sources using match-dynamic
since they perform pattern matching themselves.
Note that FUZZY-MATCH slot will overhide value of this slot.
t
nil
Enable migemo.
When multimatch is disabled, you can give the symbol ’nomultimatch as value
to force not using generic migemo matching function.
In this case you have to provide your own migemo matching funtion
that kick in when helm-migemo-mode
is enabled.
Otherwise it will be available for this source once helm-migemo-mode
is enabled when non-nil.
t
’(helm-candidates-in-buffer-search-default-fn)
List of functions like re-search-forward
or search-forward
.
Buffer search function used by helm-candidates-in-buffer
.
By default, helm-candidates-in-buffer
uses re-search-forward
.
The function should take one arg PATTERN.
If your search function needs to handle negation like multimatch,
this function should returns in such case a cons cell of two integers defining
the beg and end positions to match in the line previously matched by
re-search-forward
or similar, and move point to next line
(See how the helm-mm-3-search-base
and helm-fuzzy-search
functions are working).
NOTE: FUZZY-MATCH slot will overhide value of this slot.
t
nil
When specifying a search function within a source and
helm-multi-match is enabled, the result of all searching
functions will be concatened, which in some cases is not what
is wanted. When using search-strict
only this or these
functions will be used. You can specify those functions as a
list of functions or a single symbol function.
NOTE: This have the same effect as using a nil value for :MULTIMATCH slot.
t
t
Indicates the source assembles the candidate list dynamically, so it shouldn’t be cached within a single Helm invocation. It is only applicable to synchronous sources, because asynchronous sources are not cached.
helm-source-get-action-from-type
:
((object helm-type-bookmark))
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-in-buffer)) ((_source helm-type-bookmark)) :before ((source helm-type-bookmark))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-bookmark-find-files-class, Previous: class helm-source-filtered-bookmarks, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-bookmark-override-inheritor))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-source-buffers, Previous: class helm-bookmark-override-inheritor, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
’helm-default-init-source-in-buffer-function
Function called with no parameters when helm is started.
It is useful for collecting current state information which can be
used to create the list of candidates later.
Initialization of candidates-in-buffer
is done here
with helm-init-candidates-in-buffer
.
t
’helm-candidates-in-buffer
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
nil
A string, a list or a buffer that will be used to feed the helm-candidates-buffer
.
This data will be passed in a function added to the init slot and
the buffer will be build with helm-init-candidates-in-buffer
or directly
with helm-candidates-buffer
if data is a buffer.
This is an easy and fast method to build a candidates-in-buffer
source.
t
’(helm-adaptive-sort helm-highlight-bookmark)
It has the same format as candidate-transformer
, except the
function is called with two parameters: the candidate list and
the source.
This transformer is run on the candidate list which is already
filtered by the current pattern. While candidate-transformer
is run only once, it is run every time the input pattern is
changed.
It can be used to transform the candidate list dynamically, for example, based on the current pattern.
In some cases it may also be more efficent to perform candidate
transformation here, instead of with candidate-transformer
even if this transformation is done every time the pattern is
changed. For example, if a candidate set is very large then
candidate-transformer
transforms every candidate while only
some of them will actually be displayed due to the limit
imposed by helm-candidate-number-limit
.
Note that candidates
and candidate-transformer
is run
already, so the given transformer function should also be able
to handle candidates with (DISPLAY . REAL) format.
t
’buffer-substring-no-properties
A function like buffer-substring-no-properties
or buffer-substring
.
This function converts region from point at line-beginning and point
at line-end in the helm-candidate-buffer
to a string which will be displayed
in the helm-buffer
, it takes two args BEG and END.
By default, helm-candidates-in-buffer
uses
buffer-substring-no-properties
which does no conversion and doesn’t carry
text properties.
t
’(identity)
List of functions called with one parameter: a candidate. The
function should return non-nil if the candidate matches the
current pattern (see variable helm-pattern
).
When using candidates-in-buffer
its default value is identity
and
don’t have to be changed, use the search
slot instead.
This attribute allows the source to override the default
pattern matching based on string-match
. It can be used, for
example, to implement a source for file names and do the
pattern matching on the basename of files, since it’s more
likely one is typing part of the basename when searching for a
file, instead of some string anywhere else in its path.
If the list contains more than one function then the list of matching candidates from the source is constructed by appending the results after invoking the first function on all the potential candidates, then the next function, and so on. The matching candidates supplied by the first function appear first in the list of results and then results from the other functions, respectively.
This attribute has no effect for asynchronous sources (see
attribute candidates
), and sources using match-dynamic
since they perform pattern matching themselves.
Note that FUZZY-MATCH slot will overhide value of this slot.
t
nil
Enable migemo.
When multimatch is disabled, you can give the symbol ’nomultimatch as value
to force not using generic migemo matching function.
In this case you have to provide your own migemo matching funtion
that kick in when helm-migemo-mode
is enabled.
Otherwise it will be available for this source once helm-migemo-mode
is enabled when non-nil.
t
’(helm-candidates-in-buffer-search-default-fn)
List of functions like re-search-forward
or search-forward
.
Buffer search function used by helm-candidates-in-buffer
.
By default, helm-candidates-in-buffer
uses re-search-forward
.
The function should take one arg PATTERN.
If your search function needs to handle negation like multimatch,
this function should returns in such case a cons cell of two integers defining
the beg and end positions to match in the line previously matched by
re-search-forward
or similar, and move point to next line
(See how the helm-mm-3-search-base
and helm-fuzzy-search
functions are working).
NOTE: FUZZY-MATCH slot will overhide value of this slot.
t
nil
When specifying a search function within a source and
helm-multi-match is enabled, the result of all searching
functions will be concatened, which in some cases is not what
is wanted. When using search-strict
only this or these
functions will be used. You can specify those functions as a
list of functions or a single symbol function.
NOTE: This have the same effect as using a nil value for :MULTIMATCH slot.
t
t
Indicates the source assembles the candidate list dynamically, so it shouldn’t be cached within a single Helm invocation. It is only applicable to synchronous sources, because asynchronous sources are not cached.
helm-source-get-action-from-type
:
((object helm-type-bookmark))
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-in-buffer)) ((_source helm-type-bookmark)) :before ((source helm-type-bookmark)) ((source helm-bookmark-override-inheritor))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-M-x-class, Previous: class helm-bookmark-find-files-class, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
’helm-buffers-list–init
Function called with no parameters when helm is started.
It is useful for collecting current state information which can be
used to create the list of candidates later.
Initialization of candidates-in-buffer
is done here
with helm-init-candidates-in-buffer
.
t
#’helm-buffer-list
A function with no arguments to create buffer list.
t
’(“ERROR: You must specify the candidates
slot, either with a list or a function”)
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
’helm-buffer-help-message
Help message for this source.
If not present, helm-help-message
value will be used.
t
helm-buffer-map
Specific keymap for this source.
default value is helm-map
.
t
’helm-buffers-match-function
List of functions called with one parameter: a candidate. The
function should return non-nil if the candidate matches the
current pattern (see variable helm-pattern
).
When using candidates-in-buffer
its default value is identity
and
don’t have to be changed, use the search
slot instead.
This attribute allows the source to override the default
pattern matching based on string-match
. It can be used, for
example, to implement a source for file names and do the
pattern matching on the basename of files, since it’s more
likely one is typing part of the basename when searching for a
file, instead of some string anywhere else in its path.
If the list contains more than one function then the list of matching candidates from the source is constructed by appending the results after invoking the first function on all the potential candidates, then the next function, and so on. The matching candidates supplied by the first function appear first in the list of results and then results from the other functions, respectively.
This attribute has no effect for asynchronous sources (see
attribute candidates
), and sources using match-dynamic
since they perform pattern matching themselves.
Note that FUZZY-MATCH slot will overhide value of this slot.
t
nil
Disable all helm matching functions when non nil.
The :candidates function in this case is in charge of fetching
candidates dynamically according to helm-pattern
.
Note that :volatile is automatically enabled when using this, so no
need to specify it.
t
nil
When specifying a match function within a source and
helm-multi-match is enabled, the result of all matching
functions will be concatened, which in some cases is not what
is wanted. When using match-strict
only this or these
functions will be used. You can specify those functions as a
list of functions or a single symbol function.
NOTE: This have the same effect as using :MULTIMATCH nil.
t
’nomultimatch
Enable migemo.
When multimatch is disabled, you can give the symbol ’nomultimatch as value
to force not using generic migemo matching function.
In this case you have to provide your own migemo matching funtion
that kick in when helm-migemo-mode
is enabled.
Otherwise it will be available for this source once helm-migemo-mode
is enabled when non-nil.
t
nil
Use the multi-match algorithm when non-nil. I.e Allow specifying multiple patterns separated by spaces. When a pattern is prefixed by “!” the negation of this pattern is used, i.e match anything but this pattern. It is the standard way of matching in helm and is enabled by default. It can be used with fuzzy-matching enabled, but as soon helm detect a space, each pattern will match by regexp and will not be fuzzy.
t
t
Disable highlighting matches in this source.
This will disable generic highlighting of matches,
but some specialized highlighting can be done from elsewhere,
i.e from filtered-candidate-transformer
or filter-one-by-one
slots.
So use this to either disable completely highlighting in your source,
or to disable highlighting and use a specialized highlighting matches
function for this source.
Remember that this function should run AFTER all filter functions if those
filter functions are modifying face properties, though it is possible to
avoid this by using new add-face-text-property
in your filter functions.
t
’helm-buffers-list-persistent-action
Can be a either a Function called with one parameter (the
selected candidate) or a cons cell where first element is this
same function and second element a symbol (e.g never-split)
that inform helm-execute-persistent-action
to not split his
window to execute this persistent action.
Example:
(defun foo-persistent-action (candidate) (do-something candidate))
:persistent-action ’(foo-persistent-action . never-split) ; Don’t split or :persistent-action ’foo-persistent-action ; Split
When specifying :persistent-action by slot directly, foo-persistent-action
will be executed without quitting helm when hitting C-j
.
Note that other persistent actions can be defined using other
bindings than C-j
by simply defining an interactive function bound
to a key in the keymap source.
The function should create a new attribute in source before calling
helm-execute-persistent-action
on this attribute.
Example:
(defun helm-ff-persistent-delete () “Delete current candidate without quitting.” (interactive) (with-helm-alive-p (helm-set-attr ’quick-delete ’(helm-ff-quick-delete . never-split)) (helm-execute-persistent-action ’quick-delete)))
This function is then bound in helm-find-files-map
.
t
(lambda nil (setq helm-buffers-in-project-p nil))
Function called with no parameters at end of initialization
when helm-resume
is started.
If this function try to do something against helm-buffer
, (e.g updating,
searching etc…) probably you should run it in a timer to ensure
helm-buffer
is ready.
t
t
Indicates the source assembles the candidate list dynamically, so it shouldn’t be cached within a single Helm invocation. It is only applicable to synchronous sources, because asynchronous sources are not cached.
helm-source-get-action-from-type
:
((object helm-type-buffer))
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-sync)) ((_source helm-type-buffer)) :before ((source helm-type-buffer))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-absolute-time-timers-class, Previous: class helm-source-buffers, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
’(“ERROR: You must specify the candidates
slot, either with a list or a function”)
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
’helm-M-x-transformer-no-sort
It has the same format as candidate-transformer
, except the
function is called with two parameters: the candidate list and
the source.
This transformer is run on the candidate list which is already
filtered by the current pattern. While candidate-transformer
is run only once, it is run every time the input pattern is
changed.
It can be used to transform the candidate list dynamically, for example, based on the current pattern.
In some cases it may also be more efficent to perform candidate
transformation here, instead of with candidate-transformer
even if this transformation is done every time the pattern is
changed. For example, if a candidate set is very large then
candidate-transformer
transforms every candidate while only
some of them will actually be displayed due to the limit
imposed by helm-candidate-number-limit
.
Note that candidates
and candidate-transformer
is run
already, so the given transformer function should also be able
to handle candidates with (DISPLAY . REAL) format.
t
’helm-M-x-help-message
Help message for this source.
If not present, helm-help-message
value will be used.
t
helm-M-x-map
Specific keymap for this source.
default value is helm-map
.
t
nil
Disable all helm matching functions when non nil.
The :candidates function in this case is in charge of fetching
candidates dynamically according to helm-pattern
.
Note that :volatile is automatically enabled when using this, so no
need to specify it.
t
nil
When specifying a match function within a source and
helm-multi-match is enabled, the result of all matching
functions will be concatened, which in some cases is not what
is wanted. When using match-strict
only this or these
functions will be used. You can specify those functions as a
list of functions or a single symbol function.
NOTE: This have the same effect as using :MULTIMATCH nil.
t
nil
Enable migemo.
When multimatch is disabled, you can give the symbol ’nomultimatch as value
to force not using generic migemo matching function.
In this case you have to provide your own migemo matching funtion
that kick in when helm-migemo-mode
is enabled.
Otherwise it will be available for this source once helm-migemo-mode
is enabled when non-nil.
t
t
Same as completing-read
require-match arg.
Possible values are:
t
which prevent exiting with an empty helm-buffer i.e. no matches.
confirm
which ask for confirmation i.e. need to press a second
time RET.
nil
is the default and is doing nothing i.e. returns nil when
pressing RET with an empty helm-buffer.
ignore
allow exiting with
minibuffer contents as candidate value (in this case helm-buffer
is empty).
t
t
Don’t allow marking candidates when this attribute is present.
t
“Describe this command”
A string to explain persistent-action of this source. It also
accepts a function or a variable name.
It will be displayed in header-line
or in minibuffer
depending
of value of helm-echo-input-in-header-line
and helm-display-header-line
.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-sync)) ((_source helm-type-command)) :before ((source helm-type-command))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-idle-time-timers-class, Previous: class helm-M-x-class, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
t
Allow helm collecting duplicates candidates.
t
(lambda (candidates) (cl-loop for timer in candidates collect (cons (helm-elisp–format-timer timer) timer)))
It’s a function or a list of functions called with one argument when the completion list from the source is built. The argument is the list of candidates retrieved from the source. The function should return a transformed list of candidates which will be used for the actual completion. If it is a list of functions, it calls each function sequentially.
This can be used to transform or remove items from the list of candidates.
Note that candidates
is run already, so the given transformer
function should also be able to handle candidates with (DISPLAY
. REAL) format.
t
timer-list
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
nil
Disable all helm matching functions when non nil.
The :candidates function in this case is in charge of fetching
candidates dynamically according to helm-pattern
.
Note that :volatile is automatically enabled when using this, so no
need to specify it.
t
nil
When specifying a match function within a source and
helm-multi-match is enabled, the result of all matching
functions will be concatened, which in some cases is not what
is wanted. When using match-strict
only this or these
functions will be used. You can specify those functions as a
list of functions or a single symbol function.
NOTE: This have the same effect as using :MULTIMATCH nil.
t
nil
Enable migemo.
When multimatch is disabled, you can give the symbol ’nomultimatch as value
to force not using generic migemo matching function.
In this case you have to provide your own migemo matching funtion
that kick in when helm-migemo-mode
is enabled.
Otherwise it will be available for this source once helm-migemo-mode
is enabled when non-nil.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-sync)) ((_source helm-type-timers)) :before ((source helm-type-timers))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-list-el-package-source, Previous: class helm-absolute-time-timers-class, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
t
Allow helm collecting duplicates candidates.
t
(lambda (candidates) (cl-loop for timer in candidates collect (cons (helm-elisp–format-timer timer) timer)))
It’s a function or a list of functions called with one argument when the completion list from the source is built. The argument is the list of candidates retrieved from the source. The function should return a transformed list of candidates which will be used for the actual completion. If it is a list of functions, it calls each function sequentially.
This can be used to transform or remove items from the list of candidates.
Note that candidates
is run already, so the given transformer
function should also be able to handle candidates with (DISPLAY
. REAL) format.
t
timer-idle-list
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
nil
Disable all helm matching functions when non nil.
The :candidates function in this case is in charge of fetching
candidates dynamically according to helm-pattern
.
Note that :volatile is automatically enabled when using this, so no
need to specify it.
t
nil
When specifying a match function within a source and
helm-multi-match is enabled, the result of all matching
functions will be concatened, which in some cases is not what
is wanted. When using match-strict
only this or these
functions will be used. You can specify those functions as a
list of functions or a single symbol function.
NOTE: This have the same effect as using :MULTIMATCH nil.
t
nil
Enable migemo.
When multimatch is disabled, you can give the symbol ’nomultimatch as value
to force not using generic migemo matching function.
In this case you have to provide your own migemo matching funtion
that kick in when helm-migemo-mode
is enabled.
Otherwise it will be available for this source once helm-migemo-mode
is enabled when non-nil.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-sync)) ((_source helm-type-timers)) :before ((source helm-type-timers))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-epa, Previous: class helm-idle-time-timers-class, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
’helm-el-package–init
Function called with no parameters when helm is started.
It is useful for collecting current state information which can be
used to create the list of candidates later.
Initialization of candidates-in-buffer
is done here
with helm-init-candidates-in-buffer
.
t
’((“Describe package” . helm-el-package-describe) (“Visit homepage” . helm-el-package-visit-homepage))
An alist of (DISPLAY . FUNCTION) pairs, a variable name or a function. FUNCTION is called with one parameter: the selected candidate.
An action other than the default can be chosen from this list of actions for the currently selected candidate (by default with TAB). The DISPLAY string is shown in the completions buffer and the FUNCTION is invoked when an action is selected. The first action of the list is the default.
You should use helm-make-actions
to build this alist easily.
t
’helm-el-package–action-transformer
It’s a function or a list of functions called with two arguments when the action list from the source is assembled. The first argument is the list of actions, the second is the current selection. If it is a list of functions, it calls each function sequentially.
The function should return a transformed action list.
This can be used to customize the list of actions based on the currently selected candidate.
t
9999
Override helm-candidate-number-limit
only for this source.
t
’helm-el-package–transformer
It has the same format as candidate-transformer
, except the
function is called with two parameters: the candidate list and
the source.
This transformer is run on the candidate list which is already
filtered by the current pattern. While candidate-transformer
is run only once, it is run every time the input pattern is
changed.
It can be used to transform the candidate list dynamically, for example, based on the current pattern.
In some cases it may also be more efficent to perform candidate
transformation here, instead of with candidate-transformer
even if this transformation is done every time the pattern is
changed. For example, if a candidate set is very large then
candidate-transformer
transforms every candidate while only
some of them will actually be displayed due to the limit
imposed by helm-candidate-number-limit
.
Note that candidates
and candidate-transformer
is run
already, so the given transformer function should also be able
to handle candidates with (DISPLAY . REAL) format.
t
’buffer-substring
A function like buffer-substring-no-properties
or buffer-substring
.
This function converts region from point at line-beginning and point
at line-end in the helm-candidate-buffer
to a string which will be displayed
in the helm-buffer
, it takes two args BEG and END.
By default, helm-candidates-in-buffer
uses
buffer-substring-no-properties
which does no conversion and doesn’t carry
text properties.
t
’helm-el-package
The current source group, default to helm
when not specified.
t
’helm-el-package-help-message
Help message for this source.
If not present, helm-help-message
value will be used.
t
helm-el-package-map
Specific keymap for this source.
default value is helm-map
.
t
’helm-el-package–update
Function called with no parameters at before “init” function
when helm-force-update
is called.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-in-buffer))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-esh-source, Previous: class helm-list-el-package-source, Up: Top [Contents][Index]
Allow building helm sources for GPG keys.
The following are some interesting slots of this class. Note that not all slots are shown here.
t
(lambda nil (require ’epg) (require ’epa))
Function called with no parameters when helm is started.
It is useful for collecting current state information which can be
used to create the list of candidates later.
Initialization of candidates-in-buffer
is done here
with helm-init-candidates-in-buffer
.
t
’helm-epa-get-key-list
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
helm-comp-read-map
Specific keymap for this source.
default value is helm-map
.
t
helm-comp-read-mode-line
Source local helm-mode-line-string
(included in
mode-line-format
). It accepts also variable/function name.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-sync))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-eshell-history-source, Previous: class helm-epa, Up: Top [Contents][Index]
Helm class to define source for Eshell completion.
The following are some interesting slots of this class. Note that not all slots are shown here.
t
(lambda nil (setq pcomplete-current-completions nil pcomplete-last-completion-raw nil) (remove-hook ’minibuffer-setup-hook ’eshell-mode))
Function called with no parameters when helm is started.
It is useful for collecting current state information which can be
used to create the list of candidates later.
Initialization of candidates-in-buffer
is done here
with helm-init-candidates-in-buffer
.
t
’helm-ec-insert
An alist of (DISPLAY . FUNCTION) pairs, a variable name or a function. FUNCTION is called with one parameter: the selected candidate.
An action other than the default can be chosen from this list of actions for the currently selected candidate (by default with TAB). The DISPLAY string is shown in the completions buffer and the FUNCTION is invoked when an action is selected. The first action of the list is the default.
You should use helm-make-actions
to build this alist easily.
t
’helm-esh-get-candidates
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
#’helm-esh-transformer
It has the same format as candidate-transformer
, except the
function is called with two parameters: the candidate list and
the source.
This transformer is run on the candidate list which is already
filtered by the current pattern. While candidate-transformer
is run only once, it is run every time the input pattern is
changed.
It can be used to transform the candidate list dynamically, for example, based on the current pattern.
In some cases it may also be more efficent to perform candidate
transformation here, instead of with candidate-transformer
even if this transformation is done every time the pattern is
changed. For example, if a candidate set is very large then
candidate-transformer
transforms every candidate while only
some of them will actually be displayed due to the limit
imposed by helm-candidate-number-limit
.
Note that candidates
and candidate-transformer
is run
already, so the given transformer function should also be able
to handle candidates with (DISPLAY . REAL) format.
t
t
Disable highlighting matches in this source.
This will disable generic highlighting of matches,
but some specialized highlighting can be done from elsewhere,
i.e from filtered-candidate-transformer
or filter-one-by-one
slots.
So use this to either disable completely highlighting in your source,
or to disable highlighting and use a specialized highlighting matches
function for this source.
Remember that this function should run AFTER all filter functions if those
filter functions are modifying face properties, though it is possible to
avoid this by using new add-face-text-property
in your filter functions.
t
’ignore
Can be a either a Function called with one parameter (the
selected candidate) or a cons cell where first element is this
same function and second element a symbol (e.g never-split)
that inform helm-execute-persistent-action
to not split his
window to execute this persistent action.
Example:
(defun foo-persistent-action (candidate) (do-something candidate))
:persistent-action ’(foo-persistent-action . never-split) ; Don’t split or :persistent-action ’foo-persistent-action ; Split
When specifying :persistent-action by slot directly, foo-persistent-action
will be executed without quitting helm when hitting C-j
.
Note that other persistent actions can be defined using other
bindings than C-j
by simply defining an interactive function bound
to a key in the keymap source.
The function should create a new attribute in source before calling
helm-execute-persistent-action
on this attribute.
Example:
(defun helm-ff-persistent-delete () “Delete current candidate without quitting.” (interactive) (with-helm-alive-p (helm-set-attr ’quick-delete ’(helm-ff-quick-delete . never-split)) (helm-execute-persistent-action ’quick-delete)))
This function is then bound in helm-find-files-map
.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-sync))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-fd-class, Previous: class helm-esh-source, Up: Top [Contents][Index]
Helm class to define source for Eshell history.
The following are some interesting slots of this class. Note that not all slots are shown here.
t
(lambda nil (remove-hook ’minibuffer-setup-hook ’eshell-mode))
Function called with no parameters when helm is started.
It is useful for collecting current state information which can be
used to create the list of candidates later.
Initialization of candidates-in-buffer
is done here
with helm-init-candidates-in-buffer
.
t
(lambda (candidate) (eshell-kill-input) (insert candidate))
An alist of (DISPLAY . FUNCTION) pairs, a variable name or a function. FUNCTION is called with one parameter: the selected candidate.
An action other than the default can be chosen from this list of actions for the currently selected candidate (by default with TAB). The DISPLAY string is shown in the completions buffer and the FUNCTION is invoked when an action is selected. The first action of the list is the default.
You should use helm-make-actions
to build this alist easily.
t
9999
Override helm-candidate-number-limit
only for this source.
t
(lambda nil (with-helm-current-buffer (cl-loop for c from 0 to (ring-length eshell-history-ring) for elm = (eshell-get-history c) unless (and (member elm lst) eshell-hist-ignoredups) collect elm into lst finally return lst)))
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
helm-eshell-history-map
Specific keymap for this source.
default value is helm-map
.
t
t
Allow multiline candidates.
When non-nil candidates will be separated by helm-candidate-separator
.
You can customize the color of this separator with helm-separator
face.
Value of multiline can be an integer which specify the maximum size of the
multiline string to display, if multiline string is longer than this value
it will be truncated.
t
t
Don’t allow marking candidates when this attribute is present.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-sync))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-source-ffiles, Previous: class helm-eshell-history-source, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
’helm-type-file-actions
An alist of (DISPLAY . FUNCTION) pairs, a variable name or a function. FUNCTION is called with one parameter: the selected candidate.
An action other than the default can be chosen from this list of actions for the currently selected candidate (by default with TAB). The DISPLAY string is shown in the completions buffer and the FUNCTION is invoked when an action is selected. The first action of the list is the default.
You should use helm-make-actions
to build this alist easily.
t
20000
Override helm-candidate-number-limit
only for this source.
t
’helm-fd-process
This attribute is used to define a process as candidate.
The function called with no arguments must return a process
i.e. processp
, it use typically start-process
or make-process
,
see (info “(elisp) Asynchronous Processes”).
NOTE:
When building the source at runtime you can give directly a process
as value, otherwise wrap the process call into a function.
The process buffer should be nil, otherwise, if you use
helm-buffer
give to the process a sentinel.
t
’helm-fd-fct
It has the same format as candidate-transformer
, except the
function is called with two parameters: the candidate list and
the source.
This transformer is run on the candidate list which is already
filtered by the current pattern. While candidate-transformer
is run only once, it is run every time the input pattern is
changed.
It can be used to transform the candidate list dynamically, for example, based on the current pattern.
In some cases it may also be more efficent to perform candidate
transformation here, instead of with candidate-transformer
even if this transformation is done every time the pattern is
changed. For example, if a candidate set is very large then
candidate-transformer
transforms every candidate while only
some of them will actually be displayed due to the limit
imposed by helm-candidate-number-limit
.
Note that candidates
and candidate-transformer
is run
already, so the given transformer function should also be able
to handle candidates with (DISPLAY . REAL) format.
t
’helm-fd-help-message
Help message for this source.
If not present, helm-help-message
value will be used.
t
helm-fd-map
Specific keymap for this source.
default value is helm-map
.
t
t
Disable highlighting matches in this source.
This will disable generic highlighting of matches,
but some specialized highlighting can be done from elsewhere,
i.e from filtered-candidate-transformer
or filter-one-by-one
slots.
So use this to either disable completely highlighting in your source,
or to disable highlighting and use a specialized highlighting matches
function for this source.
Remember that this function should run AFTER all filter functions if those
filter functions are modifying face properties, though it is possible to
avoid this by using new add-face-text-property
in your filter functions.
t
2
If present matches from the source are shown only if the pattern is not empty. Optionally, it can have an integer parameter specifying the required length of input which is useful in case of sources with lots of candidates.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-async))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-browse-project-override-inheritor, Previous: class helm-fd-class, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
(lambda nil (setq helm-ff-auto-update-flag helm-ff-auto-update-initial-value) (setq helm-ff–auto-update-state helm-ff-auto-update-flag) (helm-set-local-variable ’bookmark-make-record-function #’helm-ff-make-bookmark-record) (require ’helm-external))
Function called with no parameters when helm is started.
It is useful for collecting current state information which can be
used to create the list of candidates later.
Initialization of candidates-in-buffer
is done here
with helm-init-candidates-in-buffer
.
t
’helm-find-files-actions
An alist of (DISPLAY . FUNCTION) pairs, a variable name or a function. FUNCTION is called with one parameter: the selected candidate.
An action other than the default can be chosen from this list of actions for the currently selected candidate (by default with TAB). The DISPLAY string is shown in the completions buffer and the FUNCTION is invoked when an action is selected. The first action of the list is the default.
You should use helm-make-actions
to build this alist easily.
t
’helm-find-files-action-transformer
It’s a function or a list of functions called with two arguments when the action list from the source is assembled. The first argument is the list of actions, the second is the current selection. If it is a list of functions, it calls each function sequentially.
The function should return a transformed action list.
This can be used to customize the list of actions based on the currently selected candidate.
t
’helm-find-files-after-init-hook
A local hook that run at end of initilization of this source.
i.e After the creation of helm-buffer
.
Should be a variable. Can be also an anonymous function or a list of functions directly added to slot, this is not recommended though.
t
’helm-find-files-before-init-hook
A local hook that run at beginning of initilization of this source.
i.e Before the creation of helm-buffer
.
Should be a variable (defined with defvar). Can be also an anonymous function or a list of functions directly added to slot, this is not recommended though.
t
’helm-ff-candidate-number-limit
Override helm-candidate-number-limit
only for this source.
t
’helm-find-files-get-candidates
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
’helm-find-files-cleanup
Function called with no parameters when helm buffer is closed. It is useful for killing unneeded candidates buffer.
Note that the function is executed BEFORE performing action.
t
’(helm-ff-fct helm-ff-directories-only helm-ff-files-only helm-ff-sort-candidates)
It has the same format as candidate-transformer
, except the
function is called with two parameters: the candidate list and
the source.
This transformer is run on the candidate list which is already
filtered by the current pattern. While candidate-transformer
is run only once, it is run every time the input pattern is
changed.
It can be used to transform the candidate list dynamically, for example, based on the current pattern.
In some cases it may also be more efficent to perform candidate
transformation here, instead of with candidate-transformer
even if this transformation is done every time the pattern is
changed. For example, if a candidate set is very large then
candidate-transformer
transforms every candidate while only
some of them will actually be displayed due to the limit
imposed by helm-candidate-number-limit
.
Note that candidates
and candidate-transformer
is run
already, so the given transformer function should also be able
to handle candidates with (DISPLAY . REAL) format.
t
’helm-files
The current source group, default to helm
when not specified.
t
(lambda (name) (concat name (substitute-command-keys helm-find-files-doc-header)))
A function returning the display string of the header. Its argument is the name of the source. This attribute is useful to add an additional information with the source name. It doesn’t modify the name of the source.
t
’helm-ff-help-message
Help message for this source.
If not present, helm-help-message
value will be used.
t
helm-find-files-map
Specific keymap for this source.
default value is helm-map
.
t
t
Match the real value of candidates when non nil.
t
t
Enable migemo.
When multimatch is disabled, you can give the symbol ’nomultimatch as value
to force not using generic migemo matching function.
In this case you have to provide your own migemo matching funtion
that kick in when helm-migemo-mode
is enabled.
Otherwise it will be available for this source once helm-migemo-mode
is enabled when non-nil.
t
(list “File(s)” helm-mode-line-string)
Source local helm-mode-line-string
(included in
mode-line-format
). It accepts also variable/function name.
t
t
Disable highlighting matches in this source.
This will disable generic highlighting of matches,
but some specialized highlighting can be done from elsewhere,
i.e from filtered-candidate-transformer
or filter-one-by-one
slots.
So use this to either disable completely highlighting in your source,
or to disable highlighting and use a specialized highlighting matches
function for this source.
Remember that this function should run AFTER all filter functions if those
filter functions are modifying face properties, though it is possible to
avoid this by using new add-face-text-property
in your filter functions.
t
’helm-find-files-persistent-action-if
Similar from persistent action but it is a function that should return an object suitable for persistent action when called , i.e. a function or a cons cell. Example:
(defun foo-persistent-action (candidate) (cond (something ;; Don’t split helm-window. (cons (lambda (_ignore) (do-something candidate)) ’no-split)) ;; Split helm-window. (something-else (lambda (_ignore) (do-something-else candidate)))))
:persistent-action-if ’foo-persistent-action
Here when hitting C-j
one of the lambda’s will be executed
depending on something or something-else condition, splitting or not
splitting as needed.
See helm-find-files-persistent-action-if
definition as another example.
t
“Hit1 Expand Candidate, Hit2 or (C-u) Find file”
A string to explain persistent-action of this source. It also
accepts a function or a variable name.
It will be displayed in header-line
or in minibuffer
depending
of value of helm-echo-input-in-header-line
and helm-display-header-line
.
t
(lambda nil (remhash helm-ff-default-directory helm-ff–list-directory-cache))
Function called with no parameters at before “init” function
when helm-force-update
is called.
t
t
Indicates the source assembles the candidate list dynamically, so it shouldn’t be cached within a single Helm invocation. It is only applicable to synchronous sources, because asynchronous sources are not cached.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-sync))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-browse-project-source, Previous: class helm-source-ffiles, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
helm-source-get-action-from-type
:
((object helm-type-file))
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((_source helm-type-file)) :before ((source helm-type-file)) :after ((source helm-browse-project-override-inheritor))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-file-cache, Previous: class helm-browse-project-override-inheritor, Up: Top [Contents][Index]
Class to define a source in helm-browse-project
handling non
VC handled directories.
The following are some interesting slots of this class. Note that not all slots are shown here.
t
’helm-default-init-source-in-buffer-function
Function called with no parameters when helm is started.
It is useful for collecting current state information which can be
used to create the list of candidates later.
Initialization of candidates-in-buffer
is done here
with helm-init-candidates-in-buffer
.
t
’helm-candidates-in-buffer
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
nil
A string, a list or a buffer that will be used to feed the helm-candidates-buffer
.
This data will be passed in a function added to the init slot and
the buffer will be build with helm-init-candidates-in-buffer
or directly
with helm-candidates-buffer
if data is a buffer.
This is an easy and fast method to build a candidates-in-buffer
source.
t
(lambda (c) (if (with-helm-buffer helm-ff-transformer-show-only-basename) (cons (propertize (helm-basename c) ’face ’helm-ff-file) c) (propertize c ’face ’helm-ff-file)))
A transformer function that treat candidates one by one.
It is called with one arg the candidate.
It is faster than filtered-candidate-transformer
or
candidate-transformer
, but should be used only in sources
that recompute constantly their candidates, e.g helm-source-find-files
.
Filtering happen early and candidates are treated
one by one instead of re-looping on the whole list.
If used with filtered-candidate-transformer
or candidate-transformer
these functions should treat the candidates transformed by the
filter-one-by-one
function in consequence.
t
’buffer-substring-no-properties
A function like buffer-substring-no-properties
or buffer-substring
.
This function converts region from point at line-beginning and point
at line-end in the helm-candidate-buffer
to a string which will be displayed
in the helm-buffer
, it takes two args BEG and END.
By default, helm-candidates-in-buffer
uses
buffer-substring-no-properties
which does no conversion and doesn’t carry
text properties.
t
’(identity)
List of functions called with one parameter: a candidate. The
function should return non-nil if the candidate matches the
current pattern (see variable helm-pattern
).
When using candidates-in-buffer
its default value is identity
and
don’t have to be changed, use the search
slot instead.
This attribute allows the source to override the default
pattern matching based on string-match
. It can be used, for
example, to implement a source for file names and do the
pattern matching on the basename of files, since it’s more
likely one is typing part of the basename when searching for a
file, instead of some string anywhere else in its path.
If the list contains more than one function then the list of matching candidates from the source is constructed by appending the results after invoking the first function on all the potential candidates, then the next function, and so on. The matching candidates supplied by the first function appear first in the list of results and then results from the other functions, respectively.
This attribute has no effect for asynchronous sources (see
attribute candidates
), and sources using match-dynamic
since they perform pattern matching themselves.
Note that FUZZY-MATCH slot will overhide value of this slot.
t
(lambda (c) (if (with-helm-buffer helm-ff-transformer-show-only-basename) (helm-basename c) c))
Allow matching only one part of candidate. If source contain match-part attribute, match is computed only on part of candidate returned by the call of function provided by this attribute. The function should have one arg, candidate, and return only a specific part of candidate. On async sources, as matching is done by the backend, this have no effect apart for highlighting matches.
t
nil
Enable migemo.
When multimatch is disabled, you can give the symbol ’nomultimatch as value
to force not using generic migemo matching function.
In this case you have to provide your own migemo matching funtion
that kick in when helm-migemo-mode
is enabled.
Otherwise it will be available for this source once helm-migemo-mode
is enabled when non-nil.
t
nil
t
’(helm-candidates-in-buffer-search-default-fn)
List of functions like re-search-forward
or search-forward
.
Buffer search function used by helm-candidates-in-buffer
.
By default, helm-candidates-in-buffer
uses re-search-forward
.
The function should take one arg PATTERN.
If your search function needs to handle negation like multimatch,
this function should returns in such case a cons cell of two integers defining
the beg and end positions to match in the line previously matched by
re-search-forward
or similar, and move point to next line
(See how the helm-mm-3-search-base
and helm-fuzzy-search
functions are working).
NOTE: FUZZY-MATCH slot will overhide value of this slot.
t
nil
When specifying a search function within a source and
helm-multi-match is enabled, the result of all searching
functions will be concatened, which in some cases is not what
is wanted. When using search-strict
only this or these
functions will be used. You can specify those functions as a
list of functions or a single symbol function.
NOTE: This have the same effect as using a nil value for :MULTIMATCH slot.
t
t
Indicates the source assembles the candidate list dynamically, so it shouldn’t be cached within a single Helm invocation. It is only applicable to synchronous sources, because asynchronous sources are not cached.
helm-source-get-action-from-type
:
((object helm-type-file))
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-in-buffer)) ((_source helm-type-file)) :before ((source helm-type-file)) :after ((source helm-browse-project-override-inheritor))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-recentf-source, Previous: class helm-browse-project-source, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
(lambda nil (require ’filecache))
Function called with no parameters when helm is started.
It is useful for collecting current state information which can be
used to create the list of candidates later.
Initialization of candidates-in-buffer
is done here
with helm-init-candidates-in-buffer
.
t
’helm-candidates-in-buffer
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
nil
A string, a list or a buffer that will be used to feed the helm-candidates-buffer
.
This data will be passed in a function added to the init slot and
the buffer will be build with helm-init-candidates-in-buffer
or directly
with helm-candidates-buffer
if data is a buffer.
This is an easy and fast method to build a candidates-in-buffer
source.
t
’buffer-substring-no-properties
A function like buffer-substring-no-properties
or buffer-substring
.
This function converts region from point at line-beginning and point
at line-end in the helm-candidate-buffer
to a string which will be displayed
in the helm-buffer
, it takes two args BEG and END.
By default, helm-candidates-in-buffer
uses
buffer-substring-no-properties
which does no conversion and doesn’t carry
text properties.
t
’(identity)
List of functions called with one parameter: a candidate. The
function should return non-nil if the candidate matches the
current pattern (see variable helm-pattern
).
When using candidates-in-buffer
its default value is identity
and
don’t have to be changed, use the search
slot instead.
This attribute allows the source to override the default
pattern matching based on string-match
. It can be used, for
example, to implement a source for file names and do the
pattern matching on the basename of files, since it’s more
likely one is typing part of the basename when searching for a
file, instead of some string anywhere else in its path.
If the list contains more than one function then the list of matching candidates from the source is constructed by appending the results after invoking the first function on all the potential candidates, then the next function, and so on. The matching candidates supplied by the first function appear first in the list of results and then results from the other functions, respectively.
This attribute has no effect for asynchronous sources (see
attribute candidates
), and sources using match-dynamic
since they perform pattern matching themselves.
Note that FUZZY-MATCH slot will overhide value of this slot.
t
nil
Enable migemo.
When multimatch is disabled, you can give the symbol ’nomultimatch as value
to force not using generic migemo matching function.
In this case you have to provide your own migemo matching funtion
that kick in when helm-migemo-mode
is enabled.
Otherwise it will be available for this source once helm-migemo-mode
is enabled when non-nil.
t
’(helm-candidates-in-buffer-search-default-fn)
List of functions like re-search-forward
or search-forward
.
Buffer search function used by helm-candidates-in-buffer
.
By default, helm-candidates-in-buffer
uses re-search-forward
.
The function should take one arg PATTERN.
If your search function needs to handle negation like multimatch,
this function should returns in such case a cons cell of two integers defining
the beg and end positions to match in the line previously matched by
re-search-forward
or similar, and move point to next line
(See how the helm-mm-3-search-base
and helm-fuzzy-search
functions are working).
NOTE: FUZZY-MATCH slot will overhide value of this slot.
t
nil
When specifying a search function within a source and
helm-multi-match is enabled, the result of all searching
functions will be concatened, which in some cases is not what
is wanted. When using search-strict
only this or these
functions will be used. You can specify those functions as a
list of functions or a single symbol function.
NOTE: This have the same effect as using a nil value for :MULTIMATCH slot.
t
t
Indicates the source assembles the candidate list dynamically, so it shouldn’t be cached within a single Helm invocation. It is only applicable to synchronous sources, because asynchronous sources are not cached.
helm-source-get-action-from-type
:
((object helm-type-file))
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-in-buffer)) ((_source helm-type-file)) :before ((source helm-type-file))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-files-in-current-dir-source, Previous: class helm-file-cache, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
(lambda nil (require ’recentf) (when helm-turn-on-recentf (recentf-mode 1)))
Function called with no parameters when helm is started.
It is useful for collecting current state information which can be
used to create the list of candidates later.
Initialization of candidates-in-buffer
is done here
with helm-init-candidates-in-buffer
.
t
(lambda nil recentf-list)
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
nil
Disable all helm matching functions when non nil.
The :candidates function in this case is in charge of fetching
candidates dynamically according to helm-pattern
.
Note that :volatile is automatically enabled when using this, so no
need to specify it.
t
(lambda (candidate) (if (or helm-ff-transformer-show-only-basename helm-recentf–basename-flag) (helm-basename candidate) candidate))
Allow matching only one part of candidate. If source contain match-part attribute, match is computed only on part of candidate returned by the call of function provided by this attribute. The function should have one arg, candidate, and return only a specific part of candidate. On async sources, as matching is done by the backend, this have no effect apart for highlighting matches.
t
nil
When specifying a match function within a source and
helm-multi-match is enabled, the result of all matching
functions will be concatened, which in some cases is not what
is wanted. When using match-strict
only this or these
functions will be used. You can specify those functions as a
list of functions or a single symbol function.
NOTE: This have the same effect as using :MULTIMATCH nil.
t
t
Enable migemo.
When multimatch is disabled, you can give the symbol ’nomultimatch as value
to force not using generic migemo matching function.
In this case you have to provide your own migemo matching funtion
that kick in when helm-migemo-mode
is enabled.
Otherwise it will be available for this source once helm-migemo-mode
is enabled when non-nil.
t
’helm-recentf-pattern-transformer
It’s a function or a list of functions called with one argument
before computing matches. Its argument is helm-pattern
.
Functions should return transformed helm-pattern
.
It is useful to change interpretation of helm-pattern
.
t
’helm-ff-kill-or-find-buffer-fname
Can be a either a Function called with one parameter (the
selected candidate) or a cons cell where first element is this
same function and second element a symbol (e.g never-split)
that inform helm-execute-persistent-action
to not split his
window to execute this persistent action.
Example:
(defun foo-persistent-action (candidate) (do-something candidate))
:persistent-action ’(foo-persistent-action . never-split) ; Don’t split or :persistent-action ’foo-persistent-action ; Split
When specifying :persistent-action by slot directly, foo-persistent-action
will be executed without quitting helm when hitting C-j
.
Note that other persistent actions can be defined using other
bindings than C-j
by simply defining an interactive function bound
to a key in the keymap source.
The function should create a new attribute in source before calling
helm-execute-persistent-action
on this attribute.
Example:
(defun helm-ff-persistent-delete () “Delete current candidate without quitting.” (interactive) (with-helm-alive-p (helm-set-attr ’quick-delete ’(helm-ff-quick-delete . never-split)) (helm-execute-persistent-action ’quick-delete)))
This function is then bound in helm-find-files-map
.
helm-source-get-action-from-type
:
((object helm-type-file))
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-sync)) ((_source helm-type-file)) :before ((source helm-type-file)) :after ((source helm-recentf-source))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-grep-class, Previous: class helm-recentf-source, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
(lambda nil (with-helm-current-buffer (let ((dir (helm-current-directory))) (when (file-accessible-directory-p dir) (directory-files dir t)))))
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
t
Enable fuzzy matching in this source.
This will overwrite settings in MATCH slot, and for
sources built with child class helm-source-in-buffer
the SEARCH slot.
This is an easy way of enabling fuzzy matching, but you can use the MATCH
or SEARCH slots yourself if you want something more elaborated, mixing
different type of match (See helm-source-buffers
class for example).
This attribute is not supported for asynchronous sources since they perform pattern matching themselves.
t
nil
Disable all helm matching functions when non nil.
The :candidates function in this case is in charge of fetching
candidates dynamically according to helm-pattern
.
Note that :volatile is automatically enabled when using this, so no
need to specify it.
t
(lambda (candidate) (if (or helm-ff-transformer-show-only-basename helm-recentf–basename-flag) (helm-basename candidate) candidate))
Allow matching only one part of candidate. If source contain match-part attribute, match is computed only on part of candidate returned by the call of function provided by this attribute. The function should have one arg, candidate, and return only a specific part of candidate. On async sources, as matching is done by the backend, this have no effect apart for highlighting matches.
t
nil
When specifying a match function within a source and
helm-multi-match is enabled, the result of all matching
functions will be concatened, which in some cases is not what
is wanted. When using match-strict
only this or these
functions will be used. You can specify those functions as a
list of functions or a single symbol function.
NOTE: This have the same effect as using :MULTIMATCH nil.
t
t
Enable migemo.
When multimatch is disabled, you can give the symbol ’nomultimatch as value
to force not using generic migemo matching function.
In this case you have to provide your own migemo matching funtion
that kick in when helm-migemo-mode
is enabled.
Otherwise it will be available for this source once helm-migemo-mode
is enabled when non-nil.
t
’helm-recentf-pattern-transformer
It’s a function or a list of functions called with one argument
before computing matches. Its argument is helm-pattern
.
Functions should return transformed helm-pattern
.
It is useful to change interpretation of helm-pattern
.
helm-source-get-action-from-type
:
((object helm-type-file))
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-sync)) ((_source helm-type-file)) :before ((source helm-type-file))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-grep-ag-class, Previous: class helm-files-in-current-dir-source, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
’helm-grep-actions
An alist of (DISPLAY . FUNCTION) pairs, a variable name or a function. FUNCTION is called with one parameter: the selected candidate.
An action other than the default can be chosen from this list of actions for the currently selected candidate (by default with TAB). The DISPLAY string is shown in the completions buffer and the FUNCTION is invoked when an action is selected. The first action of the list is the default.
You should use helm-make-actions
to build this alist easily.
t
’helm-grep-after-init-hook
A local hook that run at end of initilization of this source.
i.e After the creation of helm-buffer
.
Should be a variable. Can be also an anonymous function or a list of functions directly added to slot, this is not recommended though.
t
nil
The grep backend that will be used. It is actually used only as an internal flag and doesn’t set the backend by itself. You probably don’t want to modify this.
t
’helm-grep-before-init-hook
A local hook that run at beginning of initilization of this source.
i.e Before the creation of helm-buffer
.
Should be a variable (defined with defvar). Can be also an anonymous function or a list of functions directly added to slot, this is not recommended though.
t
9999
Override helm-candidate-number-limit
only for this source.
t
’helm-grep-collect-candidates
This attribute is used to define a process as candidate.
The function called with no arguments must return a process
i.e. processp
, it use typically start-process
or make-process
,
see (info “(elisp) Asynchronous Processes”).
NOTE:
When building the source at runtime you can give directly a process
as value, otherwise wrap the process call into a function.
The process buffer should be nil, otherwise, if you use
helm-buffer
give to the process a sentinel.
t
#’helm-grep-fc-transformer
It has the same format as candidate-transformer
, except the
function is called with two parameters: the candidate list and
the source.
This transformer is run on the candidate list which is already
filtered by the current pattern. While candidate-transformer
is run only once, it is run every time the input pattern is
changed.
It can be used to transform the candidate list dynamically, for example, based on the current pattern.
In some cases it may also be more efficent to perform candidate
transformation here, instead of with candidate-transformer
even if this transformation is done every time the pattern is
changed. For example, if a candidate set is very large then
candidate-transformer
transforms every candidate while only
some of them will actually be displayed due to the limit
imposed by helm-candidate-number-limit
.
Note that candidates
and candidate-transformer
is run
already, so the given transformer function should also be able
to handle candidates with (DISPLAY . REAL) format.
t
’helm-grep
The current source group, default to helm
when not specified.
t
’helm-grep-help-message
Help message for this source.
If not present, helm-help-message
value will be used.
t
’helm-grep-history
Allow passing history variable to helm from source.
It should be a quoted symbol.
Passing the history variable here have no effect
so add it also in the helm
call with the :history keyword.
The main point of adding the variable here
is to make it available when resuming.
t
helm-grep-map
Specific keymap for this source.
default value is helm-map
.
t
t
Disable highlighting matches in this source.
This will disable generic highlighting of matches,
but some specialized highlighting can be done from elsewhere,
i.e from filtered-candidate-transformer
or filter-one-by-one
slots.
So use this to either disable completely highlighting in your source,
or to disable highlighting and use a specialized highlighting matches
function for this source.
Remember that this function should run AFTER all filter functions if those
filter functions are modifying face properties, though it is possible to
avoid this by using new add-face-text-property
in your filter functions.
t
t
Don’t allow marking candidates when this attribute is present.
t
nil
Backend is using pcre regexp engine when non-nil.
t
’helm-grep-persistent-action
Can be a either a Function called with one parameter (the
selected candidate) or a cons cell where first element is this
same function and second element a symbol (e.g never-split)
that inform helm-execute-persistent-action
to not split his
window to execute this persistent action.
Example:
(defun foo-persistent-action (candidate) (do-something candidate))
:persistent-action ’(foo-persistent-action . never-split) ; Don’t split or :persistent-action ’foo-persistent-action ; Split
When specifying :persistent-action by slot directly, foo-persistent-action
will be executed without quitting helm when hitting C-j
.
Note that other persistent actions can be defined using other
bindings than C-j
by simply defining an interactive function bound
to a key in the keymap source.
The function should create a new attribute in source before calling
helm-execute-persistent-action
on this attribute.
Example:
(defun helm-ff-persistent-delete () “Delete current candidate without quitting.” (interactive) (with-helm-alive-p (helm-set-attr ’quick-delete ’(helm-ff-quick-delete . never-split)) (helm-execute-persistent-action ’quick-delete)))
This function is then bound in helm-find-files-map
.
t
“Jump to line (C-u
Record in mark ring)”
A string to explain persistent-action of this source. It also
accepts a function or a variable name.
It will be displayed in header-line
or in minibuffer
depending
of value of helm-echo-input-in-header-line
and helm-display-header-line
.
t
2
If present matches from the source are shown only if the pattern is not empty. Optionally, it can have an integer parameter specifying the required length of input which is useful in case of sources with lots of candidates.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-async)) ((source helm-grep-class))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-gid-source, Previous: class helm-grep-class, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
’helm-grep-actions
An alist of (DISPLAY . FUNCTION) pairs, a variable name or a function. FUNCTION is called with one parameter: the selected candidate.
An action other than the default can be chosen from this list of actions for the currently selected candidate (by default with TAB). The DISPLAY string is shown in the completions buffer and the FUNCTION is invoked when an action is selected. The first action of the list is the default.
You should use helm-make-actions
to build this alist easily.
t
99999
Override helm-candidate-number-limit
only for this source.
t
#’helm-grep-fc-transformer
It has the same format as candidate-transformer
, except the
function is called with two parameters: the candidate list and
the source.
This transformer is run on the candidate list which is already
filtered by the current pattern. While candidate-transformer
is run only once, it is run every time the input pattern is
changed.
It can be used to transform the candidate list dynamically, for example, based on the current pattern.
In some cases it may also be more efficent to perform candidate
transformation here, instead of with candidate-transformer
even if this transformation is done every time the pattern is
changed. For example, if a candidate set is very large then
candidate-transformer
transforms every candidate while only
some of them will actually be displayed due to the limit
imposed by helm-candidate-number-limit
.
Note that candidates
and candidate-transformer
is run
already, so the given transformer function should also be able
to handle candidates with (DISPLAY . REAL) format.
t
’helm-grep
The current source group, default to helm
when not specified.
t
’helm-grep-help-message
Help message for this source.
If not present, helm-help-message
value will be used.
t
’helm-grep-ag-history
Allow passing history variable to helm from source.
It should be a quoted symbol.
Passing the history variable here have no effect
so add it also in the helm
call with the :history keyword.
The main point of adding the variable here
is to make it available when resuming.
t
helm-grep-map
Specific keymap for this source.
default value is helm-map
.
t
t
Disable highlighting matches in this source.
This will disable generic highlighting of matches,
but some specialized highlighting can be done from elsewhere,
i.e from filtered-candidate-transformer
or filter-one-by-one
slots.
So use this to either disable completely highlighting in your source,
or to disable highlighting and use a specialized highlighting matches
function for this source.
Remember that this function should run AFTER all filter functions if those
filter functions are modifying face properties, though it is possible to
avoid this by using new add-face-text-property
in your filter functions.
t
t
Don’t allow marking candidates when this attribute is present.
t
t
Backend is using pcre regexp engine when non–nil.
t
’helm-grep-persistent-action
Can be a either a Function called with one parameter (the
selected candidate) or a cons cell where first element is this
same function and second element a symbol (e.g never-split)
that inform helm-execute-persistent-action
to not split his
window to execute this persistent action.
Example:
(defun foo-persistent-action (candidate) (do-something candidate))
:persistent-action ’(foo-persistent-action . never-split) ; Don’t split or :persistent-action ’foo-persistent-action ; Split
When specifying :persistent-action by slot directly, foo-persistent-action
will be executed without quitting helm when hitting C-j
.
Note that other persistent actions can be defined using other
bindings than C-j
by simply defining an interactive function bound
to a key in the keymap source.
The function should create a new attribute in source before calling
helm-execute-persistent-action
on this attribute.
Example:
(defun helm-ff-persistent-delete () “Delete current candidate without quitting.” (interactive) (with-helm-alive-p (helm-set-attr ’quick-delete ’(helm-ff-quick-delete . never-split)) (helm-execute-persistent-action ’quick-delete)))
This function is then bound in helm-find-files-map
.
t
“Jump to line (C-u
Record in mark ring)”
A string to explain persistent-action of this source. It also
accepts a function or a variable name.
It will be displayed in header-line
or in minibuffer
depending
of value of helm-echo-input-in-header-line
and helm-display-header-line
.
t
2
If present matches from the source are shown only if the pattern is not empty. Optionally, it can have an integer parameter specifying the required length of input which is useful in case of sources with lots of candidates.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-async)) ((source helm-grep-ag-class))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-imenu-source, Previous: class helm-grep-ag-class, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
(helm-make-actions “Find File” ’helm-grep-action “Find file other frame” ’helm-grep-other-frame “Save results in grep buffer” ’helm-grep-save-results “Find file other window” ’helm-grep-other-window)
An alist of (DISPLAY . FUNCTION) pairs, a variable name or a function. FUNCTION is called with one parameter: the selected candidate.
An action other than the default can be chosen from this list of actions for the currently selected candidate (by default with TAB). The DISPLAY string is shown in the completions buffer and the FUNCTION is invoked when an action is selected. The first action of the list is the default.
You should use helm-make-actions
to build this alist easily.
t
99999
Override helm-candidate-number-limit
only for this source.
t
#’helm-gid-candidates-process
This attribute is used to define a process as candidate.
The function called with no arguments must return a process
i.e. processp
, it use typically start-process
or make-process
,
see (info “(elisp) Asynchronous Processes”).
NOTE:
When building the source at runtime you can give directly a process
as value, otherwise wrap the process call into a function.
The process buffer should be nil, otherwise, if you use
helm-buffer
give to the process a sentinel.
t
nil
Location of ID file.
t
#’helm-gid-filtered-candidate-transformer
It has the same format as candidate-transformer
, except the
function is called with two parameters: the candidate list and
the source.
This transformer is run on the candidate list which is already
filtered by the current pattern. While candidate-transformer
is run only once, it is run every time the input pattern is
changed.
It can be used to transform the candidate list dynamically, for example, based on the current pattern.
In some cases it may also be more efficent to perform candidate
transformation here, instead of with candidate-transformer
even if this transformation is done every time the pattern is
changed. For example, if a candidate set is very large then
candidate-transformer
transforms every candidate while only
some of them will actually be displayed due to the limit
imposed by helm-candidate-number-limit
.
Note that candidates
and candidate-transformer
is run
already, so the given transformer function should also be able
to handle candidates with (DISPLAY . REAL) format.
t
(lambda (name) (concat name “ [” (helm-get-attr ’db-dir) “]”))
A function returning the display string of the header. Its argument is the name of the source. This attribute is useful to add an additional information with the source name. It doesn’t modify the name of the source.
t
’helm-grep-help-message
Help message for this source.
If not present, helm-help-message
value will be used.
t
’helm-grep-history
Allow passing history variable to helm from source.
It should be a quoted symbol.
Passing the history variable here have no effect
so add it also in the helm
call with the :history keyword.
The main point of adding the variable here
is to make it available when resuming.
t
t
Disable highlighting matches in this source.
This will disable generic highlighting of matches,
but some specialized highlighting can be done from elsewhere,
i.e from filtered-candidate-transformer
or filter-one-by-one
slots.
So use this to either disable completely highlighting in your source,
or to disable highlighting and use a specialized highlighting matches
function for this source.
Remember that this function should run AFTER all filter functions if those
filter functions are modifying face properties, though it is possible to
avoid this by using new add-face-text-property
in your filter functions.
t
’helm-grep-persistent-action
Can be a either a Function called with one parameter (the
selected candidate) or a cons cell where first element is this
same function and second element a symbol (e.g never-split)
that inform helm-execute-persistent-action
to not split his
window to execute this persistent action.
Example:
(defun foo-persistent-action (candidate) (do-something candidate))
:persistent-action ’(foo-persistent-action . never-split) ; Don’t split or :persistent-action ’foo-persistent-action ; Split
When specifying :persistent-action by slot directly, foo-persistent-action
will be executed without quitting helm when hitting C-j
.
Note that other persistent actions can be defined using other
bindings than C-j
by simply defining an interactive function bound
to a key in the keymap source.
The function should create a new attribute in source before calling
helm-execute-persistent-action
on this attribute.
Example:
(defun helm-ff-persistent-delete () “Delete current candidate without quitting.” (interactive) (with-helm-alive-p (helm-set-attr ’quick-delete ’(helm-ff-quick-delete . never-split)) (helm-execute-persistent-action ’quick-delete)))
This function is then bound in helm-find-files-map
.
t
2
If present matches from the source are shown only if the pattern is not empty. Optionally, it can have an integer parameter specifying the required length of input which is useful in case of sources with lots of candidates.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-async))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-info-source, Previous: class helm-gid-source, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
’helm-imenu-action
An alist of (DISPLAY . FUNCTION) pairs, a variable name or a function. FUNCTION is called with one parameter: the selected candidate.
An action other than the default can be chosen from this list of actions for the currently selected candidate (by default with TAB). The DISPLAY string is shown in the completions buffer and the FUNCTION is invoked when an action is selected. The first action of the list is the default.
You should use helm-make-actions
to build this alist easily.
t
’helm-imenu-transformer
It’s a function or a list of functions called with one argument when the completion list from the source is built. The argument is the list of candidates retrieved from the source. The function should return a transformed list of candidates which will be used for the actual completion. If it is a list of functions, it calls each function sequentially.
This can be used to transform or remove items from the list of candidates.
Note that candidates
is run already, so the given transformer
function should also be able to handle candidates with (DISPLAY
. REAL) format.
t
’helm-imenu-candidates
Specifies how to retrieve candidates from the source. It can either be a variable name, a function called with no parameters or the actual list of candidates.
Do NOT use this for asynchronous sources, use candidates-process
instead.
The list must be a list whose members are strings, symbols or (DISPLAY . REAL) pairs.
In case of (DISPLAY . REAL) pairs, the DISPLAY string is shown in the Helm buffer, but the REAL one is used as action argument when the candidate is selected. This allows a more readable presentation for candidates which would otherwise be, for example, too long or have a common part shared with other candidates which can be safely replaced with an abbreviated string for display purposes.
Note that if the (DISPLAY . REAL) form is used then pattern matching is done on the displayed string, not on the real value.
This function, generally should not compute candidates according to
helm-pattern
which defeat all the Helm’s matching mechanism
i.e. multiple pattern matching and/or fuzzy matching.
If you want to do so, use :match-dynamic slot to be sure matching
occur only in :candidates function and there is no conflict with
other match functions.
t
’helm-imenu
The current source group, default to helm
when not specified.
t
’helm-imenu-help-message
Help message for this source.
If not present, helm-help-message
value will be used.
t
helm-imenu-map
Specific keymap for this source.
default value is helm-map
.
t
t
Don’t allow marking candidates when this attribute is present.
t
’helm-imenu-persistent-action
Can be a either a Function called with one parameter (the
selected candidate) or a cons cell where first element is this
same function and second element a symbol (e.g never-split)
that inform helm-execute-persistent-action
to not split his
window to execute this persistent action.
Example:
(defun foo-persistent-action (candidate) (do-something candidate))
:persistent-action ’(foo-persistent-action . never-split) ; Don’t split or :persistent-action ’foo-persistent-action ; Split
When specifying :persistent-action by slot directly, foo-persistent-action
will be executed without quitting helm when hitting C-j
.
Note that other persistent actions can be defined using other
bindings than C-j
by simply defining an interactive function bound
to a key in the keymap source.
The function should create a new attribute in source before calling
helm-execute-persistent-action
on this attribute.
Example:
(defun helm-ff-persistent-delete () “Delete current candidate without quitting.” (interactive) (with-helm-alive-p (helm-set-attr ’quick-delete ’(helm-ff-quick-delete . never-split)) (helm-execute-persistent-action ’quick-delete)))
This function is then bound in helm-find-files-map
.
t
“Show this entry”
A string to explain persistent-action of this source. It also
accepts a function or a variable name.
It will be displayed in header-line
or in minibuffer
depending
of value of helm-echo-input-in-header-line
and helm-display-header-line
.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-sync))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-locate-override-inheritor, Previous: class helm-imenu-source, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
#’helm-info-init
Function called with no parameters when helm is started.
It is useful for collecting current state information which can be
used to create the list of candidates later.
Initialization of candidates-in-buffer
is done here
with helm-init-candidates-in-buffer
.
t
’((“Goto node” . helm-info-goto))
An alist of (DISPLAY . FUNCTION) pairs, a variable name or a function. FUNCTION is called with one parameter: the selected candidate.
An action other than the default can be chosen from this list of actions for the currently selected candidate (by default with TAB). The DISPLAY string is shown in the completions buffer and the FUNCTION is invoked when an action is selected. The first action of the list is the default.
You should use helm-make-actions
to build this alist easily.
t
#’helm-info-display-to-real
Transform the selected candidate when passing it to action.
Function called with one parameter, the selected candidate.
Avoid recomputing all candidates with candidate-transformer or filtered-candidate-transformer to give a new value to REAL, instead the selected candidate is transformed only when passing it to action. This works (and make sense) only with plain string candidates, it will NOT work when candidate is a cons cell, in this case the real value of candidate will be used. Example:
(helm :sources (helm-build-sync-source “test” :candidates ’(a b c d e) :display-to-real (lambda (c) (concat c “:modified by d-t-r”))) :buffer “helm test”)
Note that this is NOT a transformer, so the display will not be modified by this function.
t
#’buffer-substring
A function like buffer-substring-no-properties
or buffer-substring
.
This function converts region from point at line-beginning and point
at line-end in the helm-candidate-buffer
to a string which will be displayed
in the helm-buffer
, it takes two args BEG and END.
By default, helm-candidates-in-buffer
uses
buffer-substring-no-properties
which does no conversion and doesn’t carry
text properties.
t
nil
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-in-buffer))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-locate-source, Previous: class helm-info-source, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
helm-source-get-action-from-type
:
((object helm-type-file))
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((_source helm-type-file)) :before ((source helm-type-file)) :after ((source helm-locate-override-inheritor))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-locate-subdirs-source, Previous: class helm-locate-override-inheritor, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
’helm-locate-initial-setup
Function called with no parameters when helm is started.
It is useful for collecting current state information which can be
used to create the list of candidates later.
Initialization of candidates-in-buffer
is done here
with helm-init-candidates-in-buffer
.
t
9999
Override helm-candidate-number-limit
only for this source.
t
’helm-locate-init
This attribute is used to define a process as candidate.
The function called with no arguments must return a process
i.e. processp
, it use typically start-process
or make-process
,
see (info “(elisp) Asynchronous Processes”).
NOTE:
When building the source at runtime you can give directly a process
as value, otherwise wrap the process call into a function.
The process buffer should be nil, otherwise, if you use
helm-buffer
give to the process a sentinel.
t
’helm-locate
The current source group, default to helm
when not specified.
t
’helm-file-name-history
Allow passing history variable to helm from source.
It should be a quoted symbol.
Passing the history variable here have no effect
so add it also in the helm
call with the :history keyword.
The main point of adding the variable here
is to make it available when resuming.
t
nil
Use the multi-match algorithm when non-nil. I.e Allow specifying multiple patterns separated by spaces. When a pattern is prefixed by “!” the negation of this pattern is used, i.e match anything but this pattern. It is the standard way of matching in helm and is enabled by default. It can be used with fuzzy-matching enabled, but as soon helm detect a space, each pattern will match by regexp and will not be fuzzy.
t
’helm-ff-kill-or-find-buffer-fname
Can be a either a Function called with one parameter (the
selected candidate) or a cons cell where first element is this
same function and second element a symbol (e.g never-split)
that inform helm-execute-persistent-action
to not split his
window to execute this persistent action.
Example:
(defun foo-persistent-action (candidate) (do-something candidate))
:persistent-action ’(foo-persistent-action . never-split) ; Don’t split or :persistent-action ’foo-persistent-action ; Split
When specifying :persistent-action by slot directly, foo-persistent-action
will be executed without quitting helm when hitting C-j
.
Note that other persistent actions can be defined using other
bindings than C-j
by simply defining an interactive function bound
to a key in the keymap source.
The function should create a new attribute in source before calling
helm-execute-persistent-action
on this attribute.
Example:
(defun helm-ff-persistent-delete () “Delete current candidate without quitting.” (interactive) (with-helm-alive-p (helm-set-attr ’quick-delete ’(helm-ff-quick-delete . never-split)) (helm-execute-persistent-action ’quick-delete)))
This function is then bound in helm-find-files-map
.
t
(progn helm-locate-fuzzy-sort-fn)
A function or a list of functions to apply to current list
of candidates when redisplaying buffer with helm-redisplay-buffer
.
This is only interesting for modifying and redisplaying the whole list
of candidates in async sources.
It uses identity
by default for when async sources are mixed with
normal sources, in this case these normal sources are not modified and
redisplayed as they are.
t
3
If present matches from the source are shown only if the pattern is not empty. Optionally, it can have an integer parameter specifying the required length of input which is useful in case of sources with lots of candidates.
helm-source-get-action-from-type
:
((object helm-type-file))
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-async)) ((_source helm-type-file)) :before ((source helm-type-file)) :after ((source helm-locate-override-inheritor))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-moccur-class, Previous: class helm-locate-source, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
nil
t
#’helm-locate-init-subdirs
A string, a list or a buffer that will be used to feed the helm-candidates-buffer
.
This data will be passed in a function added to the init slot and
the buffer will be build with helm-init-candidates-in-buffer
or directly
with helm-candidates-buffer
if data is a buffer.
This is an easy and fast method to build a candidates-in-buffer
source.
t
’helm-locate
The current source group, default to helm
when not specified.
t
nil
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-in-buffer))
helm-setup-user-source
:
((_source helm-source))
Next: class helm-semantic-source, Previous: class helm-locate-subdirs-source, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
nil
t
nil
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-in-buffer))
helm-setup-user-source
:
((_source helm-source))
Next: Main Index, Previous: class helm-moccur-class, Up: Top [Contents][Index]
The following are some interesting slots of this class. Note that not all slots are shown here.
t
(lambda nil (helm-semantic–maybe-set-needs-update) (setq helm-semantic–tags-cache (semantic-fetch-tags)) (with-current-buffer (helm-candidate-buffer ’global) (let ((major-mode (with-helm-current-buffer major-mode))) (helm-semantic–fetch-candidates helm-semantic–tags-cache 0))))
Function called with no parameters when helm is started.
It is useful for collecting current state information which can be
used to create the list of candidates later.
Initialization of candidates-in-buffer
is done here
with helm-init-candidates-in-buffer
.
t
’helm-semantic-default-action
An alist of (DISPLAY . FUNCTION) pairs, a variable name or a function. FUNCTION is called with one parameter: the selected candidate.
An action other than the default can be chosen from this list of actions for the currently selected candidate (by default with TAB). The DISPLAY string is shown in the completions buffer and the FUNCTION is invoked when an action is selected. The first action of the list is the default.
You should use helm-make-actions
to build this alist easily.
t
’buffer-substring
A function like buffer-substring-no-properties
or buffer-substring
.
This function converts region from point at line-beginning and point
at line-end in the helm-candidate-buffer
to a string which will be displayed
in the helm-buffer
, it takes two args BEG and END.
By default, helm-candidates-in-buffer
uses
buffer-substring-no-properties
which does no conversion and doesn’t carry
text properties.
t
’helm-semantic-help-message
Help message for this source.
If not present, helm-help-message
value will be used.
t
’helm-semantic-map
Specific keymap for this source.
default value is helm-map
.
t
(lambda (elm) (helm-semantic-default-action elm t) (helm-highlight-current-line))
Can be a either a Function called with one parameter (the
selected candidate) or a cons cell where first element is this
same function and second element a symbol (e.g never-split)
that inform helm-execute-persistent-action
to not split his
window to execute this persistent action.
Example:
(defun foo-persistent-action (candidate) (do-something candidate))
:persistent-action ’(foo-persistent-action . never-split) ; Don’t split or :persistent-action ’foo-persistent-action ; Split
When specifying :persistent-action by slot directly, foo-persistent-action
will be executed without quitting helm when hitting C-j
.
Note that other persistent actions can be defined using other
bindings than C-j
by simply defining an interactive function bound
to a key in the keymap source.
The function should create a new attribute in source before calling
helm-execute-persistent-action
on this attribute.
Example:
(defun helm-ff-persistent-delete () “Delete current candidate without quitting.” (interactive) (with-helm-alive-p (helm-set-attr ’quick-delete ’(helm-ff-quick-delete . never-split)) (helm-execute-persistent-action ’quick-delete)))
This function is then bound in helm-find-files-map
.
t
“Show this entry”
A string to explain persistent-action of this source. It also
accepts a function or a variable name.
It will be displayed in header-line
or in minibuffer
depending
of value of helm-echo-input-in-header-line
and helm-display-header-line
.
helm--setup-source
:
((_source helm-source)) :before ((source helm-source)) ((source helm-source-in-buffer))
helm-setup-user-source
:
((_source helm-source))
Next: Key Index, Previous: class helm-semantic-source, Up: Top [Contents][Index]
Next: Command and Function Index, Previous: Main Index, Up: Top [Contents][Index]
Next: Variable Index, Previous: Key Index, Up: Top [Contents][Index]
Next: Class Index, Previous: Command and Function Index, Up: Top [Contents][Index]
This is not a complete index of variables and faces, only the ones that are mentioned in the manual. For a more complete list, use M-x org-customize and then click yourself through the tree.
Previous: Variable Index, Up: Top [Contents][Index]
Jump to: | H |
---|
Jump to: | H |
---|