comparison lispref/minibuf.texi @ 66468:448890268bf7

Write about new optional argument for `display-completion-list'.
author Masatake YAMATO <jet@gyve.org>
date Thu, 27 Oct 2005 05:43:37 +0000
parents 028c8f536edb
children 8abfaaf2f6f1
comparison
equal deleted inserted replaced
66467:3487cbe84763 66468:448890268bf7
947 @code{minibuffer-completion-predicate} as the @var{predicate} argument. 947 @code{minibuffer-completion-predicate} as the @var{predicate} argument.
948 The list of completions is displayed as text in a buffer named 948 The list of completions is displayed as text in a buffer named
949 @samp{*Completions*}. 949 @samp{*Completions*}.
950 @end deffn 950 @end deffn
951 951
952 @defun display-completion-list completions 952 @defun display-completion-list completions &optional common-substring
953 This function displays @var{completions} to the stream in 953 This function displays @var{completions} to the stream in
954 @code{standard-output}, usually a buffer. (@xref{Read and Print}, for more 954 @code{standard-output}, usually a buffer. (@xref{Read and Print}, for more
955 information about streams.) The argument @var{completions} is normally 955 information about streams.) The argument @var{completions} is normally
956 a list of completions just returned by @code{all-completions}, but it 956 a list of completions just returned by @code{all-completions}, but it
957 does not have to be. Each element may be a symbol or a string, either 957 does not have to be. Each element may be a symbol or a string, either
958 of which is simply printed. It can also be a list of two strings, 958 of which is simply printed. It can also be a list of two strings,
959 which is printed as if the strings were concatenated. The first of 959 which is printed as if the strings were concatenated. The first of
960 the two strings is the actual completion, the second string serves as 960 the two strings is the actual completion, the second string serves as
961 annotation. 961 annotation.
962 962
963 This function is called by @code{minibuffer-completion-help}. The 963 @var{common-substring} represents a string common prefix between all
964 completions. @var{common-substring} is used to put faces on
965 @samp{*Completions*} to enhance visual feedback of the buffer;
966 @code{display-completion-list} use faces to highlight what all completions
967 have in common and where they begin to differ. @var{common-substring}
968 specifies the common part.
969
970 This function is called by @code{minibuffer-completion-help}. The
964 most common way to use it is together with 971 most common way to use it is together with
965 @code{with-output-to-temp-buffer}, like this: 972 @code{with-output-to-temp-buffer}, like this:
966 973
967 @example 974 @example
968 (with-output-to-temp-buffer "*Completions*" 975 (with-output-to-temp-buffer "*Completions*"
969 (display-completion-list 976 (display-completion-list
970 (all-completions (buffer-string) my-alist))) 977 (all-completions (buffer-string) my-alist)
978 (buffer-string)))
971 @end example 979 @end example
972 @end defun 980 @end defun
973 981
974 @defopt completion-auto-help 982 @defopt completion-auto-help
975 If this variable is non-@code{nil}, the completion commands 983 If this variable is non-@code{nil}, the completion commands