diff options
| author | Juri Linkov | 2004-09-08 20:06:13 +0000 |
|---|---|---|
| committer | Juri Linkov | 2004-09-08 20:06:13 +0000 |
| commit | 0da4d471d931cc4454544fd64a18fcc6f1183a14 (patch) | |
| tree | 09ae6cbcf1a98e7fd8241f1393405c94380380b7 /src | |
| parent | e79f14a42e6914d5ad7d01ab055189dea48bc196 (diff) | |
| download | emacs-0da4d471d931cc4454544fd64a18fcc6f1183a14.tar.gz emacs-0da4d471d931cc4454544fd64a18fcc6f1183a14.zip | |
(history_delete_duplicates): New variable.
(read_minibuf): Use it.
(syms_of_minibuf): Create the corresponding lisp variable.
Diffstat (limited to 'src')
| -rw-r--r-- | src/minibuf.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/minibuf.c b/src/minibuf.c index d50e7404ab3..09e5675d68e 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -61,6 +61,10 @@ Lisp_Object Vcompletion_auto_help; | |||
| 61 | 61 | ||
| 62 | Lisp_Object Qhistory_length, Vhistory_length; | 62 | Lisp_Object Qhistory_length, Vhistory_length; |
| 63 | 63 | ||
| 64 | /* No duplicates in history. */ | ||
| 65 | |||
| 66 | int history_delete_duplicates; | ||
| 67 | |||
| 64 | /* Fread_minibuffer leaves the input here as a string. */ | 68 | /* Fread_minibuffer leaves the input here as a string. */ |
| 65 | 69 | ||
| 66 | Lisp_Object last_minibuf_string; | 70 | Lisp_Object last_minibuf_string; |
| @@ -749,6 +753,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag, | |||
| 749 | { | 753 | { |
| 750 | Lisp_Object length; | 754 | Lisp_Object length; |
| 751 | 755 | ||
| 756 | if (history_delete_duplicates) Fdelete (histstring, histval); | ||
| 752 | histval = Fcons (histstring, histval); | 757 | histval = Fcons (histstring, histval); |
| 753 | Fset (Vminibuffer_history_variable, histval); | 758 | Fset (Vminibuffer_history_variable, histval); |
| 754 | 759 | ||
| @@ -2668,6 +2673,12 @@ just after a new element is inserted. Setting the history-length | |||
| 2668 | property of a history variable overrides this default. */); | 2673 | property of a history variable overrides this default. */); |
| 2669 | XSETFASTINT (Vhistory_length, 30); | 2674 | XSETFASTINT (Vhistory_length, 30); |
| 2670 | 2675 | ||
| 2676 | DEFVAR_BOOL ("history-delete-duplicates", &history_delete_duplicates, | ||
| 2677 | doc: /* *Non-nil means to delete duplicates in history. | ||
| 2678 | If set to t when adding a new history element, all previous identical | ||
| 2679 | elements are deleted. */); | ||
| 2680 | history_delete_duplicates = 0; | ||
| 2681 | |||
| 2671 | DEFVAR_LISP ("completion-auto-help", &Vcompletion_auto_help, | 2682 | DEFVAR_LISP ("completion-auto-help", &Vcompletion_auto_help, |
| 2672 | doc: /* *Non-nil means automatically provide help for invalid completion input. */); | 2683 | doc: /* *Non-nil means automatically provide help for invalid completion input. */); |
| 2673 | Vcompletion_auto_help = Qt; | 2684 | Vcompletion_auto_help = Qt; |