summaryrefslogtreecommitdiff
path: root/bin/emacsclient
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-12-27 11:53:02 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-12-27 11:53:02 -0700
commit025ee35dadf207f72691cf55a573dd897728bb00 (patch)
tree7cbf8e95ef10f835497178ab61872f4e9c510d09 /bin/emacsclient
parent04ead44c46cc71c9d6f076e84da1e11f9e5d8864 (diff)
downloaddotfiles-025ee35dadf207f72691cf55a573dd897728bb00.tar.gz
more Emacs linked working trees, attempt a number of simplifications
Diffstat (limited to 'bin/emacsclient')
-rwxr-xr-xbin/emacsclient31
1 files changed, 10 insertions, 21 deletions
diff --git a/bin/emacsclient b/bin/emacsclient
index f9a238c5..2e555710 100755
--- a/bin/emacsclient
+++ b/bin/emacsclient
@@ -35,8 +35,8 @@ daemon_name=
gdbmacs=
args=
-devel_emacs="$HOME/src/emacs/src/emacs"
-devel_emacsclient="$HOME/src/emacs/lib-src/emacsclient"
+devel_emacs="$HOME/src/emacs/primary/src/emacs"
+devel_emacsclient="$HOME/src/emacs/primary/lib-src/emacsclient"
installed_emacs=$(command -v emacs)
installed_emacsclient=$(PATH=$(echo "$PATH" \
@@ -158,29 +158,18 @@ fi
[ -z "$listener" ] && ! $may_start && ! $want_version && exit 0
-# We start up an in-tree Emacs daemon only when a branch named after this host
-# is checked out, packages compiled against my emacs-snapshot Debian packages
-# are available, and there isn't a build still in progress -- avoids having to
-# consider whether a build is in progress when hitting 'C-i e'.
-#
-# The purpose of a branch for localhost is to keep track of what upstream
-# commit we want to be running on this host (e.g. emacs-29 vs. master), and
-# for WIP commits. It doesn't usually need to be pushed anywhere.
+# We start up an in-tree Emacs daemon only when the linked worktree exists and
+# there isn't a build still in progress. The latter means we avoid having to
+# consider whether or not a build is in progress when hitting 'C-i e'.
#
# We also examine $installed_running here to avoid having the in-tree
# emacsclient(1) connect to the installed Emacs.
-if ! $want_installed && ! $installed_running \
- && [ -x "$HOME/src/emacs/lib-src/emacsclient" \
- -a -d "/usr/share/emacs-snapshot/site-lisp/elpa" ]; then
- make="$(ps h -o pid -C make)"
- branch="$(git -C $HOME/src/emacs rev-parse --abbrev-ref HEAD)"
-fi
-
-if [ "$branch" = "$(hostname -s)" ] \
- && ! ( ! $devel_running && [ -n "$make" ] \
- && echo "$make" | xargs pwdx \
- | grep -q "$HOME/src/emacs" ); then
+if ! $want_installed && ! $installed_running && [ -x "$devel_emacsclient" ] \
+ && ( $devel_running \
+ || ! ( make="$(ps h -o pid -C make)"
+ [ -n "$make" ] && echo "$make" | xargs pwdx \
+ | grep -q "$HOME/src/emacs/primary" ) ); then
emacs=("$devel_emacs")
emacsclient=("$devel_emacsclient")
if [ -z "$daemon_name" ] && ! $want_version; then