I am often opening exwm buffers by running async-shell-command but unfortunately these buffers always get named *EXWM*. It would be great if when I ran async-shell-command 'firefox the buffer that gets created would be named firefox.
1 Answer
something like this could work...
(defun async-shell-to-buffer (cmd) (interactive "sCall command: ") (let ((output-buffer (generate-new-buffer (format "*async:%s*" cmd))) (error-buffer (generate-new-buffer (format "*error:%s*" cmd)))) (async-shell-command cmd output-buffer error-buffer))) then it's possible to call (async-shell-to-buffer "firefox")
- this behaves exactly the same for me as
async-shell-commandNicholas Hubbard– Nicholas Hubbard2020-12-16 00:35:50 +00:00Commented Dec 16, 2020 at 0:35 - in the
*Buffer List*i get*async:firefox*and*error:firefox*so might be something else exwm is doing?zzkt– zzkt2020-12-16 02:51:23 +00:00Commented Dec 16, 2020 at 2:51 - maybe try
rename-bufferin a function advisingexwm-manage--manage-windowlooks like that's where it's creating new buffers...zzkt– zzkt2020-12-16 02:52:40 +00:00Commented Dec 16, 2020 at 2:52 - I'd copy this from the example config; it sets the name to a I'd expect (feel free to choose a different keybinding): github.com/ch11ng/exwm/blob/…Chris Elrod– Chris Elrod2023-01-05 06:22:02 +00:00Commented Jan 5, 2023 at 6:22
async-shell-commandaccepts extra optional parameters. The second parameter is the name you want for the buffer with the results.