changeset 20478:d14360d1f6ed

(Fread_variable): If DEFAULT_VALUE is symbol, use its name. (Fread_command): Likewise.
author Richard M. Stallman <rms@gnu.org>
date Sun, 21 Dec 1997 01:44:07 +0000
parents 6423efca2ea9
children ae6b11cadfc6
files src/minibuf.c
diffstat 1 files changed, 29 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/minibuf.c	Sun Dec 21 01:41:43 1997 +0000
+++ b/src/minibuf.c	Sun Dec 21 01:44:07 1997 +0000
@@ -756,9 +756,20 @@
   (prompt, default_value)
      Lisp_Object prompt, default_value;
 {
-  return Fintern (Fcompleting_read (prompt, Vobarray, Qcommandp, Qt,
-				    Qnil, Qnil, default_value, Qnil),
-		  Qnil);
+  Lisp_Object name, default_string;
+
+  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
@@ -780,10 +791,21 @@
   (prompt, default_value)
      Lisp_Object prompt, default_value;
 {
-  return Fintern (Fcompleting_read (prompt, Vobarray,
-				    Quser_variable_p, Qt,
-				    Qnil, Qnil, default_value, Qnil),
-		  Qnil);
+  Lisp_Object name, default_string;
+
+  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,
+			   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,