forked from colonelpanic/dotfiles
Make a temp file when standard in comes to emacs.
This supports using emacs as a PAGER
This commit is contained in:
parent
5357c25713
commit
63103674b9
@ -1,8 +1,22 @@
|
|||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
function editor {
|
||||||
if is_osx; then
|
if is_osx; then
|
||||||
reattach-to-user-namespace emacsclient "$@"
|
reattach-to-user-namespace emacsclient "$@"
|
||||||
else
|
else
|
||||||
emacsclient "$@"
|
emacsclient "$@"
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if [ -t 1 ]; then
|
||||||
|
TMP="$(mktemp -t emacs)"
|
||||||
|
echo $TMP
|
||||||
|
cat > "$TMP"
|
||||||
|
editor "$TMP" "$@"
|
||||||
|
rm "$TMP"
|
||||||
|
else
|
||||||
|
editor "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user