From 097431544e11bb917d0a9fce94f99b38cb0c207e Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Mon, 3 Oct 2022 10:10:38 -0700 Subject: [PATCH] Change approach for determining if Emacs is "for work". --- bootstrap.org | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/bootstrap.org b/bootstrap.org index f34a45d..f277572 100644 --- a/bootstrap.org +++ b/bootstrap.org @@ -165,16 +165,13 @@ Much of my more complicated code comes from my website essays and other projects Hopefully, this will tie me over while I transition. ** Emacs Server Control -Sure the Emacs application will almost always have the =server-start= going, but I need to control it (because I often have two instances running on some of my machines). What /defines/ the Emacs instance for work changes ... often: - +I actually run two instances of Emacs on some systems, where one instance has all my work-related projects, perspectives, and packages installed (like LSP), and my personal instance has other packages running (like IRC and Mail). I need a function that can make that distinction, and based on that, it will set =server-start= appropriately, so that =emacsclient= can call into the correct one. #+begin_src emacs-lisp (defun ha-emacs-for-work? () "Return non-nil when the Emacs application's location matches as one for work. - This is the `emacs-plus@28' app that I have built with - the native-comp model, but I reserve the right to change this." + Based on initially running the app with a `FOR_WORK' environment variable." (and (f-dir? "~/work") - ;; (string-match "emacs-plus@28" exec-directory) - (string-match "emacs-plus@29" exec-directory))) + (getenv "FOR_WORK"))) #+end_src And now start the server with an appropriate tag name: