diff options
Diffstat (limited to 'doc/lispref/minibuf.texi')
-rw-r--r-- | doc/lispref/minibuf.texi | 93 |
1 files changed, 86 insertions, 7 deletions
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 65a9dca52f4..8f2d0d702f9 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -1543,7 +1543,8 @@ that it uses the predicate @code{custom-variable-p} instead of @code{commandp}. @end defun -@deffn Command read-color &optional prompt convert allow-empty display +@deffn Command read-color &optional prompt convert allow-empty @ + display foreground face This function reads a string that is a color specification, either the color's name or an RGB hex value such as @code{#RRRGGGBBB}. It prompts with @var{prompt} (default: @code{"Color (name or #RGB triplet):"}) @@ -1563,6 +1564,13 @@ non-@code{nil} and the user enters null input. Interactively, or when @var{display} is non-@code{nil}, the return value is also displayed in the echo area. + +The optional arguments @var{foreground} and @var{face} control the +appearance of the completion candidates in the @file{*Completions*} +buffer. The candidates are displayed in the specified @var{face} but +with different colors: if @var{foreground} is non-@code{nil}, the +foreground color is changed to be the color of the candidate, +otherwise the background is changed to the candidate's color. @end deffn See also the functions @code{read-coding-system} and @@ -1872,10 +1880,31 @@ The value should be a list of completion styles (symbols). The value should be a value for @code{completion-cycle-threshold} (@pxref{Completion Options,,, emacs, The GNU Emacs Manual}) for this category. + +@item cycle-sort-function +The function to sort entries when cycling. + +@item display-sort-function +The function to sort entries in the @file{*Completions*} buffer. +The possible values are: @code{nil}, which means to use either the +sorting function from metadata or if that is @code{nil}, fall back to +@code{completions-sort}; @code{identity}, which means not to sort at +all, leaving the original order; or any other value out of those used +in @code{completions-sort} (@pxref{Completion Options,,, emacs, The +GNU Emacs Manual}). + +@item group-function +The function to group completions. + +@item annotation-function +The function to add annotations to completions. + +@item affixation-function +The function to add prefixes and suffixes to completions. @end table @noindent -Additional alist entries may be defined in the future. +See @ref{Programmed Completion}, for a complete list of metadata entries. @end defopt @defvar completion-extra-properties @@ -1885,6 +1914,12 @@ completion commands. Its value should be a list of property and value pairs. The following properties are supported: @table @code +@item :category +The value should be a symbol describing what kind of text the +completion function is trying to complete. If the symbol matches one +of the keys in @code{completion-category-overrides}, the usual +completion behavior is overridden. @xref{Completion Variables}. + @item :annotation-function The value should be a function to add annotations in the completions buffer. This function must accept one argument, a completion, and @@ -1901,6 +1936,15 @@ element of the returned list must be a three-element list, the completion, a prefix string, and a suffix string. This function takes priority over @code{:annotation-function}. +@item :group-function +The function to group completions. + +@item :display-sort-function +The function to sort entries in the @file{*Completions*} buffer. + +@item :cycle-sort-function +The function to sort entries when cycling. + @item :exit-function The value should be a function to run after performing completion. The function should accept two arguments, @var{string} and @@ -2238,6 +2282,9 @@ the expected answers (@kbd{y}, @kbd{n}, @kbd{@key{SPC}}, @kbd{@key{DEL}}, or something that quits), the function responds @samp{Please answer y or n.}, and repeats the request. +If @var{prompt} is a non-empty string, and it ends with a non-space +character, a @samp{SPC} character will be appended to it. + This function actually uses the minibuffer, but does not allow editing of the answer. The cursor moves to the minibuffer while the question is being asked. @@ -2271,10 +2318,15 @@ minibuffer. It returns @code{t} if the user enters @samp{yes}, @code{nil} if the user types @samp{no}. The user must type @key{RET} to finalize the response. Upper and lower case are equivalent. -@code{yes-or-no-p} starts by displaying @var{prompt} in the minibuffer, -followed by @w{@samp{(yes or no) }}. The user must type one of the -expected responses; otherwise, the function responds @samp{Please answer -yes or no.}, waits about two seconds and repeats the request. +@vindex yes-or-no-prompt +@code{yes-or-no-p} starts by displaying @var{prompt} in the +minibuffer, followed by the value of @code{yes-or-no-prompt} @w{(default +@samp{(yes or no) })}. The user must type one of the expected +responses; otherwise, the function responds @w{@samp{Please answer yes or +no.}}, waits about two seconds and repeats the request. + +If @var{prompt} is a non-empty string, and it ends with a non-space +character, a @samp{SPC} character will be appended to it. @code{yes-or-no-p} requires more work from the user than @code{y-or-n-p} and is appropriate for more crucial decisions. @@ -2512,6 +2564,14 @@ times match. The optional argument @var{default} specifies the default password to return if the user enters empty input. If @var{default} is @code{nil}, then @code{read-passwd} returns the null string in that case. + +This function uses @code{read-passwd-mode}, a minor mode. It binds two +keys in the minbuffer: @kbd{C-u} (@code{delete-minibuffer-contents}) +deletes the password, and @kbd{TAB} +(@code{read-passwd--toggle-visibility}) toggles the visibility of the +password. There is also an additional icon in the mode-line. Clicking +on this icon with @key{mouse-1} toggles the visibility of the password +as well. @end defun @node Minibuffer Commands @@ -2662,7 +2722,7 @@ variable instead (@pxref{Echo Area Customization}). The option @code{resize-mini-windows} does not affect the behavior of minibuffer-only frames (@pxref{Frame Layout}). The following option -allows to automatically resize such frames as well. +enables automatically resizing such frames as well. @defopt resize-mini-frames If this is @code{nil}, minibuffer-only frames are never resized @@ -2870,3 +2930,22 @@ This is the major mode used in inactive minibuffers. It uses keymap @code{minibuffer-inactive-mode-map}. This can be useful if the minibuffer is in a separate frame. @xref{Minibuffers and Frames}. @end deffn + +@deffn Command minibuffer-regexp-mode +This minor mode makes editing regular expressions in the minibuffer +more convenient. It highlight parens via @code{show-paren-mode} and +@code{blink-matching-paren} in a user-friendly way, avoids reporting +false paren mismatches, and makes sexp navigation more intuitive. +@end deffn + +By default, only certain minibuffer prompts automatically activate the +convenience features of @code{minibuffer-regexp-mode} when the +minibuffer becomes active. This list of prompts can be customized via +@code{minibuffer-regexp-prompts}. + +@defopt minibuffer-regexp-prompts +This variable holds the list of regular expressions for activating the +features of @code{minibuffer-regexp-mode} in the minibuffer. The +mode's features will be activated only if the minibuffer prompt +matches one of the regular expressions in the list. +@end defopt |