]> git.eshelyaron.com Git - emacs.git/commitdiff
(read_minibuf): History list always gets strings,
authorRichard M. Stallman <rms@gnu.org>
Fri, 19 Nov 1993 17:44:23 +0000 (17:44 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 19 Nov 1993 17:44:23 +0000 (17:44 +0000)
not Lisp objects made by read.

src/minibuf.c

index e951f0bf66bd4809efc889fc94042713ba7089ed..dc13d641a57b750d3b8d63604b2f7b7feb4f5dc6 100644 (file)
@@ -259,25 +259,28 @@ read_minibuf (map, initial, prompt, backup_n, expflag, histvar, histpos)
   /* VAL is the string of minibuffer text.  */
   last_minibuf_string = val;
 
-  /* If Lisp form desired instead of string, parse it. */
-  if (expflag)
-    val = Fread (val);
-
   /* Add the value to the appropriate history list.  */
   if (XTYPE (Vminibuffer_history_variable) == Lisp_Symbol
       && ! EQ (XSYMBOL (Vminibuffer_history_variable)->value, Qunbound))
     {
       /* If the caller wanted to save the value read on a history list,
-        then do so if the value is not already the front of the list. */
-      Lisp_Object histval = Fsymbol_value (Vminibuffer_history_variable);
+        then do so if the value is not already the front of the list.  */
+      Lisp_Object histval;
+      histval = Fsymbol_value (Vminibuffer_history_variable);
 
       /* The value of the history variable must be a cons or nil.  Other
-        values are unacceptable.  We silenty ignore these values. */
+        values are unacceptable.  We silently ignore these values.  */
       if (NILP (histval)
-         || (CONSP (histval) && NILP (Fequal (val, Fcar (histval)))))
-       Fset (Vminibuffer_history_variable, Fcons (val, histval));
+         || (CONSP (histval)
+             && NILP (Fequal (last_minibuf_string, Fcar (histval)))))
+       Fset (Vminibuffer_history_variable,
+             Fcons (last_minibuf_string, histval));
     }
 
+  /* If Lisp form desired instead of string, parse it. */
+  if (expflag)
+    val = Fread (val);
+
   unbind_to (count, Qnil);     /* The appropriate frame will get selected
                                   in set-window-configuration.  */