Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Additionally you do not want the server to be started in batch-mode. In my <em>.emacs</em> I therefore use</p> <pre><code>(defconst --batch-mode (or noninteractive (member "--batch-mode" command-line-args)) "True when running in batch-mode (--batch-mode command-line switch set).") </code></pre> <p>and then</p> <pre><code>(unless --batch-mode (require 'server) (when (and (= emacs-major-version 23) (= emacs-minor-version 1) (equal window-system 'w32)) ;; Suppress error "directory ~/.emacs.d/server is unsafe" on Windows. (defun server-ensure-safe-dir (dir) "Noop" t)) (server-start)) </code></pre> <p>Still the server feature is capricious: <code>server-start</code> throws when the <em>%HOME%/.emacs.d/server</em> directory does not exist. In succession Emacs won't start up again! The obvious solution is to create the missing directory and try again; I found the solution somewhere on the net but really can't remember where. The following code runs successfully for years now on several of my Windows machines:</p> <pre><code>(unless --batch-mode (require 'server) (when (and (= emacs-major-version 23) (= emacs-minor-version 1) (equal window-system 'w32)) ;; Suppress error "directory ~/.emacs.d/server is unsafe" on Windows. (defun server-ensure-safe-dir (dir) "Noop" t)) (condition-case nil (server-start) (error (let* ((server-dir (if server-use-tcp server-auth-dir server-socket-dir))) (when (and server-use-tcp (not (file-accessible-directory-p server-dir))) (display-warning 'server (format "Creating %S" server-dir) :warning) (make-directory server-dir t) (server-start)))) ) ) </code></pre> <p>This code also works when running Emacs from a stick.</p> <p>Hope this helps.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload