diff options
author | William Carroll <wpcarro@gmail.com> | 2017-06-15T21·20-0400 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2017-06-15T21·20-0400 |
commit | d9a05b322e0788ab9a7dc22591da4e17727a8e27 (patch) | |
tree | af2a92410afe18b9486034e93b252a0045c199cd /bins | |
parent | 146e2cc3a12e85038812f2e67a36f4b95fc70ae4 (diff) |
Adds QuickEdit mode for git commit messages within ansi-term
Diffstat (limited to 'bins')
-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\")" |