emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

history-delete-duplicates and keep-all


From: Juri Linkov
Subject: history-delete-duplicates and keep-all
Date: Sat, 10 Dec 2005 12:29:08 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

Adding the arg `keep-all' to `read-from-minibuffer' a few months ago
caused a bug for the case when `history-delete-duplicates' is t.

While looking at fixing this bug, I realized that instead of using the
new arg `keep-all', a cleaner solution would be to reuse the existing
variable `history-delete-duplicates'.  Its purpose is exactly the
same: to control how input from the minibuffer is added to the
history.  So let-binding `history-delete-duplicates' in necessary
places will make the arg `keep-all' obsolete.  This arg also has
another drawback: it is available only to one completion function
`read-from-minibuffer' and is not available to all other completion
functions.

Currently `keep-all' is used only in `query-replace'.  So it is not
too late to let-bind `history-delete-duplicates' in this place instead.

Thus `history-delete-duplicates' should support three different values:

1. to put all inputs in the history list, even empty and duplicate ones

2. to put input in the history list, unless it is identical to the most
   recent history item (this is the current default behavior)

3. to delete duplicate inputs from the history list (this happens when
   `history-delete-duplicates' is t)

Also currently `call-interactively' doesn't respect the value of
`history-delete-duplicates', and always puts all duplicate inputs in the
`command-history'.  It works as if `history-delete-duplicates' had the
value's type 1 from the list above.  This could be fixed as well.

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]