From: Juri Linkov Date: Wed, 8 Sep 2004 20:06:13 +0000 (+0000) Subject: (history_delete_duplicates): New variable. X-Git-Tag: ttn-vms-21-2-B4~4992 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0da4d471d931cc4454544fd64a18fcc6f1183a14;p=emacs.git (history_delete_duplicates): New variable. (read_minibuf): Use it. (syms_of_minibuf): Create the corresponding lisp variable. --- 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; Lisp_Object Qhistory_length, Vhistory_length; +/* No duplicates in history. */ + +int history_delete_duplicates; + /* Fread_minibuffer leaves the input here as a string. */ Lisp_Object last_minibuf_string; @@ -749,6 +753,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag, { Lisp_Object length; + if (history_delete_duplicates) Fdelete (histstring, histval); histval = Fcons (histstring, histval); Fset (Vminibuffer_history_variable, histval); @@ -2668,6 +2673,12 @@ just after a new element is inserted. Setting the history-length property of a history variable overrides this default. */); XSETFASTINT (Vhistory_length, 30); + DEFVAR_BOOL ("history-delete-duplicates", &history_delete_duplicates, + doc: /* *Non-nil means to delete duplicates in history. +If set to t when adding a new history element, all previous identical +elements are deleted. */); + history_delete_duplicates = 0; + DEFVAR_LISP ("completion-auto-help", &Vcompletion_auto_help, doc: /* *Non-nil means automatically provide help for invalid completion input. */); Vcompletion_auto_help = Qt;