comparison src/minibuf.c @ 72606:18e29ef6d5d7

(Finternal_complete_buffer): New function. (syms_of_minibuf): Defsubr it. (Fread_buffer): Use it, instead of Vbuffer_alist.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 02 Sep 2006 11:21:55 +0000
parents c0e01e860d99
children 760e84d650e1
comparison
equal deleted inserted replaced
72605:de654a6735da 72606:18e29ef6d5d7
1147 if (NILP (name)) 1147 if (NILP (name))
1148 return name; 1148 return name;
1149 return Fintern (name, Qnil); 1149 return Fintern (name, Qnil);
1150 } 1150 }
1151 1151
1152 DEFUN ("internal-complete-buffer", Finternal_complete_buffer, Sinternal_complete_buffer, 3, 3, 0,
1153 doc: /* Perform completion on buffer names.
1154 If the argument FLAG is nil, invoke `try-completion', if it's t, invoke
1155 `all-completions', otherwise invoke `test-completion'.
1156
1157 The arguments STRING and PREDICATE are as in `try-completion',
1158 `all-completions', and `test-completion'. */)
1159 (string, predicate, flag)
1160 Lisp_Object string, predicate, flag;
1161 {
1162 if (NILP (flag))
1163 return Ftry_completion (string, Vbuffer_alist, predicate);
1164 else if (EQ (flag, Qt))
1165 return Fall_completions (string, Vbuffer_alist, predicate, Qt);
1166 else /* assume `lambda' */
1167 return Ftest_completion (string, Vbuffer_alist, predicate);
1168 }
1169
1152 DEFUN ("read-buffer", Fread_buffer, Sread_buffer, 1, 3, 0, 1170 DEFUN ("read-buffer", Fread_buffer, Sread_buffer, 1, 3, 0,
1153 doc: /* Read the name of a buffer and return as a string. 1171 doc: /* Read the name of a buffer and return as a string.
1154 Prompt with PROMPT. 1172 Prompt with PROMPT.
1155 Optional second arg DEF is value to return if user enters an empty line. 1173 Optional second arg DEF is value to return if user enters an empty line.
1156 If optional third arg REQUIRE-MATCH is non-nil, 1174 If optional third arg REQUIRE-MATCH is non-nil,
1193 args[1] = prompt; 1211 args[1] = prompt;
1194 args[2] = def; 1212 args[2] = def;
1195 prompt = Fformat (3, args); 1213 prompt = Fformat (3, args);
1196 } 1214 }
1197 1215
1198 return Fcompleting_read (prompt, Vbuffer_alist, Qnil, 1216 return Fcompleting_read (prompt, intern ("internal-complete-buffer"),
1199 require_match, Qnil, Qbuffer_name_history, 1217 Qnil, require_match, Qnil, Qbuffer_name_history,
1200 def, Qnil); 1218 def, Qnil);
1201 } 1219 }
1202 else 1220 else
1203 { 1221 {
1204 args[0] = Vread_buffer_function; 1222 args[0] = Vread_buffer_function;
2913 defsubr (&Seval_minibuffer); 2931 defsubr (&Seval_minibuffer);
2914 defsubr (&Sread_minibuffer); 2932 defsubr (&Sread_minibuffer);
2915 defsubr (&Sread_string); 2933 defsubr (&Sread_string);
2916 defsubr (&Sread_command); 2934 defsubr (&Sread_command);
2917 defsubr (&Sread_variable); 2935 defsubr (&Sread_variable);
2936 defsubr (&Sinternal_complete_buffer);
2918 defsubr (&Sread_buffer); 2937 defsubr (&Sread_buffer);
2919 defsubr (&Sread_no_blanks_input); 2938 defsubr (&Sread_no_blanks_input);
2920 defsubr (&Sminibuffer_depth); 2939 defsubr (&Sminibuffer_depth);
2921 defsubr (&Sminibuffer_prompt); 2940 defsubr (&Sminibuffer_prompt);
2922 2941