unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Subject: history-delete-duplicates and keep-all
Date: Sat, 10 Dec 2005 12:29:08 +0200	[thread overview]
Message-ID: <87mzj98eh1.fsf@jurta.org> (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/

             reply	other threads:[~2005-12-10 10:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-10 10:29 Juri Linkov [this message]
2005-12-11  5:03 ` history-delete-duplicates and keep-all Richard M. Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mzj98eh1.fsf@jurta.org \
    --to=juri@jurta.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).