0

Whilst M-ping back through history in execute-extended-command, I see many commands are ones which have already appeared earlier (ie more recently).

Is there an option which works similar to (setq eshell-hist-ignoredups 'erase) for the command history?

So whenever a new command is executed, all previous invocations are removed from history.

1 Answer 1

1

Yup: set history-delete-duplicates:

Non-nil means to delete duplicates in history. If set to t when adding a new history element, all previous identical elements are deleted from the history list.

2
  • Just what I was looking for, thanks Commented Aug 23, 2022 at 14:42
  • 1
    Note that this deletes dups for all minibuffer histories, not just command-history. That's probably what OP wants, but maybe it's worth mentioning.
    – Drew
    Commented Aug 23, 2022 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.