comparison lispref/minibuf.texi @ 65758:028c8f536edb

(High-Level Completion): Explain that the prompt given to `read-buffer' should end with a colon and a space. Update usage examples.
author Romain Francoise <romain@orebokech.com>
date Fri, 30 Sep 2005 18:30:10 +0000
parents e836425ee789
children 448890268bf7 aa89c814f853
comparison
equal deleted inserted replaced
65757:ee26002f84d8 65758:028c8f536edb
1042 The argument @var{default} is the default name to use, the value to 1042 The argument @var{default} is the default name to use, the value to
1043 return if the user exits with an empty minibuffer. If non-@code{nil}, 1043 return if the user exits with an empty minibuffer. If non-@code{nil},
1044 it should be a string or a buffer. It is mentioned in the prompt, but 1044 it should be a string or a buffer. It is mentioned in the prompt, but
1045 is not inserted in the minibuffer as initial input. 1045 is not inserted in the minibuffer as initial input.
1046 1046
1047 The argument @var{prompt} should be a string ending with a colon and a
1048 space. If @var{default} is non-@code{nil}, the function inserts it in
1049 @var{prompt} before the colon to follow the convention for reading from
1050 the minibuffer with a default value (@pxref{Programming Tips}).
1051
1047 If @var{existing} is non-@code{nil}, then the name specified must be 1052 If @var{existing} is non-@code{nil}, then the name specified must be
1048 that of an existing buffer. The usual commands to exit the minibuffer 1053 that of an existing buffer. The usual commands to exit the minibuffer
1049 do not exit if the text is not valid, and @key{RET} does completion to 1054 do not exit if the text is not valid, and @key{RET} does completion to
1050 attempt to find a valid name. If @var{existing} is neither @code{nil} 1055 attempt to find a valid name. If @var{existing} is neither @code{nil}
1051 nor @code{t}, confirmation is required after completion. (However, 1056 nor @code{t}, confirmation is required after completion. (However,
1056 then types @key{RET}. The argument @var{existing} is @code{t}, and the 1061 then types @key{RET}. The argument @var{existing} is @code{t}, and the
1057 only buffer name starting with the given input is 1062 only buffer name starting with the given input is
1058 @samp{minibuffer.texi}, so that name is the value. 1063 @samp{minibuffer.texi}, so that name is the value.
1059 1064
1060 @example 1065 @example
1061 (read-buffer "Buffer name? " "foo" t) 1066 (read-buffer "Buffer name: " "foo" t)
1062 @group 1067 @group
1063 ;; @r{After evaluation of the preceding expression,} 1068 ;; @r{After evaluation of the preceding expression,}
1064 ;; @r{the following prompt appears,} 1069 ;; @r{the following prompt appears,}
1065 ;; @r{with an empty minibuffer:} 1070 ;; @r{with an empty minibuffer:}
1066 @end group 1071 @end group
1067 1072
1068 @group 1073 @group
1069 ---------- Buffer: Minibuffer ---------- 1074 ---------- Buffer: Minibuffer ----------
1070 Buffer name? (default foo) @point{} 1075 Buffer name (default foo): @point{}
1071 ---------- Buffer: Minibuffer ---------- 1076 ---------- Buffer: Minibuffer ----------
1072 @end group 1077 @end group
1073 1078
1074 @group 1079 @group
1075 ;; @r{The user types @kbd{minibuffer.t @key{RET}}.} 1080 ;; @r{The user types @kbd{minibuffer.t @key{RET}}.}