aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/server.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/server.el')
-rw-r--r--lisp/server.el34
1 files changed, 23 insertions, 11 deletions
diff --git a/lisp/server.el b/lisp/server.el
index 9dcd1f3b1d9..34ac5d7ba23 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -126,6 +126,8 @@ port number."
126 126
127(defcustom server-auth-dir (locate-user-emacs-file "server/") 127(defcustom server-auth-dir (locate-user-emacs-file "server/")
128 "Directory for server authentication files. 128 "Directory for server authentication files.
129We only use this if `server-use-tcp' is non-nil.
130Otherwise we use `server-socket-dir'.
129 131
130NOTE: On FAT32 filesystems, directories are not secure; 132NOTE: On FAT32 filesystems, directories are not secure;
131files can be read and modified by any user or process. 133files can be read and modified by any user or process.
@@ -397,16 +399,19 @@ If CLIENT is non-nil, add a description of it to the logged message."
397 ;; visible. If not (which can happen if the user's customizations call 399 ;; visible. If not (which can happen if the user's customizations call
398 ;; pop-to-buffer etc.), delete it to avoid preserving the connection after 400 ;; pop-to-buffer etc.), delete it to avoid preserving the connection after
399 ;; the last real frame is deleted. 401 ;; the last real frame is deleted.
400 (if (and (eq (frame-first-window frame) 402
401 (next-window (frame-first-window frame) 'nomini)) 403 ;; Rewritten to avoid inadvertently killing the current buffer after
402 (eq (window-buffer (frame-first-window frame)) 404 ;; `delete-frame' removed FRAME (Bug#10729).
403 (frame-parameter frame 'server-dummy-buffer))) 405 (let ((buffer (frame-parameter frame 'server-dummy-buffer)))
404 ;; The temp frame still only shows one buffer, and that is the 406 (if (and (one-window-p 'nomini frame)
405 ;; internal temp buffer. 407 (eq (window-buffer (frame-first-window frame)) buffer))
406 (delete-frame frame) 408 ;; The temp frame still only shows one buffer, and that is the
407 (set-frame-parameter frame 'visibility t)) 409 ;; internal temp buffer.
408 (kill-buffer (frame-parameter frame 'server-dummy-buffer)) 410 (delete-frame frame)
409 (set-frame-parameter frame 'server-dummy-buffer nil))) 411 (set-frame-parameter frame 'visibility t)
412 (set-frame-parameter frame 'server-dummy-buffer nil))
413 (when (buffer-live-p buffer)
414 (kill-buffer buffer)))))
410 415
411(defun server-handle-delete-frame (frame) 416(defun server-handle-delete-frame (frame)
412 "Delete the client connection when the emacsclient frame is deleted. 417 "Delete the client connection when the emacsclient frame is deleted.
@@ -1525,7 +1530,14 @@ only these files will be asked to be saved."
1525 nil) 1530 nil)
1526 1531
1527(defun server-eval-at (server form) 1532(defun server-eval-at (server form)
1528 "Eval FORM on Emacs Server SERVER." 1533 "Contact the Emacs server named SERVER and evaluate FORM there.
1534Returns the result of the evaluation, or signals an error if it
1535cannot contact the specified server. For example:
1536 \(server-eval-at \"server\" '(emacs-pid))
1537returns the process ID of the Emacs instance running \"server\".
1538This function requires the use of TCP sockets. "
1539 (or server-use-tcp
1540 (error "This function requires TCP sockets"))
1529 (let ((auth-file (expand-file-name server server-auth-dir)) 1541 (let ((auth-file (expand-file-name server server-auth-dir))
1530 (coding-system-for-read 'binary) 1542 (coding-system-for-read 'binary)
1531 (coding-system-for-write 'binary) 1543 (coding-system-for-write 'binary)