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
|
||||
|
||||
function editor {
|
||||
if is_osx; then
|
||||
reattach-to-user-namespace emacsclient "$@"
|
||||
else
|
||||
emacsclient "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
if [ -t 1 ]; then
|
||||
TMP="$(mktemp -t emacs)"
|
||||
echo $TMP
|
||||
cat > "$TMP"
|
||||
editor "$TMP" "$@"
|
||||
rm "$TMP"
|
||||
else
|
||||
editor "$@"
|
||||
fi
|
||||
|
||||
return 0
|
||||
|
Loading…
Reference in New Issue
Block a user