summaryrefslogtreecommitdiff
path: root/bin/doccheckin
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-03-09 10:51:03 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-03-10 18:33:29 -0700
commitc9f78d0182e0f17e6e6691966dbe0e52b3e919fb (patch)
tree0ee578e31e0eff354a507a99e06ae9df1c53e358 /bin/doccheckin
parent3e867509a40430b4991cabab65d4496dcd1540bb (diff)
downloaddotfiles-c9f78d0182e0f17e6e6691966dbe0e52b3e919fb.tar.gz
doccheckin: save all files under ~/doc/ rather than all Org buffers
Also check that LOGNAME is actually set, to avoid nonsensical calls to pgrep.
Diffstat (limited to 'bin/doccheckin')
-rwxr-xr-xbin/doccheckin9
1 files changed, 4 insertions, 5 deletions
diff --git a/bin/doccheckin b/bin/doccheckin
index c3ec710f..291520e7 100755
--- a/bin/doccheckin
+++ b/bin/doccheckin
@@ -1,13 +1,12 @@
#!/bin/sh
set -e
-
-# TODO should also save *.md files in ~/doc .. maybe just save all
-# files under ~/doc?
-save-org-buffers
-
cd ~/doc/
+# If emacs is running, try to save all ~/doc/ buffers.
+[ -n "$LOGNAME" ] && pgrep -u "$LOGNAME" emacs >/dev/null \
+ && emacsclient -e '(spw/save-my-doc-buffers)'
+
# don't do anything if waiting on a manual merge; don't want just
# blanket commit that merge
[ -z "$(git ls-files --unmerged)" ] || exit 0