415 |
match the front of that history list exactly. The value is pushed onto |
match the front of that history list exactly. The value is pushed onto |
416 |
the list as the string that was read. |
the list as the string that was read. |
417 |
|
|
418 |
DEFALT specifies te default value for the sake of history commands. |
DEFALT specifies the default value for the sake of history commands. |
419 |
|
|
420 |
If ALLOW_PROPS is nonzero, we do not throw away text properties. |
If ALLOW_PROPS is nonzero, we do not throw away text properties. |
421 |
|
|
441 |
Lisp_Object mini_frame, ambient_dir, minibuffer, input_method; |
Lisp_Object mini_frame, ambient_dir, minibuffer, input_method; |
442 |
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; |
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; |
443 |
Lisp_Object enable_multibyte; |
Lisp_Object enable_multibyte; |
444 |
|
|
445 |
|
/* String to add to the history. */ |
446 |
|
Lisp_Object histstring; |
447 |
|
|
448 |
extern Lisp_Object Qfront_sticky; |
extern Lisp_Object Qfront_sticky; |
449 |
extern Lisp_Object Qrear_nonsticky; |
extern Lisp_Object Qrear_nonsticky; |
450 |
|
|
679 |
|
|
680 |
last_minibuf_string = val; |
last_minibuf_string = val; |
681 |
|
|
682 |
/* Add the value to the appropriate history list unless it is empty. */ |
/* Choose the string to add to the history. */ |
683 |
if (SCHARS (val) != 0 |
if (SCHARS (val) != 0) |
684 |
&& SYMBOLP (Vminibuffer_history_variable)) |
histstring = val; |
685 |
|
else if (STRINGP (defalt)) |
686 |
|
histstring = defalt; |
687 |
|
else |
688 |
|
histstring = Qnil; |
689 |
|
|
690 |
|
/* Add the value to the appropriate history list, if any. */ |
691 |
|
if (SYMBOLP (Vminibuffer_history_variable) |
692 |
|
&& !NILP (histstring)) |
693 |
{ |
{ |
694 |
/* If the caller wanted to save the value read on a history list, |
/* If the caller wanted to save the value read on a history list, |
695 |
then do so if the value is not already the front of the list. */ |
then do so if the value is not already the front of the list. */ |
703 |
|
|
704 |
/* The value of the history variable must be a cons or nil. Other |
/* The value of the history variable must be a cons or nil. Other |
705 |
values are unacceptable. We silently ignore these values. */ |
values are unacceptable. We silently ignore these values. */ |
706 |
|
|
707 |
if (NILP (histval) |
if (NILP (histval) |
708 |
|| (CONSP (histval) |
|| (CONSP (histval) |
709 |
&& NILP (Fequal (last_minibuf_string, Fcar (histval))))) |
/* Don't duplicate the most recent entry in the history. */ |
710 |
|
&& NILP (Fequal (histstring, Fcar (histval))))) |
711 |
{ |
{ |
712 |
Lisp_Object length; |
Lisp_Object length; |
713 |
|
|
714 |
histval = Fcons (last_minibuf_string, histval); |
histval = Fcons (histstring, histval); |
715 |
Fset (Vminibuffer_history_variable, histval); |
Fset (Vminibuffer_history_variable, histval); |
716 |
|
|
717 |
/* Truncate if requested. */ |
/* Truncate if requested. */ |
2072 |
i++; |
i++; |
2073 |
buffer_nchars--; |
buffer_nchars--; |
2074 |
} |
} |
2075 |
del_range (1, i + 1); |
del_range (start_pos, start_pos + buffer_nchars); |
2076 |
} |
} |
2077 |
UNGCPRO; |
UNGCPRO; |
2078 |
} |
} |