use fifo buffers for grep and make command

This commit is contained in:
Maxime Coste 2012-08-29 00:35:45 +02:00
parent db98bcc278
commit 2b8c636377
2 changed files with 6 additions and 8 deletions

View File

@ -1,12 +1,11 @@
def -env-params grep %{ echo grep in progress, please wait...; %sh{ def -env-params grep %{ echo grep in progress, please wait...; %sh{
output=$(mktemp -t kak-grep.XXXXXXXX) output=$(mktemp -t kak-grep.XXXXXXXX)
grep -PHn $kak_param0 $kak_param1 $kak_param2 $kak_param3 $kak_param4 >& ${output} grep -PHn $kak_param0 $kak_param1 $kak_param2 $kak_param3 $kak_param4 >& ${output} < /dev/null &
echo "echo echo "echo
try %{ db *grep* } catch %{ } try %{ db *grep* } catch %{ }
edit -scratch *grep* edit -fifo ${output} *grep*
setb filetype grep setb filetype grep
exec %{|cat ${output}<ret>gg} hook buffer BufClose .* %{ %sh{ rm ${output} } }"
%sh{ rm ${output} }"
}} }}
hook global WinSetOption filetype=grep %{ hook global WinSetOption filetype=grep %{

View File

@ -1,12 +1,11 @@
def -env-params make %{ echo make in progress, please wait...; %sh{ def -env-params make %{ echo make in progress, please wait...; %sh{
output=$(mktemp -t kak-make.XXXXXXXX) output=$(mktemp -t kak-make.XXXXXXXX)
make $kak_param_0 $kak_param_1 $kak_param_2 $kak_param_3 $kak_param_4 >& ${output} make $kak_param_0 $kak_param_1 $kak_param_2 $kak_param_3 $kak_param_4 >& ${output} < /dev/null &
echo "echo echo "echo
try %{ db *make* } catch %{ } try %{ db *make* } catch %{ }
edit -scratch %{*make*} edit -fifo ${output} *make*
setb filetype make setb filetype make
exec %{|cat ${output}<ret>gg} hook buffer BufClose .* %{ %sh{ rm ${output} } }"
%sh{ rm ${output} }"
}} }}
hook global WinSetOption filetype=make %{ hook global WinSetOption filetype=make %{