--- /dev/null
+#! /bin/bash
+
+file_list=$(git diff --name-only --diff-filter=ACM "$1" "$2" | grep '\.el$')
+updated_files=''
+for file in $file_list
+do
+ updated_files+=$(echo "~/.emacs.d/$file")' '
+done
+
+# emacs -batch -l site-lisp/bootstrap.el -f batch-byte-compile $updated_files
+emacs -batch -f batch-byte-compile $updated_files
--- /dev/null
+#! /bin/bash
+
+githooks_dir=$(dirname $0)
+git_dir=$githooks_dir/../.git
+
+cp $githooks_dir/post-merge.sh $git_dir/hooks/post-merge
+chmod +x $git_dir/hooks/post-merge
+
+cp $githooks_dir/post-commit.sh $git_dir/hooks/post-commit
+chmod +x $git_dir/hooks/post-commit
+
+cp $githooks_dir/load-changed-elisp.sh $git_dir/hooks/load-changed-elisp.sh
+chmod +x $git_dir/hooks/load-changed-elisp.sh
+
+cp $githooks_dir/compile-changed-elisp.sh $git_dir/hooks/compile-changed-elisp.sh
+chmod +x $git_dir/hooks/compile-changed-elisp.sh
+
+cp $githooks_dir/rm-stale-bytecode-files.sh $git_dir/hooks/rm-stale-bytecode-files.sh
+chmod +x $git_dir/hooks/rm-stale-bytecode-files.sh
--- /dev/null
+#! /bin/bash
+
+# If passed a pair of commit identifiers, this shell script will use emacsclient
+# to load any new or updated files in the existing emacs daemon.
+
+# This is probably only useful after git pull, to load latest config changes
+# into a long-running instance.
+
+emacs --batch --eval "(require 'server)" \
+ --eval "(if (not (eq (server-running-p) t)) (kill-emacs 1))"
+is_server_running=$?
+if [ $is_server_running -eq 0 ]; then
+ updated_files=$(git diff --name-only --diff-filter=ACM "$1" "$2" | grep '\.el$')
+ for file in $updated_files
+ do
+ emacsclient --eval \
+ "(if (server-running-p) (load-file \"~/.emacs.d/$file\"))"
+ done
+fi
--- /dev/null
+#! /bin/bash
+
+hooks_dir=$(dirname $0)
+
+$hooks_dir/compile-changed-elisp.sh HEAD^ HEAD
+$hooks_dir/rm-stale-bytecode-files.sh HEAD^ HEAD
--- /dev/null
+#! /bin/bash
+
+# My post-merge hook.
+
+hooks_dir=$(dirname $0)
+
+$hooks_dir/compile-changed-elisp.sh ORIG_HEAD HEAD
+$hooks_dir/load-changed-elisp.sh ORIG_HEAD HEAD
+$hooks_dir/rm-stale-bytecode-files.sh ORIG_HEAD HEAD
+
+# Clean out any untracked/unignored files.
+# git clean -fd elpa/
--- /dev/null
+#! /bin/bash
+
+# Delete any .elc files whose corresponding .el files were deleted or renamed
+# between commit $1 and $2.
+
+file_list=$(git diff --name-only --diff-filter=DR "$1" "$2" | grep '\.el$')
+for file in $file_list
+do
+ bytecode_file=${file}c
+ if [ -f "$bytecode_file" ]; then
+ rm "$bytecode_file"
+ echo "Deleted $bytecode_file"
+ fi
+done