I have a buffer with the name very-long-name-xyz-etc
. This buffer is the only buffer whose name contains xyz
.
From terminal I can switch to that buffer using the following
emacsclientw -cna runemacs --eval "(switch-to-buffer \"very-long-name-xyz-etc\")"
Is there a way to do better by just using the partial name xyz
?
switch-to-buffer-matching
that takes the substring and searches the buffer list for a matching name. Your function can then callswitch-to-buffer
with the full name.