Skip to content

Commit

Permalink
New BSD config; start-server mods
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Keller committed Mar 27, 2010
1 parent 4df6c38 commit 3e29f85
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
21 changes: 15 additions & 6 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,27 @@

;;; Emacs server -------------------------------------------------------

;; no servers *started* from here, leave that to the host- files
(require 'server)

(defun is-server-running (name)
"Check is an emacs-server process is already running"
(interactive)
(let ((socket-path (concat server-socket-dir "/" name)))
;; server-running-p defined only in emacs23
(if (functionp 'server-running-p)
(server-running-p socket-path)
;; fall back, not as reliable
(file-exists-p socket-path))))

(defun start-named-server (name)
"Start a server named 'name' - ensure only 1 server of that name is running"
(interactive "sServer Name: ")
(setq server-name name)
(setq mk-server-socket-file (concat server-socket-dir "/" name))
(unless (server-running-p name)
(unless (is-server-running name)
(server-start)))

(when (or (< emacs-major-version 23) ; Using emacs23 --daemon now
(string-equal system-type "windows-nt"))
(start-named-server "server")) ; default server-name

;;; Emacs Code Browser -------------------------------------------------

(add-to-list 'load-path (concat dotfiles-dir "lib/ecb-2.40"))
Expand Down Expand Up @@ -181,7 +188,9 @@
(cond ((string= "windowsnt" systype)
(maybe-load (concat "system-windows")))
((string= "gnu/linux" systype)
(maybe-load (concat "system-linux"))))
(maybe-load (concat "system-linux")))
((string= "berkeley-unix" systype)
(maybe-load (concat "system-bsd"))))

(maybe-load (concat "host-" hostname))

Expand Down
6 changes: 6 additions & 0 deletions system-bsd.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
;;;; system-bsd.el -- bsd systems

;;; server -------------------------------------------------------------

(when (< emacs-major-version 23) ; Using emacs23 --daemon now
(start-named-server "server")) ; default server-name
5 changes: 5 additions & 0 deletions system-linux.el
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@
("javase" . w3m-browse-url)
("." . mk-choose-browser)))

;;; server -------------------------------------------------------------

(when (< emacs-major-version 23) ; Using emacs23 --daemon now
(start-named-server "server")) ; default server-name

0 comments on commit 3e29f85

Please sign in to comment.