Emacs: Set EMACS_SERVER env variable when starting server

master
Pierre Neidhardt 2015-04-19 12:18:54 +02:00
parent cfac5bbea9
commit eff7e306db
3 changed files with 6 additions and 3 deletions

View File

@ -280,7 +280,7 @@
(setq inferior-lisp-program "clisp")
;; Let Emacs auto-load/save sessions.
(when (and (fboundp 'server-running-p) (server-running-p))
(when (getenv "EMACS_SERVER")
(desktop-save-mode 1)
(setq history-length 250)
(setq desktop-dirname (concat emacs-cache-folder "desktop"))

View File

@ -35,7 +35,7 @@
(set-face-bold-p 'error t))
;; Blinking cursor is on only when Emacs is not daemonized.
(when (not (boundp 'server-running-p))
(unless (getenv "EMACS_SERVER")
(blink-cursor-mode -1))
;; Line numbers. Graphic version has a gray bar separating text from line

View File

@ -13,6 +13,9 @@ Calling script can have different names.
* emc: emacs instance is opened in current terminal.
* emw: if graphical, tell client to wait.
When starting the server, the EMACS_SERVER variable is set so that Emacs can
know in its initialization file whether the server is going to be started.
All emacsclient(1) options are supported.
$(emacsclient --help)
@ -32,5 +35,5 @@ else
fi
fi
[ ! -e /tmp/emacs$(id -u)/server ] && emacs --daemon --no-site-file
[ ! -e /tmp/emacs$(id -u)/server ] && EMACS_SERVER=t emacs --daemon --no-site-file
emacsclient $param "$@"