GNU Info

Info Node: (readline.info)Completion Variables

(readline.info)Completion Variables


Next: A Short Completion Example Prev: Completion Functions Up: Custom Completers
Enter node , (file) or (file)node

Completion Variables
--------------------

 - Variable: rl_compentry_func_t * rl_completion_entry_function
     A pointer to the generator function for `rl_completion_matches()'.
     `NULL' means to use `rl_filename_completion_function()', the
     default filename completer.

 - Variable: rl_completion_func_t * rl_attempted_completion_function
     A pointer to an alternative function to create matches.  The
     function is called with TEXT, START, and END.  START and END are
     indices in `rl_line_buffer' defining the boundaries of TEXT, which
     is a character string.  If this function exists and returns
     `NULL', or if this variable is set to `NULL', then `rl_complete()'
     will call the value of `rl_completion_entry_function' to generate
     matches, otherwise the array of strings returned will be used.  If
     this function sets the `rl_attempted_completion_over' variable to
     a non-zero value, Readline will not perform its default completion
     even if this function returns no matches.

 - Variable: rl_quote_func_t * rl_filename_quoting_function
     A pointer to a function that will quote a filename in an
     application-specific fashion.  This is called if filename
     completion is being attempted and one of the characters in
     `rl_filename_quote_characters' appears in a completed filename.
     The function is called with TEXT, MATCH_TYPE, and QUOTE_POINTER.
     The TEXT is the filename to be quoted.  The MATCH_TYPE is either
     `SINGLE_MATCH', if there is only one completion match, or
     `MULT_MATCH'.  Some functions use this to decide whether or not to
     insert a closing quote character.  The QUOTE_POINTER is a pointer
     to any opening quote character the user typed.  Some functions
     choose to reset this character.

 - Variable: rl_dequote_func_t * rl_filename_dequoting_function
     A pointer to a function that will remove application-specific
     quoting characters from a filename before completion is attempted,
     so those characters do not interfere with matching the text
     against names in the filesystem.  It is called with TEXT, the text
     of the word to be dequoted, and QUOTE_CHAR, which is the quoting
     character that delimits the filename (usually `'' or `"').  If
     QUOTE_CHAR is zero, the filename was not in an embedded string.

 - Variable: rl_linebuf_func_t * rl_char_is_quoted_p
     A pointer to a function to call that determines whether or not a
     specific character in the line buffer is quoted, according to
     whatever quoting mechanism the program calling Readline uses.  The
     function is called with two arguments: TEXT, the text of the line,
     and INDEX, the index of the character in the line.  It is used to
     decide whether a character found in
     `rl_completer_word_break_characters' should be used to break words
     for the completer.

 - Variable: int rl_completion_query_items
     Up to this many items will be displayed in response to a
     possible-completions call.  After that, we ask the user if she is
     sure she wants to see them all.  The default value is 100.

 - Variable: const char * rl_basic_word_break_characters
     The basic list of characters that signal a break between words for
     the completer routine.  The default value of this variable is the
     characters which break words for completion in Bash: `"
     \t\n\"\\'`@$><=;|&{("'.

 - Variable: const char * rl_basic_quote_characters
     A list of quote characters which can cause a word break.

 - Variable: const char * rl_completer_word_break_characters
     The list of characters that signal a break between words for
     `rl_complete_internal()'.  The default list is the value of
     `rl_basic_word_break_characters'.

 - Variable: const char * rl_completer_quote_characters
     A list of characters which can be used to quote a substring of the
     line.  Completion occurs on the entire substring, and within the
     substring `rl_completer_word_break_characters' are treated as any
     other character, unless they also appear within this list.

 - Variable: const char * rl_filename_quote_characters
     A list of characters that cause a filename to be quoted by the
     completer when they appear in a completed filename.  The default
     is the null string.

 - Variable: const char * rl_special_prefixes
     The list of characters that are word break characters, but should
     be left in TEXT when it is passed to the completion function.
     Programs can use this to help determine what kind of completing to
     do.  For instance, Bash sets this variable to "$@" so that it can
     complete shell variables and hostnames.

 - Variable: int rl_completion_append_character
     When a single completion alternative matches at the end of the
     command line, this character is appended to the inserted
     completion text.  The default is a space character (` ').  Setting
     this to the null character (`\0') prevents anything being appended
     automatically.  This can be changed in custom completion functions
     to provide the "most sensible word separator character" according
     to an application-specific command line syntax specification.

 - Variable: int rl_ignore_completion_duplicates
     If non-zero, then duplicates in the matches are removed.  The
     default is 1.

 - Variable: int rl_filename_completion_desired
     Non-zero means that the results of the matches are to be treated as
     filenames.  This is _always_ zero on entry, and can only be changed
     within a completion entry generator function.  If it is set to a
     non-zero value, directory names have a slash appended and Readline
     attempts to quote completed filenames if they contain any
     characters in `rl_filename_quote_characters' and
     `rl_filename_quoting_desired' is set to a non-zero value.

 - Variable: int rl_filename_quoting_desired
     Non-zero means that the results of the matches are to be quoted
     using double quotes (or an application-specific quoting mechanism)
     if the completed filename contains any characters in
     `rl_filename_quote_chars'.  This is _always_ non-zero on entry,
     and can only be changed within a completion entry generator
     function.  The quoting is effected via a call to the function
     pointed to by `rl_filename_quoting_function'.

 - Variable: int rl_attempted_completion_over
     If an application-specific completion function assigned to
     `rl_attempted_completion_function' sets this variable to a non-zero
     value, Readline will not perform its default filename completion
     even if the application's completion function returns no matches.
     It should be set only by an application's completion function.

 - Variable: int rl_completion_type
     Set to a character describing the type of completion Readline is
     currently attempting; see the description of
     `rl_complete_internal()' (Note: Completion Functions) for the
     list of characters.

 - Variable: int rl_inhibit_completion
     If this variable is non-zero, completion is inhibited.  The
     completion character will be inserted as any other bound to
     `self-insert'.

 - Variable: rl_compignore_func_t * rl_ignore_some_completions_function
     This function, if defined, is called by the completer when real
     filename completion is done, after all the matching names have
     been generated.  It is passed a `NULL' terminated array of matches.
     The first element (`matches[0]') is the maximal substring common
     to all matches. This function can re-arrange the list of matches
     as required, but each element deleted from the array must be freed.

 - Variable: rl_icppfunc_t * rl_directory_completion_hook
     This function, if defined, is allowed to modify the directory
     portion of filenames Readline completes.  It is called with the
     address of a string (the current directory name) as an argument,
     and may modify that string.  If the string is replaced with a new
     string, the old value should be freed.  Any modified directory
     name should have a trailing slash.  The modified value will be
     displayed as part of the completion, replacing the directory
     portion of the pathname the user typed.  It returns an integer
     that should be non-zero if the function modifies its directory
     argument.  It could be used to expand symbolic links or shell
     variables in pathnames.

 - Variable: rl_compdisp_func_t * rl_completion_display_matches_hook
     If non-zero, then this is the address of a function to call when
     completing a word would normally display the list of possible
     matches.  This function is called in lieu of Readline displaying
     the list.  It takes three arguments: (`char **'MATCHES, `int'
     NUM_MATCHES, `int' MAX_LENGTH) where MATCHES is the array of
     matching strings, NUM_MATCHES is the number of strings in that
     array, and MAX_LENGTH is the length of the longest string in that
     array.  Readline provides a convenience function,
     `rl_display_match_list', that takes care of doing the display to
     Readline's output stream.  That function may be called from this
     hook.


automatically generated by info2www version 1.2.2.9