forked from colonelpanic/dotfiles
[Emacs] Clean up imalison:main-emacs-server-name
again
This commit is contained in:
parent
838e48920a
commit
e60cabfdbc
@ -1395,21 +1395,21 @@ Paradox is a package.el extension. I have no use for it now that I use straight.
|
|||||||
(use-package server
|
(use-package server
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(defun imalison:get-server-file ()
|
(defvar imalison:default-server-file
|
||||||
(imalison:join-paths user-emacs-directory "server" "server"))
|
(imalison:join-paths user-emacs-directory "server" "server"))
|
||||||
(defun imalison:main-emacs-server-name ()
|
(defun imalison:main-emacs-server-name ()
|
||||||
(file-name-nondirectory
|
(file-name-nondirectory
|
||||||
(file-truename (imalison:get-server-file))))
|
(file-truename imalison:default-server-file)))
|
||||||
(defun imalison:make-main-emacs-server ()
|
(defun imalison:make-main-emacs-server ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(when (not (and
|
(unless (string-equal server-name (imalison:main-emacs-server-name))
|
||||||
(string-equal server-name "server")
|
(if (string-equal server-name "server")
|
||||||
(string-equal server-name (imalison:main-emacs-server-name))))
|
(error "Unable to set main server name 'server'.
|
||||||
(let ((server-file (imalison:get-server-file)))
|
The file server file for this emacs instance no longer exists.")
|
||||||
(shell-command-to-string
|
(progn
|
||||||
(format "cd %s && rm -f server && ln -s %s server"
|
(delete-file imalison:default-server-file)
|
||||||
(imalison:join-paths user-emacs-directory "server")
|
(make-symbolic-link (imalison:join-paths user-emacs-directory "server" server-name)
|
||||||
server-name)))))
|
imalison:default-server-file)))))
|
||||||
(defun imalison:get-this-server-filepath ()
|
(defun imalison:get-this-server-filepath ()
|
||||||
(let ((server-dir (if server-use-tcp server-auth-dir server-socket-dir)))
|
(let ((server-dir (if server-use-tcp server-auth-dir server-socket-dir)))
|
||||||
(expand-file-name server-name server-dir)))
|
(expand-file-name server-name server-dir)))
|
||||||
|
Loading…
Reference in New Issue
Block a user