I try to solve the problem like this in test.el:
(shell)
(rename-buffer "name1")
(shell)
(rename-buffer "name2")
(shell)
(rename-buffer "name3")
However, when I use (eval-buffer)
to execute, it seems that the program stops at the 4th line and returns that
Buffer name 'name1' is in use
I am not a pro of elisp, can't figure out what is happening here. Can any one help?
shell
has an optional argument for a buffer/buffer-name and will create it if not already in existence:(shell "foo1")
and(shell "foo2")
. To read more about how this works, typeM-x describe-function RET shell RET
orC-h f RET shell RET
.