aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorLars Ingebrigtsen2022-08-08 15:52:19 +0200
committerLars Ingebrigtsen2022-08-08 15:53:41 +0200
commitffc81ebc4b5d6cfc827e6a08679da55134f73fb5 (patch)
tree0d285330a12d247433e1e5805ede15a9c5a0b62f /test/src
parent498c5d26bb6360eda5c6cedbcf027e2cc67120ff (diff)
downloademacs-ffc81ebc4b5d6cfc827e6a08679da55134f73fb5.tar.gz
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/src')
-rw-r--r--test/src/callint-tests.el13
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 @@
52 (call-interactively #'ignore t)) 52 (call-interactively #'ignore t))
53 (should (= (length command-history) history-length)))) 53 (should (= (length command-history) history-length))))
54 54
55(defun callint-test-int-args (foo bar &optional zot)
56 (declare (interactive-args
57 (bar 10)
58 (zot 11)))
59 (interactive (list 1 1 1))
60 (+ foo bar zot))
61
62(ert-deftest test-interactive-args ()
63 (let ((history-length 1)
64 (command-history ()))
65 (should (= (call-interactively 'callint-test-int-args t) 3))
66 (should (equal command-history '((callint-test-int-args 1 10 11))))))
67
55;;; callint-tests.el ends here 68;;; callint-tests.el ends here