/* Minibuffer input and completion.
Copyright (C) 1985, 1986, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005,
/* Minibuffer input and completion.
Copyright (C) 1985, 1986, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005,
expr_and_pos = Fread_from_string (val, Qnil, Qnil);
pos = XINT (Fcdr (expr_and_pos));
expr_and_pos = Fread_from_string (val, Qnil, Qnil);
pos = XINT (Fcdr (expr_and_pos));
doc: /* Return a Lisp object read using the minibuffer, unevaluated.
Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS
is a string to insert in the minibuffer before reading.
doc: /* Return a Lisp object read using the minibuffer, unevaluated.
Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS
is a string to insert in the minibuffer before reading.
-\(INITIAL-CONTENTS can also be a cons of a string and an integer. Such
-arguments are used as in `read-from-minibuffer'.) */)
+\(INITIAL-CONTENTS can also be a cons of a string and an integer.
+Such arguments are used as in `read-from-minibuffer'.) */)
(prompt, initial_contents)
Lisp_Object prompt, initial_contents;
{
(prompt, initial_contents)
Lisp_Object prompt, initial_contents;
{
doc: /* Return value of Lisp expression read using the minibuffer.
Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS
is a string to insert in the minibuffer before reading.
doc: /* Return value of Lisp expression read using the minibuffer.
Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS
is a string to insert in the minibuffer before reading.
-\(INITIAL-CONTENTS can also be a cons of a string and an integer. Such
-arguments are used as in `read-from-minibuffer'.) */)
+\(INITIAL-CONTENTS can also be a cons of a string and an integer.
+Such arguments are used as in `read-from-minibuffer'.) */)
(prompt, initial_contents)
Lisp_Object prompt, initial_contents;
{
(prompt, initial_contents)
Lisp_Object prompt, initial_contents;
{
Qnil, history, default_value,
inherit_input_method);
if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (default_value))
Qnil, history, default_value,
inherit_input_method);
if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (default_value))
- int type = (HASH_TABLE_P (collection) ? 3
- : VECTORP (collection) ? 2
- : NILP (collection) || (CONSP (collection)
- && (!SYMBOLP (XCAR (collection))
- || NILP (XCAR (collection)))));
+ enum { function_table, list_table, obarray_table, hash_table}
+ type = (HASH_TABLE_P (collection) ? hash_table
+ : VECTORP (collection) ? obarray_table
+ : ((NILP (collection)
+ || (CONSP (collection)
+ && (!SYMBOLP (XCAR (collection))
+ || NILP (XCAR (collection)))))
+ ? list_table : function_table));
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
CHECK_STRING (string);
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
CHECK_STRING (string);
return call3 (collection, string, predicate, Qnil);
bestmatch = bucket = Qnil;
return call3 (collection, string, predicate, Qnil);
bestmatch = bucket = Qnil;
{
while (index < HASH_TABLE_SIZE (XHASH_TABLE (collection))
&& NILP (HASH_HASH (XHASH_TABLE (collection), index)))
{
while (index < HASH_TABLE_SIZE (XHASH_TABLE (collection))
&& NILP (HASH_HASH (XHASH_TABLE (collection), index)))
GCPRO4 (tail, string, eltstring, bestmatch);
GCPRO4 (tail, string, eltstring, bestmatch);
- tem = type == 3
- ? call2 (predicate, elt,
- HASH_VALUE (XHASH_TABLE (collection), index - 1))
- : call1 (predicate, elt);
+ tem = (type == hash_table
+ ? call2 (predicate, elt,
+ HASH_VALUE (XHASH_TABLE (collection),
+ index - 1))
+ : call1 (predicate, elt));
/* Now find first word-break in the stuff found by completion.
i gets index in string of where to stop completing. */
/* Now find first word-break in the stuff found by completion.
i gets index in string of where to stop completing. */
- {
- int len, c;
- int bytes = SBYTES (completion);
- register const unsigned char *completion_string = SDATA (completion);
- for (; i_byte < SBYTES (completion); i_byte += len, i++)
- {
- c = STRING_CHAR_AND_LENGTH (completion_string + i_byte,
- bytes - i_byte,
- len);
- if (SYNTAX (c) != Sword)
- {
- i_byte += len;
- i++;
- break;
- }
- }
- }
+ while (i_byte < SBYTES (completion))
+ {
+ int c;
+
+ FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE (c, completion, i, i_byte);
+ if (SYNTAX (c) != Sword)
+ break;
+ }
Qread_file_name_internal = intern ("read-file-name-internal");
staticpro (&Qread_file_name_internal);
Qread_file_name_internal = intern ("read-file-name-internal");
staticpro (&Qread_file_name_internal);