Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run command in emacs, get output in clickable buffer

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.

like image 414
Alexander Sandler Avatar asked Mar 08 '12 17:03

Alexander Sandler


2 Answers

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"

like image 115
event_jr Avatar answered Sep 20 '22 08:09

event_jr


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.

like image 43
Praveen Kumar Avatar answered Sep 18 '22 08:09

Praveen Kumar