unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* history-delete-duplicates and keep-all
@ 2005-12-10 10:29 Juri Linkov
  2005-12-11  5:03 ` Richard M. Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Juri Linkov @ 2005-12-10 10:29 UTC (permalink / raw)


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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: history-delete-duplicates and keep-all
  2005-12-10 10:29 history-delete-duplicates and keep-all Juri Linkov
@ 2005-12-11  5:03 ` Richard M. Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard M. Stallman @ 2005-12-11  5:03 UTC (permalink / raw)
  Cc: emacs-devel

    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:

We could do that, or make a separate variable.
I think a separate variable would be better, because
these two different activities are for different purposes.

Which means it is really a question of whether to use
an argument for this, or a new global variable.

      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.

I think that is a reason to switch to a variable.
Would you please make that change?

Please update NEWS and the Lisp manual, too.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-12-11  5:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-10 10:29 history-delete-duplicates and keep-all Juri Linkov
2005-12-11  5:03 ` Richard M. Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).