diff options
Diffstat (limited to 'bins/bin/edit-file-in-emacs.sh')
-rwxr-xr-x | bins/bin/edit-file-in-emacs.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bins/bin/edit-file-in-emacs.sh b/bins/bin/edit-file-in-emacs.sh new file mode 100755 index 000000000000..0661da7335fe --- /dev/null +++ b/bins/bin/edit-file-in-emacs.sh @@ -0,0 +1,7 @@ +#/usr/bin/env zsh + +file=$(mktemp -t "$USER-"XXXXXXXX.emacs-pager) || exit 127 +trap 'rm -f "$file"' EXIT +trap 'exit 255' HUP INT QUIT TERM +cat "$@" >"$file" +emacsclient -e "(wc/edit-file-in-emacs \"$file\")" |