From 9f6131cfa00eb9046a77a74d5fc3e2d8b24c2b9e Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 20 Oct 1994 04:37:03 +0000 Subject: [PATCH] (read_minibuf): Undo previous change. --- src/minibuf.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/minibuf.c b/src/minibuf.c index d63ed473161..f83e9ac8499 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -269,22 +269,8 @@ 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) - { - Lisp_Object expr_and_pos; - unsigned char *p; - - expr_and_pos = Fread_from_string (val, Qnil, Qnil); - /* Ignore trailing whitespace; any other trailing junk is an error. */ - for (p = XSTRING (val)->data + XINT (Fcdr (expr_and_pos)); *p; p++) - if (*p != ' ' && *p != '\t' && *p != '\n') - error ("Trailing garbage following expression"); - val = Fcar (expr_and_pos); - } - /* Add the value to the appropriate history list unless it is empty. */ - if (XSTRING (last_minibuf_string)->size != 0 + if (XSTRING (val)->size != 0 && SYMBOLP (Vminibuffer_history_variable) && ! EQ (XSYMBOL (Vminibuffer_history_variable)->value, Qunbound)) { @@ -296,8 +282,24 @@ read_minibuf (map, initial, prompt, backup_n, expflag, histvar, histpos) /* The value of the history variable must be a cons or nil. Other values are unacceptable. We silently ignore these values. */ if (NILP (histval) - || (CONSP (histval) && NILP (Fequal (val, XCONS (histval)->car)))) - 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) + { + Lisp_Object expr_and_pos; + unsigned char *p; + + expr_and_pos = Fread_from_string (val, Qnil, Qnil); + /* Ignore trailing whitespace; any other trailing junk is an error. */ + for (p = XSTRING (val)->data + XINT (Fcdr (expr_and_pos)); *p; p++) + if (*p != ' ' && *p != '\t' && *p != '\n') + error ("Trailing garbage following expression"); + val = Fcar (expr_and_pos); } return unbind_to (count, val); /* The appropriate frame will get selected -- 2.39.5