Commit 7c8d9931 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(Fread_variable): If DEFAULT_VALUE is symbol, use its name.

(Fread_command): Likewise.
parent eded5b68
...@@ -756,9 +756,20 @@ Prompts with PROMPT. By default, return DEFAULT-VALUE.") ...@@ -756,9 +756,20 @@ Prompts with PROMPT. By default, return DEFAULT-VALUE.")
(prompt, default_value) (prompt, default_value)
Lisp_Object prompt, default_value; Lisp_Object prompt, default_value;
{ {
return Fintern (Fcompleting_read (prompt, Vobarray, Qcommandp, Qt, Lisp_Object name, default_string;
Qnil, Qnil, default_value, Qnil),
Qnil); if (NILP (default_value))
default_string = Qnil;
else if (SYMBOLP (default_value))
default_string = XSYMBOL (default_value)->name;
else
default_string = default_value;
name = Fcompleting_read (prompt, Vobarray, Qcommandp, Qt,
Qnil, Qnil, default_string, Qnil);
if (NILP (name))
return name;
return Fintern (name, Qnil);
} }
#ifdef NOTDEF #ifdef NOTDEF
...@@ -780,10 +791,21 @@ A user variable is one whose documentation starts with a `*' character.") ...@@ -780,10 +791,21 @@ A user variable is one whose documentation starts with a `*' character.")
(prompt, default_value) (prompt, default_value)
Lisp_Object prompt, default_value; Lisp_Object prompt, default_value;
{ {
return Fintern (Fcompleting_read (prompt, Vobarray, Lisp_Object name, default_string;
Quser_variable_p, Qt,
Qnil, Qnil, default_value, Qnil), if (NILP (default_value))
Qnil); default_string = Qnil;
else if (SYMBOLP (default_value))
default_string = XSYMBOL (default_value)->name;
else
default_string = default_value;
name = Fcompleting_read (prompt, Vobarray,
Quser_variable_p, Qt,
Qnil, Qnil, default_string, Qnil);
if (NILP (name))
return name;
return Fintern (name, Qnil);
} }
DEFUN ("read-buffer", Fread_buffer, Sread_buffer, 1, 3, 0, DEFUN ("read-buffer", Fread_buffer, Sread_buffer, 1, 3, 0,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment