I would like to run a shell command and get its output in clickable buffer in emacs. The command is a shell script that eventually runs glimpse on bunch of source files. Its output looks like grep's output. It includes file name and line number. I would like to be able to click on a file or enter while standing on it and for emacs to take me to that line in the file. I suppose I need some custom function to do that, but I am new to emacs so I don't yet know how to program it.
Run command in emacs, get output in clickable buffer
M-x grep type in your command instead of the default.
M-x apropos "grep.*null" finds grep-use-null-device
if you need to not send "/dev/null"
This seems like an interesting direction. The problem is that emacs appends /dev/null as last argument to my command. I assume it expects grep to run on some set of files and since my command doesn't include any files in its arguments, it appends /dev/null as a default file. –
Farrier
<kbd>M-x apropos</kbd> "grep.*null" finds
grep-use-null-device
. –
Cesya @Cesya To make it easier for others to find it might make sense to also put the content of that comment directly in your answer. –
Glorygloryofthesnow
An alternative approach is to run the command using shell-command
M-!, and changing the output buffer's mode to compilation-mode
using M-x compilation-mode.
Yet another alternative is to run the command using M-x compile. The downside of this is that, Emacs allows only one active compilation buffer by default.
© 2022 - 2024 — McMap. All rights reserved.