From 025ee35dadf207f72691cf55a573dd897728bb00 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 27 Dec 2022 11:53:02 -0700 Subject: more Emacs linked working trees, attempt a number of simplifications --- bin/emacsclient | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'bin/emacsclient') 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 -- cgit v1.2.3