I've read the documentation on how to make interactive calls from within Elisp, but I still can't figure out how to pass the universal argument when using call-interactively
on a command that recognizes the universal argument.
More specifically, I want to implement a function that, under certain conditions, should call the shell
command interactively with the universal argument, so that, as a result, the prompt
Shell buffer (default *shell*):
will be visible in the minibuffer, and, once this prompt gets a response, the specified buffer will be created (if it doesn't exist already), and made the current buffer.
FWIW, I tried the following:
(universal-argument)
(call-interactively 'shell)
and
(setq prefix-arg (list 4))
(call-interactively 'shell)
...but I never saw the prompt Shell buffer (default *shell*):
; instead, in all cases, the shell
command ran exactly as if it had been called without the universal argument. (I really don't know what I'm doing here, so my blind attempts above were made with conscious disregard of the documentation's prescient advice.)
(let ((current-prefix-arg 4)) (call-interactively 'shell))