Fix off-by-one history pruning (bug#31211)
commitf2c74543edc7e8d07655b459ba8898eec9b6d4e8
authorBasil L. Contovounesios <contovob@tcd.ie>
Sun, 29 Apr 2018 14:37:45 +0000 (29 15:37 +0100)
committerNoam Postavsky <npostavs@gmail.com>
Thu, 3 May 2018 00:18:07 +0000 (2 20:18 -0400)
treeb6612a1370f9c20399e8fa32ff50be643a0ecabd
parent05e9477ab5d5dba1b960415d60b9957caa90da48
Fix off-by-one history pruning (bug#31211)

* lisp/subr.el (add-to-history): Clarify docstring.
Protect against negative history-length and unnecessary variable
modification, as per read_minibuf.

* lisp/ido.el (ido-record-command):
* lisp/international/mule-cmds.el (deactivate-input-method):
(set-language-environment-input-method):
* lisp/isearch.el (isearch-done):
* lisp/minibuffer.el (read-file-name-default):
* lisp/net/eww.el (eww-save-history):
* lisp/simple.el (edit-and-eval-command, repeat-complex-command):
(command-execute, kill-new, push-mark):
* src/callint.c (Fcall_interactively):
* src/minibuf.c (read_minibuf): Delegate to add-to-history.

* test/lisp/simple-tests.el (command-execute-prune-command-history):
* test/src/callint-tests.el
(call-interactively-prune-command-history): New tests.
lisp/ido.el
lisp/international/mule-cmds.el
lisp/isearch.el
lisp/minibuffer.el
lisp/net/eww.el
lisp/simple.el
lisp/subr.el
src/callint.c
src/minibuf.c
test/lisp/simple-tests.el
test/src/callint-tests.el