Don't prompt for program in M-x eat by default

* eat.el (eat): Prompt for program to run only if double prefix
argument is given, otherwise use the default one.
This commit is contained in:
Akib Azmain Turja 2023-03-29 22:39:45 +06:00
parent 5a2123910a
commit 8ee08d2b22
No known key found for this signature in database
GPG key ID: 5535FCF54D88616B

9
eat.el
View file

@ -5555,11 +5555,16 @@ With a numeric prefix ARG (like \\[universal-argument] 42 \\[eshell]),
switch to the session with that number, or create it if it doesn't switch to the session with that number, or create it if it doesn't
already exist. already exist.
With double prefix argument ARG, ask for the program to run and run it
in a newly created session.
PROGRAM can be a shell command." PROGRAM can be a shell command."
(interactive (list (read-shell-command "Run program: " (interactive
(list (when (equal current-prefix-arg '(16))
(read-shell-command "Run program: "
(or explicit-shell-file-name (or explicit-shell-file-name
(getenv "ESHELL") (getenv "ESHELL")
shell-file-name)) shell-file-name)))
current-prefix-arg)) current-prefix-arg))
(let ((program (or program (or explicit-shell-file-name (let ((program (or program (or explicit-shell-file-name
(getenv "ESHELL") (getenv "ESHELL")