aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2006-09-02 11:21:55 +0000
committerEli Zaretskii2006-09-02 11:21:55 +0000
commitff137f16c3913d0fa83d3ed6d89a5e0bff0fb01b (patch)
tree07517c36d099ddc648d25a2ef2eb3317f63e169a /src
parent343d662867f2ad217c55e174ee5a58f0659543de (diff)
downloademacs-ff137f16c3913d0fa83d3ed6d89a5e0bff0fb01b.tar.gz
emacs-ff137f16c3913d0fa83d3ed6d89a5e0bff0fb01b.zip
(Finternal_complete_buffer): New function.
(syms_of_minibuf): Defsubr it. (Fread_buffer): Use it, instead of Vbuffer_alist.
Diffstat (limited to 'src')
-rw-r--r--src/minibuf.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/minibuf.c b/src/minibuf.c
index 9c56ea8618e..a5ad7077dbe 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1149,6 +1149,24 @@ A user variable is one for which `user-variable-p' returns non-nil. */)
1149 return Fintern (name, Qnil); 1149 return Fintern (name, Qnil);
1150} 1150}
1151 1151
1152DEFUN ("internal-complete-buffer", Finternal_complete_buffer, Sinternal_complete_buffer, 3, 3, 0,
1153 doc: /* Perform completion on buffer names.
1154If the argument FLAG is nil, invoke `try-completion', if it's t, invoke
1155`all-completions', otherwise invoke `test-completion'.
1156
1157The 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
1152DEFUN ("read-buffer", Fread_buffer, Sread_buffer, 1, 3, 0, 1170DEFUN ("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.
1154Prompt with PROMPT. 1172Prompt with PROMPT.
@@ -1195,8 +1213,8 @@ The argument PROMPT should be a string ending with a colon and a space. */)
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
@@ -2915,6 +2933,7 @@ properties. */);
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);