From e60cabfdbc97c279b852d7a6738bf0f6a0142dce Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 14 Nov 2017 21:12:06 -0800 Subject: [PATCH] [Emacs] Clean up `imalison:main-emacs-server-name` again --- dotfiles/emacs.d/README.org | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 14dfb74d..5957a6db 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -1395,21 +1395,21 @@ Paradox is a package.el extension. I have no use for it now that I use straight. (use-package server :config (progn - (defun imalison:get-server-file () + (defvar imalison:default-server-file (imalison:join-paths user-emacs-directory "server" "server")) (defun imalison:main-emacs-server-name () (file-name-nondirectory - (file-truename (imalison:get-server-file)))) + (file-truename imalison:default-server-file))) (defun imalison:make-main-emacs-server () (interactive) - (when (not (and - (string-equal server-name "server") - (string-equal server-name (imalison:main-emacs-server-name)))) - (let ((server-file (imalison:get-server-file))) - (shell-command-to-string - (format "cd %s && rm -f server && ln -s %s server" - (imalison:join-paths user-emacs-directory "server") - server-name))))) + (unless (string-equal server-name (imalison:main-emacs-server-name)) + (if (string-equal server-name "server") + (error "Unable to set main server name 'server'. +The file server file for this emacs instance no longer exists.") + (progn + (delete-file imalison:default-server-file) + (make-symbolic-link (imalison:join-paths user-emacs-directory "server" server-name) + imalison:default-server-file))))) (defun imalison:get-this-server-filepath () (let ((server-dir (if server-use-tcp server-auth-dir server-socket-dir))) (expand-file-name server-name server-dir)))