Mercurial > emacs
comparison src/minibuf.c @ 9615:f696aae6c5e0
(read_minibuf): Undo previous change.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 20 Oct 1994 04:37:03 +0000 |
parents | 99d523cdb0ea |
children | 6ee76b67cbfa |
comparison
equal
deleted
inserted
replaced
9614:e466cdfd962e | 9615:f696aae6c5e0 |
---|---|
267 bcopy (GAP_END_ADDR, XSTRING (val)->data + GPT - BEG, Z - GPT); | 267 bcopy (GAP_END_ADDR, XSTRING (val)->data + GPT - BEG, Z - GPT); |
268 | 268 |
269 /* VAL is the string of minibuffer text. */ | 269 /* VAL is the string of minibuffer text. */ |
270 last_minibuf_string = val; | 270 last_minibuf_string = val; |
271 | 271 |
272 /* Add the value to the appropriate history list unless it is empty. */ | |
273 if (XSTRING (val)->size != 0 | |
274 && SYMBOLP (Vminibuffer_history_variable) | |
275 && ! EQ (XSYMBOL (Vminibuffer_history_variable)->value, Qunbound)) | |
276 { | |
277 /* If the caller wanted to save the value read on a history list, | |
278 then do so if the value is not already the front of the list. */ | |
279 Lisp_Object histval; | |
280 histval = Fsymbol_value (Vminibuffer_history_variable); | |
281 | |
282 /* The value of the history variable must be a cons or nil. Other | |
283 values are unacceptable. We silently ignore these values. */ | |
284 if (NILP (histval) | |
285 || (CONSP (histval) | |
286 && NILP (Fequal (last_minibuf_string, Fcar (histval))))) | |
287 Fset (Vminibuffer_history_variable, | |
288 Fcons (last_minibuf_string, histval)); | |
289 } | |
290 | |
272 /* If Lisp form desired instead of string, parse it. */ | 291 /* If Lisp form desired instead of string, parse it. */ |
273 if (expflag) | 292 if (expflag) |
274 { | 293 { |
275 Lisp_Object expr_and_pos; | 294 Lisp_Object expr_and_pos; |
276 unsigned char *p; | 295 unsigned char *p; |
279 /* Ignore trailing whitespace; any other trailing junk is an error. */ | 298 /* Ignore trailing whitespace; any other trailing junk is an error. */ |
280 for (p = XSTRING (val)->data + XINT (Fcdr (expr_and_pos)); *p; p++) | 299 for (p = XSTRING (val)->data + XINT (Fcdr (expr_and_pos)); *p; p++) |
281 if (*p != ' ' && *p != '\t' && *p != '\n') | 300 if (*p != ' ' && *p != '\t' && *p != '\n') |
282 error ("Trailing garbage following expression"); | 301 error ("Trailing garbage following expression"); |
283 val = Fcar (expr_and_pos); | 302 val = Fcar (expr_and_pos); |
284 } | |
285 | |
286 /* Add the value to the appropriate history list unless it is empty. */ | |
287 if (XSTRING (last_minibuf_string)->size != 0 | |
288 && SYMBOLP (Vminibuffer_history_variable) | |
289 && ! EQ (XSYMBOL (Vminibuffer_history_variable)->value, Qunbound)) | |
290 { | |
291 /* If the caller wanted to save the value read on a history list, | |
292 then do so if the value is not already the front of the list. */ | |
293 Lisp_Object histval; | |
294 histval = Fsymbol_value (Vminibuffer_history_variable); | |
295 | |
296 /* The value of the history variable must be a cons or nil. Other | |
297 values are unacceptable. We silently ignore these values. */ | |
298 if (NILP (histval) | |
299 || (CONSP (histval) && NILP (Fequal (val, XCONS (histval)->car)))) | |
300 Fset (Vminibuffer_history_variable, Fcons (val, histval)); | |
301 } | 303 } |
302 | 304 |
303 return unbind_to (count, val); /* The appropriate frame will get selected | 305 return unbind_to (count, val); /* The appropriate frame will get selected |
304 in set-window-configuration. */ | 306 in set-window-configuration. */ |
305 } | 307 } |