From 1485150b6813e101316805f7f8f7d60855ca26db Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 19 Aug 2018 08:04:31 +1000 Subject: [PATCH] Use -once hooks to remove fifo directories --- rc/base/lint.kak | 5 +---- rc/core/grep.kak | 5 +---- rc/core/make.kak | 5 +---- rc/extra/clang.kak | 5 +---- rc/extra/git-tools.kak | 5 +---- 5 files changed, 5 insertions(+), 20 deletions(-) diff --git a/rc/base/lint.kak b/rc/base/lint.kak index 29b9031d..74b1be4e 100644 --- a/rc/base/lint.kak +++ b/rc/base/lint.kak @@ -28,10 +28,7 @@ define-command lint -docstring 'Parse the current buffer with a linter' %{ edit! -fifo $dir/fifo -debug *lint-output* set-option buffer filetype make set-option buffer make_current_error_line 0 - hook -always -group fifo buffer BufCloseFifo .* %{ - nop %sh{ rm -r '$dir' } - remove-hooks buffer fifo - } + hook -always -once buffer BufCloseFifo .* %{ nop %sh{ rm -r '$dir' } } }" { # do the parsing in the background and when ready send to the session diff --git a/rc/core/grep.kak b/rc/core/grep.kak index 644d2e7e..b36ca618 100644 --- a/rc/core/grep.kak +++ b/rc/core/grep.kak @@ -20,10 +20,7 @@ All the optional arguments are forwarded to the grep utility} \ edit! -fifo ${output} -scroll *grep* set-option buffer filetype grep set-option buffer grep_current_line 0 - hook -always -group fifo buffer BufCloseFifo .* %{ - nop %sh{ rm -r $(dirname ${output}) } - remove-hooks buffer fifo - } + hook -always -once buffer BufCloseFifo .* %{ nop %sh{ rm -r $(dirname ${output}) } } }" }} diff --git a/rc/core/make.kak b/rc/core/make.kak index e5037675..d47083bb 100644 --- a/rc/core/make.kak +++ b/rc/core/make.kak @@ -19,10 +19,7 @@ All the optional arguments are forwarded to the make utility} \ edit! -fifo ${output} -scroll *make* set-option buffer filetype make set-option buffer make_current_error_line 0 - hook -always -group fifo buffer BufCloseFifo .* %{ - nop %sh{ rm -r $(dirname ${output}) } - remove-hooks buffer fifo - } + hook -always -once buffer BufCloseFifo .* %{ nop %sh{ rm -r $(dirname ${output}) } } }" }} diff --git a/rc/extra/clang.kak b/rc/extra/clang.kak index 34891ec2..fb2226ee 100644 --- a/rc/extra/clang.kak +++ b/rc/extra/clang.kak @@ -24,10 +24,7 @@ The syntaxic errors detected during parsing are shown when auto-diagnostics are edit! -fifo ${dir}/fifo -debug *clang-output* set-option buffer filetype make set-option buffer make_current_error_line 0 - hook -always -group fifo buffer BufCloseFifo .* %{ - nop %sh{ rm -r ${dir} } - remove-hooks buffer fifo - } + hook -once -always buffer BufCloseFifo .* %{ nop %sh{ rm -r ${dir} } } }" # this runs in a detached shell, asynchronously, so that kakoune does # not hang while clang is running. As completions references a cursor diff --git a/rc/extra/git-tools.kak b/rc/extra/git-tools.kak index 4f3cb718..bd773b46 100644 --- a/rc/extra/git-tools.kak +++ b/rc/extra/git-tools.kak @@ -53,10 +53,7 @@ Available commands:\n add\n rm\n blame\n commit\n checkout\n diff\n hide- printf %s "evaluate-commands -try-client '$kak_opt_docsclient' %{ edit! -fifo ${output} *git* set-option buffer filetype '${filetype}' - hook -always -group fifo buffer BufCloseFifo .* %{ - nop %sh{ rm -r $(dirname ${output}) } - remove-hooks buffer fifo - } + hook -always -once buffer BufCloseFifo .* %{ nop %sh{ rm -r $(dirname ${output}) } } }" }