rc: Fix calls to mktemp
The GNU and BSD implementations differ on several points, this commit hopefully finds a middle ground.
This commit is contained in:
parent
2992d5bb0b
commit
cb9a2e562b
|
@ -8,7 +8,7 @@ decl -hidden range-specs lint_errors
|
||||||
|
|
||||||
def lint -docstring 'Parse the current buffer with a linter' %{
|
def lint -docstring 'Parse the current buffer with a linter' %{
|
||||||
%sh{
|
%sh{
|
||||||
dir=$(mktemp --tmpdir -d kak-lint.XXXXXXXX)
|
dir=$(mktemp -d "${TMPDIR:-/tmp}"/kak-lint.XXXXXXXX)
|
||||||
mkfifo "$dir"/fifo
|
mkfifo "$dir"/fifo
|
||||||
printf '%s\n' "eval -no-hooks write $dir/buf"
|
printf '%s\n' "eval -no-hooks write $dir/buf"
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ Formats of language supported:
|
||||||
spell %{
|
spell %{
|
||||||
try %{ add-highlighter ranges 'spell_regions' }
|
try %{ add-highlighter ranges 'spell_regions' }
|
||||||
%sh{
|
%sh{
|
||||||
file=$(mktemp --tmpdir -d kak-spell.XXXXXXXX)/buffer
|
file=$(mktemp -d "${TMPDIR:-/tmp}"/kak-spell.XXXXXXXX)/buffer
|
||||||
printf 'eval -no-hooks write %s\n' "${file}"
|
printf 'eval -no-hooks write %s\n' "${file}"
|
||||||
printf 'set buffer spell_tmp_file %s\n' "${file}"
|
printf 'set buffer spell_tmp_file %s\n' "${file}"
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ decl -docstring "name of the client in which documentation is to be displayed" \
|
||||||
|
|
||||||
def -hidden -params 1..2 doc-open %{
|
def -hidden -params 1..2 doc-open %{
|
||||||
%sh{
|
%sh{
|
||||||
manout=$(mktemp --tmpdir kak-man-XXXXXX)
|
manout=$(mktemp "${TMPDIR:-/tmp}"/kak-man-XXXXXX)
|
||||||
|
|
||||||
# Those options are handled by the `man-db` implementation
|
# Those options are handled by the `man-db` implementation
|
||||||
export MANWIDTH=${kak_window_width}
|
export MANWIDTH=${kak_window_width}
|
||||||
|
|
|
@ -8,7 +8,7 @@ def -params .. -file-completion \
|
||||||
-docstring %{grep [<arguments>]: grep utility wrapper
|
-docstring %{grep [<arguments>]: grep utility wrapper
|
||||||
All the optional arguments are forwarded to the grep utility} \
|
All the optional arguments are forwarded to the grep utility} \
|
||||||
grep %{ %sh{
|
grep %{ %sh{
|
||||||
output=$(mktemp -d -t kak-grep.XXXXXXXX)/fifo
|
output=$(mktemp -d "${TMPDIR:-/tmp}"/kak-grep.XXXXXXXX)/fifo
|
||||||
mkfifo ${output}
|
mkfifo ${output}
|
||||||
if [ $# -gt 0 ]; then
|
if [ $# -gt 0 ]; then
|
||||||
( ${kak_opt_grepcmd} "$@" | tr -d '\r' > ${output} 2>&1 ) > /dev/null 2>&1 < /dev/null &
|
( ${kak_opt_grepcmd} "$@" | tr -d '\r' > ${output} 2>&1 ) > /dev/null 2>&1 < /dev/null &
|
||||||
|
|
|
@ -11,7 +11,7 @@ def -params .. \
|
||||||
-docstring %{make [<arguments>]: make utility wrapper
|
-docstring %{make [<arguments>]: make utility wrapper
|
||||||
All the optional arguments are forwarded to the make utility} \
|
All the optional arguments are forwarded to the make utility} \
|
||||||
make %{ %sh{
|
make %{ %sh{
|
||||||
output=$(mktemp --tmpdir -d kak-make.XXXXXXXX)/fifo
|
output=$(mktemp -d "${TMPDIR:-/tmp}"/kak-make.XXXXXXXX)/fifo
|
||||||
mkfifo ${output}
|
mkfifo ${output}
|
||||||
( eval ${kak_opt_makecmd} "$@" > ${output} 2>&1 ) > /dev/null 2>&1 < /dev/null &
|
( eval ${kak_opt_makecmd} "$@" > ${output} 2>&1 ) > /dev/null 2>&1 < /dev/null &
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,8 @@ hook global WinSetOption filetype=(?!man).* %{
|
||||||
}
|
}
|
||||||
|
|
||||||
def -hidden -params 1..2 man-impl %{ %sh{
|
def -hidden -params 1..2 man-impl %{ %sh{
|
||||||
manout=$(mktemp --tmpdir kak-man-XXXXXX)
|
manout=$(mktemp "${TMPDIR:-/tmp}"/kak-man-XXXXXX)
|
||||||
colout=$(mktemp --tmpdir kak-man-XXXXXX)
|
colout=$(mktemp "${TMPDIR:-/tmp}"/kak-man-XXXXXX)
|
||||||
MANWIDTH=${kak_window_width} man "$@" > $manout
|
MANWIDTH=${kak_window_width} man "$@" > $manout
|
||||||
retval=$?
|
retval=$?
|
||||||
col -b -x > ${colout} < ${manout}
|
col -b -x > ${colout} < ${manout}
|
||||||
|
|
|
@ -11,7 +11,7 @@ def -params ..1 \
|
||||||
The syntaxic errors detected during parsing are shown when auto-diagnostics are enabled} \
|
The syntaxic errors detected during parsing are shown when auto-diagnostics are enabled} \
|
||||||
clang-parse %{
|
clang-parse %{
|
||||||
%sh{
|
%sh{
|
||||||
dir=$(mktemp --tmpdir -d kak-clang.XXXXXXXX)
|
dir=$(mktemp -d "${TMPDIR:-/tmp}"/kak-clang.XXXXXXXX)
|
||||||
mkfifo ${dir}/fifo
|
mkfifo ${dir}/fifo
|
||||||
printf %s\\n "set buffer clang_tmp_dir ${dir}"
|
printf %s\\n "set buffer clang_tmp_dir ${dir}"
|
||||||
printf %s\\n "eval -no-hooks write ${dir}/buf"
|
printf %s\\n "eval -no-hooks write ${dir}/buf"
|
||||||
|
|
|
@ -39,7 +39,7 @@ Available commands:\n-add\n-rm\n-blame\n-commit\n-checkout\n-diff\n-hide-blame\n
|
||||||
log) filetype=git-log ;;
|
log) filetype=git-log ;;
|
||||||
status) filetype=git-status ;;
|
status) filetype=git-status ;;
|
||||||
esac
|
esac
|
||||||
output=$(mktemp --tmpdir -d kak-git.XXXXXXXX)/fifo
|
output=$(mktemp -d "${TMPDIR:-/tmp}"/kak-git.XXXXXXXX)/fifo
|
||||||
mkfifo ${output}
|
mkfifo ${output}
|
||||||
( git "$@" > ${output} 2>&1 ) > /dev/null 2>&1 < /dev/null &
|
( git "$@" > ${output} 2>&1 ) > /dev/null 2>&1 < /dev/null &
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ decl -hidden completions gocode_completions
|
||||||
|
|
||||||
def go-complete -docstring "Complete the current selection with gocode" %{
|
def go-complete -docstring "Complete the current selection with gocode" %{
|
||||||
%sh{
|
%sh{
|
||||||
dir=$(mktemp --tmpdir -d kak-go.XXXXXXXX)
|
dir=$(mktemp -d "${TMPDIR:-/tmp}"/kak-go.XXXXXXXX)
|
||||||
printf %s\\n "set buffer go_complete_tmp_dir ${dir}"
|
printf %s\\n "set buffer go_complete_tmp_dir ${dir}"
|
||||||
printf %s\\n "eval -no-hooks write ${dir}/buf"
|
printf %s\\n "eval -no-hooks write ${dir}/buf"
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ decl -hidden str go_format_tmp_dir
|
||||||
def -params ..1 go-format \
|
def -params ..1 go-format \
|
||||||
-docstring "go-format [-use-goimports]: custom formatter for go files" %{
|
-docstring "go-format [-use-goimports]: custom formatter for go files" %{
|
||||||
%sh{
|
%sh{
|
||||||
dir=$(mktemp --tmpdir -d kak-go.XXXXXXXX)
|
dir=$(mktemp -d "${TMPDIR:-/tmp}"/kak-go.XXXXXXXX)
|
||||||
printf %s\\n "set buffer go_format_tmp_dir ${dir}"
|
printf %s\\n "set buffer go_format_tmp_dir ${dir}"
|
||||||
printf %s\\n "eval -no-hooks write ${dir}/buf"
|
printf %s\\n "eval -no-hooks write ${dir}/buf"
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ decl -hidden str go_doc_tmp_dir
|
||||||
# FIXME text escaping
|
# FIXME text escaping
|
||||||
def -hidden -params 1..2 gogetdoc-cmd %{
|
def -hidden -params 1..2 gogetdoc-cmd %{
|
||||||
%sh{
|
%sh{
|
||||||
dir=$(mktemp --tmpdir -d kak-go.XXXXXXXX)
|
dir=$(mktemp -d "${TMPDIR:-/tmp}"/kak-go.XXXXXXXX)
|
||||||
printf %s\\n "set buffer go_doc_tmp_dir ${dir}"
|
printf %s\\n "set buffer go_doc_tmp_dir ${dir}"
|
||||||
printf %s\\n "eval -no-hooks write ${dir}/buf"
|
printf %s\\n "eval -no-hooks write ${dir}/buf"
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ decl -docstring "colon separated list of path added to `python`'s $PYTHONPATH en
|
||||||
|
|
||||||
def jedi-complete -docstring "Complete the current selection" %{
|
def jedi-complete -docstring "Complete the current selection" %{
|
||||||
%sh{
|
%sh{
|
||||||
dir=$(mktemp --tmpdir -d kak-jedi.XXXXXXXX)
|
dir=$(mktemp -d "${TMPDIR:-/tmp}"/kak-jedi.XXXXXXXX)
|
||||||
mkfifo ${dir}/fifo
|
mkfifo ${dir}/fifo
|
||||||
printf %s\\n "set buffer jedi_tmp_dir ${dir}"
|
printf %s\\n "set buffer jedi_tmp_dir ${dir}"
|
||||||
printf %s\\n "eval -no-hooks write ${dir}/buf"
|
printf %s\\n "eval -no-hooks write ${dir}/buf"
|
||||||
|
|
|
@ -3,7 +3,7 @@ decl -hidden completions racer_completions
|
||||||
|
|
||||||
def racer-complete -docstring "Complete the current selection with racer" %{
|
def racer-complete -docstring "Complete the current selection with racer" %{
|
||||||
%sh{
|
%sh{
|
||||||
dir=$(mktemp --tmpdir -d kak-racer.XXXXXXXX)
|
dir=$(mktemp -d "${TMPDIR:-/tmp}"/kak-racer.XXXXXXXX)
|
||||||
printf %s\\n "set buffer racer_tmp_dir ${dir}"
|
printf %s\\n "set buffer racer_tmp_dir ${dir}"
|
||||||
printf %s\\n "eval -no-hooks %{ write ${dir}/buf }"
|
printf %s\\n "eval -no-hooks %{ write ${dir}/buf }"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user