]> code.delx.au - gnu-emacs/commitdiff
(Vhistory_add_new_input): New variable.
authorJuri Linkov <juri@jurta.org>
Wed, 31 May 2006 21:11:07 +0000 (21:11 +0000)
committerJuri Linkov <juri@jurta.org>
Wed, 31 May 2006 21:11:07 +0000 (21:11 +0000)
(read_minibuf): Use it.
(syms_of_minibuf) <history-add-new-input>: New Lisp variable.
(syms_of_minibuf) <history-delete-duplicates>: Doc fix.

src/minibuf.c

index ff56eca3241422073c654ec688975908ede9b554..86d24e6647c29eb92d9aefcd216a77ff6d774503 100644 (file)
@@ -66,6 +66,10 @@ Lisp_Object Qhistory_length, Vhistory_length;
 
 int history_delete_duplicates;
 
+/* Non-nil means add new input to history.  */
+
+Lisp_Object Vhistory_add_new_input;
+
 /* Fread_minibuffer leaves the input here as a string. */
 
 Lisp_Object last_minibuf_string;
@@ -753,7 +757,8 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
     histstring = Qnil;
 
   /* Add the value to the appropriate history list, if any.  */
-  if (SYMBOLP (Vminibuffer_history_variable)
+  if (!NILP (Vhistory_add_new_input)
+      && SYMBOLP (Vminibuffer_history_variable)
       && !NILP (histstring))
     {
       /* If the caller wanted to save the value read on a history list,
@@ -2800,9 +2805,16 @@ property of a history variable overrides this default.  */);
   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.  */);
+elements are deleted from the history list.  */);
   history_delete_duplicates = 0;
 
+  DEFVAR_LISP ("history-add-new-input", &Vhistory_add_new_input,
+              doc: /* *Non-nil means to add new elements in history.
+If set to nil, minibuffer reading functions don't add new elements to the
+history list, so it is possible to do this afterwards by calling
+`add-to-history' explicitly.  */);
+  Vhistory_add_new_input = Qt;
+
   DEFVAR_LISP ("completion-auto-help", &Vcompletion_auto_help,
               doc: /* *Non-nil means automatically provide help for invalid completion input.
 Under Partial Completion mode, a non-nil, non-t value has a special meaning;