Mercurial > emacs
comparison src/minibuf.c @ 5069:47cc31b47402
(read_minibuf): History list always gets strings,
not Lisp objects made by read.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 19 Nov 1993 17:44:23 +0000 |
parents | eaf67474339b |
children | 63932e111cc5 |
comparison
equal
deleted
inserted
replaced
5068:9a42f23df119 | 5069:47cc31b47402 |
---|---|
257 bcopy (GAP_END_ADDR, XSTRING (val)->data + GPT - BEG, Z - GPT); | 257 bcopy (GAP_END_ADDR, XSTRING (val)->data + GPT - BEG, Z - GPT); |
258 | 258 |
259 /* VAL is the string of minibuffer text. */ | 259 /* VAL is the string of minibuffer text. */ |
260 last_minibuf_string = val; | 260 last_minibuf_string = val; |
261 | 261 |
262 /* Add the value to the appropriate history list. */ | |
263 if (XTYPE (Vminibuffer_history_variable) == Lisp_Symbol | |
264 && ! EQ (XSYMBOL (Vminibuffer_history_variable)->value, Qunbound)) | |
265 { | |
266 /* If the caller wanted to save the value read on a history list, | |
267 then do so if the value is not already the front of the list. */ | |
268 Lisp_Object histval; | |
269 histval = Fsymbol_value (Vminibuffer_history_variable); | |
270 | |
271 /* The value of the history variable must be a cons or nil. Other | |
272 values are unacceptable. We silently ignore these values. */ | |
273 if (NILP (histval) | |
274 || (CONSP (histval) | |
275 && NILP (Fequal (last_minibuf_string, Fcar (histval))))) | |
276 Fset (Vminibuffer_history_variable, | |
277 Fcons (last_minibuf_string, histval)); | |
278 } | |
279 | |
262 /* If Lisp form desired instead of string, parse it. */ | 280 /* If Lisp form desired instead of string, parse it. */ |
263 if (expflag) | 281 if (expflag) |
264 val = Fread (val); | 282 val = Fread (val); |
265 | |
266 /* Add the value to the appropriate history list. */ | |
267 if (XTYPE (Vminibuffer_history_variable) == Lisp_Symbol | |
268 && ! EQ (XSYMBOL (Vminibuffer_history_variable)->value, Qunbound)) | |
269 { | |
270 /* If the caller wanted to save the value read on a history list, | |
271 then do so if the value is not already the front of the list. */ | |
272 Lisp_Object histval = Fsymbol_value (Vminibuffer_history_variable); | |
273 | |
274 /* The value of the history variable must be a cons or nil. Other | |
275 values are unacceptable. We silenty ignore these values. */ | |
276 if (NILP (histval) | |
277 || (CONSP (histval) && NILP (Fequal (val, Fcar (histval))))) | |
278 Fset (Vminibuffer_history_variable, Fcons (val, histval)); | |
279 } | |
280 | 283 |
281 unbind_to (count, Qnil); /* The appropriate frame will get selected | 284 unbind_to (count, Qnil); /* The appropriate frame will get selected |
282 in set-window-configuration. */ | 285 in set-window-configuration. */ |
283 | 286 |
284 UNGCPRO; | 287 UNGCPRO; |