diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-08-08 15:52:19 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-08-08 15:53:41 +0200 |
commit | ffc81ebc4b5d6cfc827e6a08679da55134f73fb5 (patch) | |
tree | 0d285330a12d247433e1e5805ede15a9c5a0b62f /test | |
parent | 498c5d26bb6360eda5c6cedbcf027e2cc67120ff (diff) | |
download | emacs-ffc81ebc4b5d6cfc827e6a08679da55134f73fb5.tar.gz emacs-ffc81ebc4b5d6cfc827e6a08679da55134f73fb5.tar.bz2 emacs-ffc81ebc4b5d6cfc827e6a08679da55134f73fb5.zip |
Allow specifying how args are to be stored in `command-history'
* doc/lispref/functions.texi (Declare Form): Document
`interactive-args'
* lisp/replace.el (replace-string): Store the correct interactive
arguments (bug#45607).
* lisp/emacs-lisp/byte-run.el (byte-run--set-interactive-args):
New function.
(defun-declarations-alist): Use it.
* src/callint.c (fix_command): Remove the old hack (which now
longer works since interactive specs are byte-compiled) and
instead rely on `interactive-args'.
Diffstat (limited to 'test')
-rw-r--r-- | test/src/callint-tests.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/src/callint-tests.el b/test/src/callint-tests.el index d964fc3c1f3..5a633fdc2bd 100644 --- a/test/src/callint-tests.el +++ b/test/src/callint-tests.el @@ -52,4 +52,17 @@ (call-interactively #'ignore t)) (should (= (length command-history) history-length)))) +(defun callint-test-int-args (foo bar &optional zot) + (declare (interactive-args + (bar 10) + (zot 11))) + (interactive (list 1 1 1)) + (+ foo bar zot)) + +(ert-deftest test-interactive-args () + (let ((history-length 1) + (command-history ())) + (should (= (call-interactively 'callint-test-int-args t) 3)) + (should (equal command-history '((callint-test-int-args 1 10 11)))))) + ;;; callint-tests.el ends here |