]> code.delx.au - gnu-emacs/blobdiff - lisp/server.el
Dired recognize dirs when file size in human units
[gnu-emacs] / lisp / server.el
index bcadcc4317abefbeb243e99af979a35ece3d689a..e4cf43125700ebab1e5988779325b5afc7e658a8 100644 (file)
@@ -1,6 +1,6 @@
 ;;; server.el --- Lisp code for GNU Emacs running as server process -*- lexical-binding: t -*-
 
-;; Copyright (C) 1986-1987, 1992, 1994-2015 Free Software Foundation,
+;; Copyright (C) 1986-1987, 1992, 1994-2016 Free Software Foundation,
 ;; Inc.
 
 ;; Author: William Sommerfeld <wesommer@athena.mit.edu>
@@ -255,6 +255,7 @@ This means that the server should not kill the buffer when you say you
 are done with it in the server.")
 (make-variable-buffer-local 'server-existing-buffer)
 
+;;;###autoload
 (defcustom server-name "server"
   "The name of the Emacs server, if this Emacs process creates one.
 The command `server-start' makes use of this.  It should not be
@@ -533,7 +534,8 @@ Creates the directory if necessary and makes sure:
                  ((and w32 (zerop uid))          ; on FAT32?
                   (display-warning
                    'server
-                   (format "Using `%s' to store Emacs-server authentication files.
+                   (format-message "\
+Using `%s' to store Emacs-server authentication files.
 Directories on FAT32 filesystems are NOT secure against tampering.
 See variable `server-auth-dir' for details."
                            (file-name-as-directory dir))
@@ -574,7 +576,7 @@ If the key is not valid, signal an error."
   (if server-auth-key
     (if (string-match-p "^[!-~]\\{64\\}$" server-auth-key)
         server-auth-key
-      (error "The key '%s' is invalid" server-auth-key))
+      (error "The key `%s' is invalid" server-auth-key))
     (server-generate-key)))
 
 ;;;###autoload
@@ -654,6 +656,7 @@ server or call `\\[server-force-delete]' to forcibly disconnect it."))
                       :noquery t
                       :sentinel #'server-sentinel
                       :filter #'server-process-filter
+                      :use-external-socket t
                       ;; We must receive file names without being decoded.
                       ;; Those are decoded by server-process-filter according
                       ;; to file-name-coding-system.  Also don't get
@@ -1171,7 +1174,7 @@ The following commands are accepted by the client:
                    ;; Allow Cygwin's emacsclient to be used as a file
                    ;; handler on MS-Windows, in which case FILENAME
                    ;; might start with a drive letter.
-                   (when (and (eq system-type 'cygwin)
+                   (when (and (fboundp 'cygwin-convert-file-name-from-windows)
                               (string-match "\\`[A-Za-z]:" file))
                      (setq file (cygwin-convert-file-name-from-windows file)))
                    (setq file (expand-file-name file dir))
@@ -1490,13 +1493,12 @@ specifically for the clients and did not exist before their request for it."
 
 (defun server-kill-emacs-query-function ()
   "Ask before exiting Emacs if it has live clients."
-  (or (not server-clients)
-      (let (live-client)
-       (dolist (proc server-clients)
-         (when (memq t (mapcar 'buffer-live-p (process-get
-                                               proc 'buffers)))
-           (setq live-client t)))
-        live-client)
+  (or (not (let (live-client)
+             (dolist (proc server-clients)
+               (when (memq t (mapcar 'buffer-live-p (process-get
+                                                     proc 'buffers)))
+                 (setq live-client t)))
+             live-client))
       (yes-or-no-p "This Emacs session has clients; exit anyway? ")))
 
 (defun server-kill-buffer ()
@@ -1648,7 +1650,7 @@ only these files will be asked to be saved."
   "Contact the Emacs server named SERVER and evaluate FORM there.
 Returns the result of the evaluation, or signals an error if it
 cannot contact the specified server.  For example:
-  (server-eval-at \"server\" '(emacs-pid))
+  (server-eval-at \"server\" \\='(emacs-pid))
 returns the process ID of the Emacs instance running \"server\"."
   (let* ((server-dir (if server-use-tcp server-auth-dir server-socket-dir))
         (server-file (expand-file-name server server-dir))