Function: completion--flex-cost-gotoh
completion--flex-cost-gotoh is a function defined in minibuf.c.
Signature
(completion--flex-cost-gotoh PAT STR)
Documentation
Compute cost of PAT matching STR using modified Gotoh algorithm. Return nil if no match found, else return (COST . MATCHES) where COST is a fixnum (lower is better) and MATCHES is a list of the same length as PAT. Each i-th element is a FIXNUM indicating where in STR the i-th character of PAT matched.
Source Code
// Defined in /usr/src/emacs/src/minibuf.c
// Skipping highlighting due to helpful-max-highlight.
{
staticpro (&minibuf_prompt);
staticpro (&minibuf_save_list);
staticpro (&MB_frame);
MB_frame = Qnil;
staticpro (&exp_MB_frame);
DEFSYM (Qminibuffer_follows_selected_frame,
"minibuffer-follows-selected-frame");
DEFSYM (Qcompletion_ignore_case, "completion-ignore-case");
DEFSYM (Qminibuffer_default, "minibuffer-default");
Fset (Qminibuffer_default, Qnil);
DEFSYM (Qminibuffer_completion_table, "minibuffer-completion-table");
staticpro (&last_minibuf_string);
DEFSYM (Qcustom_variable_history, "custom-variable-history");
Fset (Qcustom_variable_history, Qnil);
DEFSYM (Qminibuffer_history, "minibuffer-history");
DEFSYM (Qbuffer_name_history, "buffer-name-history");
Fset (Qbuffer_name_history, Qnil);
DEFSYM (Qcustom_variable_p, "custom-variable-p");
/* Normal hooks for entry to and exit from minibuffer. */
DEFSYM (Qminibuffer_setup_hook, "minibuffer-setup-hook");
DEFSYM (Qminibuffer_exit_hook, "minibuffer-exit-hook");
DEFSYM (Qcurrent_input_method, "current-input-method");
DEFSYM (Qactivate_input_method, "activate-input-method");
DEFSYM (Qmetadata, "metadata");
DEFSYM (Qcycle_sort_function, "cycle-sort-function");
/* A frame parameter. */
DEFSYM (Qminibuffer_exit, "minibuffer-exit");
DEFSYM (Qminibuffer_mode, "minibuffer-mode");
DEFSYM (Qminibuffer_inactive_mode, "minibuffer-inactive-mode");
DEFSYM (Qminibuffer_completing_file_name, "minibuffer-completing-file-name");
DEFSYM (Qselect_frame_set_input_focus, "select-frame-set-input-focus");
DEFSYM (Qadd_to_history, "add-to-history");
DEFSYM (Qpush_window_buffer_onto_prev, "push-window-buffer-onto-prev");
DEFVAR_LISP ("read-expression-history", Vread_expression_history,
doc: /* A history list for arguments that are Lisp expressions to evaluate.
For example, `eval-expression' uses this. */);
Vread_expression_history = Qnil;
DEFVAR_LISP ("read-buffer-function", Vread_buffer_function,
doc: /* If this is non-nil, `read-buffer' does its work by calling this function.
The function is called with the arguments passed to `read-buffer'. */);
Vread_buffer_function = Qnil;
DEFVAR_LISP ("minibuffer-follows-selected-frame", minibuffer_follows_selected_frame,
doc: /* t means the active minibuffer always displays on the selected frame.
Nil means that a minibuffer will appear only in the frame which created it.
Any other value means the minibuffer will move onto another frame, but
only when the user starts using a minibuffer there.
Any buffer local or dynamic binding of this variable is ignored. Only the
default top level value is used. */);
minibuffer_follows_selected_frame = Qt;
DEFVAR_BOOL ("read-buffer-completion-ignore-case",
read_buffer_completion_ignore_case,
doc: /* Non-nil means completion ignores case when reading a buffer name. */);
read_buffer_completion_ignore_case = 0;
DEFVAR_LISP ("minibuffer-setup-hook", Vminibuffer_setup_hook,
doc: /* Normal hook run just after entry to minibuffer. */);
Vminibuffer_setup_hook = Qnil;
DEFVAR_LISP ("minibuffer-exit-hook", Vminibuffer_exit_hook,
doc: /* Normal hook run whenever a minibuffer is exited. */);
Vminibuffer_exit_hook = Qnil;
DEFVAR_LISP ("history-length", Vhistory_length,
doc: /* Maximum length of history lists before truncation takes place.
A number means truncate to that length; truncation deletes old
elements, and is done just after inserting a new element.
A value of t means no truncation.
This variable only affects history lists that don't specify their own
maximum lengths. Setting the `history-length' property of a history
variable overrides this default. */);
XSETFASTINT (Vhistory_length, 100);
DEFVAR_BOOL ("history-delete-duplicates", history_delete_duplicates,
doc: /* Non-nil means to delete duplicates in history.
If set to t when adding a new history element, all previous identical
elements are deleted from the history list. */);
history_delete_duplicates = 0;
DEFVAR_LISP ("history-add-new-input", Vhistory_add_new_input,
doc: /* Non-nil means to add new elements in history.
If set to nil, minibuffer reading functions don't add new elements to the
history list, so it is possible to do this afterwards by calling
`add-to-history' explicitly. */);
Vhistory_add_new_input = Qt;
DEFVAR_BOOL ("completion-ignore-case", completion_ignore_case,
doc: /* Non-nil means don't consider case significant in completion.
For file-name completion, `read-file-name-completion-ignore-case'
controls the behavior, rather than this variable.
For buffer name completion, `read-buffer-completion-ignore-case'
controls the behavior, rather than this variable. */);
completion_ignore_case = 0;
DEFVAR_BOOL ("enable-recursive-minibuffers", enable_recursive_minibuffers,
doc: /* Non-nil means to allow minibuffer commands while in the minibuffer.
This variable makes a difference whenever the minibuffer window is active.
Also see `minibuffer-depth-indicate-mode', which may be handy if this
variable is non-nil. */);
enable_recursive_minibuffers = 0;
DEFVAR_LISP ("minibuffer-completion-table", Vminibuffer_completion_table,
doc: /* Alist or obarray used for completion in the minibuffer.
This becomes the ALIST argument to `try-completion' and `all-completions'.
The value can also be a list of strings or a hash table.
The value may alternatively be a function, which is given three arguments:
STRING, the current buffer contents;
PREDICATE, the predicate for filtering possible matches;
CODE, which says what kind of things to do.
CODE can be nil, t or `lambda':
nil -- return the best completion of STRING, or nil if there is none.
t -- return a list of all possible completions of STRING.
lambda -- return t if STRING is a valid completion as it stands. */);
Vminibuffer_completion_table = Qnil;
DEFVAR_LISP ("minibuffer-completion-predicate", Vminibuffer_completion_predicate,
doc: /* Within call to `completing-read', this holds the PREDICATE argument. */);
Vminibuffer_completion_predicate = Qnil;
DEFVAR_LISP ("minibuffer-completion-confirm", Vminibuffer_completion_confirm,
doc: /* Whether to demand confirmation of completion before exiting minibuffer.
If nil, confirmation is not required.
If the value is `confirm', the user may exit with an input that is not
a valid completion alternative, but Emacs asks for confirmation.
If the value is `confirm-after-completion', the user may exit with an
input that is not a valid completion alternative, but Emacs asks for
confirmation if the user submitted the input right after any of the
completion commands listed in `minibuffer-confirm-exit-commands'. */);
Vminibuffer_completion_confirm = Qnil;
DEFVAR_LISP ("minibuffer-completing-file-name",
Vminibuffer_completing_file_name,
doc: /* Non-nil means completing file names. */);
Vminibuffer_completing_file_name = Qnil;
DEFVAR_LISP ("minibuffer-help-form", Vminibuffer_help_form,
doc: /* Value that `help-form' takes on inside the minibuffer. */);
Vminibuffer_help_form = Qnil;
DEFVAR_LISP ("minibuffer-history-variable", Vminibuffer_history_variable,
doc: /* History list symbol to add minibuffer values to.
Each string of minibuffer input, as it appears on exit from the minibuffer,
is added with
(set minibuffer-history-variable
(cons STRING (symbol-value minibuffer-history-variable)))
If the variable is t, no history is recorded. */);
XSETFASTINT (Vminibuffer_history_variable, 0);
DEFVAR_LISP ("minibuffer-history-position", Vminibuffer_history_position,
doc: /* Current position of redoing in the history list. */);
Vminibuffer_history_position = Qnil;
DEFVAR_BOOL ("minibuffer-auto-raise", minibuffer_auto_raise,
doc: /* Non-nil means entering the minibuffer raises the minibuffer's frame.
Some uses of the echo area also raise that frame (since they use it too). */);
minibuffer_auto_raise = 0;
DEFVAR_LISP ("completion-regexp-list", Vcompletion_regexp_list,
doc: /* List of regexps that should restrict possible completions.
The basic completion functions only consider a completion acceptable
if it matches all regular expressions in this list, with
`case-fold-search' bound to the value of `completion-ignore-case'.
See Info node `(elisp)Basic Completion', for a description of these
functions.
Do not set this variable to a non-nil value globally, as that is not
safe and will probably cause errors in completion commands. This
variable should be only let-bound to non-nil values around calls to
basic completion functions like `try-completion' and `all-completions'. */);
Vcompletion_regexp_list = Qnil;
DEFVAR_BOOL ("minibuffer-allow-text-properties",
minibuffer_allow_text_properties,
doc: /* Non-nil means `read-from-minibuffer' should not discard text properties.
Lisp code can let-bind this, or make it buffer-local in the minibuffer.
This also affects `read-string', or any of the functions that do
minibuffer input with completion, but it does not affect `read-minibuffer'
that always discards text properties. */);
minibuffer_allow_text_properties = 0;
DEFVAR_LISP ("minibuffer-prompt-properties", Vminibuffer_prompt_properties,
doc: /* Text properties that are added to minibuffer prompts.
These are in addition to the basic `field' property, and stickiness
properties. */);
Vminibuffer_prompt_properties = list2 (Qread_only, Qt);
DEFVAR_LISP ("read-hide-char", Vread_hide_char,
doc: /* Whether to hide input characters in noninteractive mode.
If non-nil, it must be a character, which will be used to mask the
input characters. This variable should never be set globally.
This variable also overrides the default character that `read-passwd'
uses to hide passwords. */);
Vread_hide_char = Qnil;
DEFVAR_BOOL ("inhibit-interaction",
inhibit_interaction,
doc: /* Non-nil means any user interaction will signal an error.
This variable can be bound when user interaction can't be performed,
for instance when running a headless Emacs server. Functions like
`read-from-minibuffer' (and the like) will signal `inhibited-interaction'
instead. */);
inhibit_interaction = 0;
DEFVAR_BOOL ("read-minibuffer-restore-windows", read_minibuffer_restore_windows,
doc: /* Non-nil means restore window configurations on exit from minibuffer.
If this is non-nil (the default), reading input with the minibuffer will
restore, on exit, the window configurations of the frame where the
minibuffer was entered from and, if it is different, the frame that owns
the associated minibuffer window.
If this is nil, window configurations are not restored upon exiting
the minibuffer. However, if `minibuffer-restore-windows' is present
in `minibuffer-exit-hook', exiting the minibuffer will remove the window
showing the *Completions* buffer, if any. */);
read_minibuffer_restore_windows = true;
defsubr (&Sactive_minibuffer_window);
defsubr (&Sset_minibuffer_window);
defsubr (&Sread_from_minibuffer);
defsubr (&Sread_string);
defsubr (&Sread_command);
defsubr (&Sread_variable);
defsubr (&Sinternal_complete_buffer);
defsubr (&Sread_buffer);
defsubr (&Sminibuffer_depth);
defsubr (&Sminibuffer_prompt);
defsubr (&Sminibufferp);
defsubr (&Sinnermost_minibuffer_p);
defsubr (&Sminibuffer_innermost_command_loop_p);
defsubr (&Sabort_minibuffers);
defsubr (&Sminibuffer_prompt_end);
defsubr (&Sminibuffer_contents);
defsubr (&Sminibuffer_contents_no_properties);
defsubr (&Stry_completion);
defsubr (&Sall_completions);
defsubr (&Stest_completion);
defsubr (&Sassoc_string);
defsubr (&Scompleting_read);
defsubr (&Scompletion__flex_cost_gotoh);
DEFSYM (Qminibuffer_quit_recursive_edit, "minibuffer-quit-recursive-edit");
DEFSYM (Qinternal_complete_buffer, "internal-complete-buffer");
DEFSYM (Qcompleting_read_function, "completing-read-function");
DEFSYM (Qformat_prompt, "format-prompt");
}