Commit ae9d1ae3 authored by Kim F. Storm's avatar Kim F. Storm
Browse files

(add-to-history): Remove keep-dups arg.

parent e2fa249f
......@@ -1123,21 +1123,20 @@ The return value is the new value of LIST-VAR."
(< oa ob)
(defun add-to-history (history-var newelt &optional maxelt keep-dups)
(defun add-to-history (history-var newelt &optional maxelt)
"Add NEWELT to the history list stored in the variable HISTORY-VAR.
Return the new history list.
If MAXELT is non-nil, it specifies the maximum length of the history.
Otherwise, the maximum history length is the value of the `history-length'
property on symbol HISTORY-VAR, if set, or the value of the `history-length'
Remove duplicates of NEWELT unless `history-delete-duplicates' is nil
or KEEP-DUPS is non-nil."
Remove duplicates of NEWELT unless `history-delete-duplicates' is nil."
(unless maxelt
(setq maxelt (or (get history-var 'history-length)
(let ((history (symbol-value history-var))
(if (and history-delete-duplicates (not keep-dups))
(if history-delete-duplicates
(setq history (delete newelt history)))
(setq history (cons newelt history))
(when (integerp maxelt)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment