Mercurial > emacs
comparison src/minibuf.c @ 71120:3c66cf4b4ded
(Vhistory_add_new_input): New variable.
(read_minibuf): Use it.
(syms_of_minibuf) <history-add-new-input>: New Lisp variable.
(syms_of_minibuf) <history-delete-duplicates>: Doc fix.
author | Juri Linkov <juri@jurta.org> |
---|---|
date | Wed, 31 May 2006 21:11:07 +0000 |
parents | f3ddca90b6b1 |
children | 1055c0769159 46b1096093f5 a8190f7e546e |
comparison
equal
deleted
inserted
replaced
71119:9c9b855e9a82 | 71120:3c66cf4b4ded |
---|---|
63 Lisp_Object Qhistory_length, Vhistory_length; | 63 Lisp_Object Qhistory_length, Vhistory_length; |
64 | 64 |
65 /* No duplicates in history. */ | 65 /* No duplicates in history. */ |
66 | 66 |
67 int history_delete_duplicates; | 67 int history_delete_duplicates; |
68 | |
69 /* Non-nil means add new input to history. */ | |
70 | |
71 Lisp_Object Vhistory_add_new_input; | |
68 | 72 |
69 /* Fread_minibuffer leaves the input here as a string. */ | 73 /* Fread_minibuffer leaves the input here as a string. */ |
70 | 74 |
71 Lisp_Object last_minibuf_string; | 75 Lisp_Object last_minibuf_string; |
72 | 76 |
751 histstring = defalt; | 755 histstring = defalt; |
752 else | 756 else |
753 histstring = Qnil; | 757 histstring = Qnil; |
754 | 758 |
755 /* Add the value to the appropriate history list, if any. */ | 759 /* Add the value to the appropriate history list, if any. */ |
756 if (SYMBOLP (Vminibuffer_history_variable) | 760 if (!NILP (Vhistory_add_new_input) |
761 && SYMBOLP (Vminibuffer_history_variable) | |
757 && !NILP (histstring)) | 762 && !NILP (histstring)) |
758 { | 763 { |
759 /* If the caller wanted to save the value read on a history list, | 764 /* If the caller wanted to save the value read on a history list, |
760 then do so if the value is not already the front of the list. */ | 765 then do so if the value is not already the front of the list. */ |
761 Lisp_Object histval; | 766 Lisp_Object histval; |
2798 XSETFASTINT (Vhistory_length, 30); | 2803 XSETFASTINT (Vhistory_length, 30); |
2799 | 2804 |
2800 DEFVAR_BOOL ("history-delete-duplicates", &history_delete_duplicates, | 2805 DEFVAR_BOOL ("history-delete-duplicates", &history_delete_duplicates, |
2801 doc: /* *Non-nil means to delete duplicates in history. | 2806 doc: /* *Non-nil means to delete duplicates in history. |
2802 If set to t when adding a new history element, all previous identical | 2807 If set to t when adding a new history element, all previous identical |
2803 elements are deleted. */); | 2808 elements are deleted from the history list. */); |
2804 history_delete_duplicates = 0; | 2809 history_delete_duplicates = 0; |
2810 | |
2811 DEFVAR_LISP ("history-add-new-input", &Vhistory_add_new_input, | |
2812 doc: /* *Non-nil means to add new elements in history. | |
2813 If set to nil, minibuffer reading functions don't add new elements to the | |
2814 history list, so it is possible to do this afterwards by calling | |
2815 `add-to-history' explicitly. */); | |
2816 Vhistory_add_new_input = Qt; | |
2805 | 2817 |
2806 DEFVAR_LISP ("completion-auto-help", &Vcompletion_auto_help, | 2818 DEFVAR_LISP ("completion-auto-help", &Vcompletion_auto_help, |
2807 doc: /* *Non-nil means automatically provide help for invalid completion input. | 2819 doc: /* *Non-nil means automatically provide help for invalid completion input. |
2808 Under Partial Completion mode, a non-nil, non-t value has a special meaning; | 2820 Under Partial Completion mode, a non-nil, non-t value has a special meaning; |
2809 see the doc string of `partial-completion-mode' for more details. */); | 2821 see the doc string of `partial-completion-mode' for more details. */); |