[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/minibuf.c,v
From: |
Juri Linkov |
Subject: |
[Emacs-diffs] Changes to emacs/src/minibuf.c,v |
Date: |
Mon, 22 Oct 2007 00:19:52 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Juri Linkov <jurta> 07/10/22 00:19:52
Index: minibuf.c
===================================================================
RCS file: /sources/emacs/emacs/src/minibuf.c,v
retrieving revision 1.336
retrieving revision 1.337
diff -u -b -r1.336 -r1.337
--- minibuf.c 17 Oct 2007 23:43:51 -0000 1.336
+++ minibuf.c 22 Oct 2007 00:19:51 -0000 1.337
@@ -257,9 +257,13 @@
GCPRO2 (val, defalt);
- if (STRINGP (val) && SCHARS (val) == 0
- && STRINGP (defalt))
+ if (STRINGP (val) && SCHARS (val) == 0)
+ {
+ if (STRINGP (defalt))
val = defalt;
+ else if (CONSP (defalt) && STRINGP (XCAR (defalt)))
+ val = XCAR (defalt);
+ }
expr_and_pos = Fread_from_string (val, Qnil, Qnil);
pos = XINT (Fcdr (expr_and_pos));
@@ -337,7 +341,7 @@
/* If Lisp form desired instead of string, parse it. */
if (expflag)
- val = string_to_object (val, defalt);
+ val = string_to_object (val, CONSP (defalt) ? XCAR (defalt) : defalt);
return val;
}
@@ -785,6 +789,8 @@
histstring = val;
else if (STRINGP (defalt))
histstring = defalt;
+ else if (CONSP (defalt) && STRINGP (XCAR (defalt)))
+ histstring = XCAR (defalt);
else
histstring = Qnil;
@@ -1102,7 +1108,7 @@
Qnil, history, default_value,
inherit_input_method);
if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (default_value))
- val = default_value;
+ val = CONSP (default_value) ? XCAR (default_value) : default_value;
return val;
}
@@ -1225,7 +1231,7 @@
args[0] = build_string ("%s (default %s): ");
args[1] = prompt;
- args[2] = def;
+ args[2] = CONSP (def) ? XCAR (def) : def;
prompt = Fformat (3, args);
}
@@ -1835,7 +1841,7 @@
!NILP (inherit_input_method));
if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (def))
- val = def;
+ val = CONSP (def) ? XCAR (def) : def;
RETURN_UNGCPRO (unbind_to (count, val));
}