Mercurial > emacs
changeset 99691:9df07af84d04
* server.el (server-temp-file-p): Use `string-match-p'.
(server-socket-dir): Set to nil if local sockets are unsupported.
(server-start): Don't try to delete local socket if unsupported.
(server-kill-new-buffers): Reflow docstring.
(server-delete-client, server-handle-delete-frame)
(server-save-buffers-kill-terminal): Doc fixes.
(server-send-string): Fix typo in docstring.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Tue, 18 Nov 2008 16:27:06 +0000 |
parents | 1c73544f73bf |
children | 8b12949a4a19 |
files | lisp/ChangeLog lisp/server.el |
diffstat | 2 files changed, 28 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Tue Nov 18 15:07:35 2008 +0000 +++ b/lisp/ChangeLog Tue Nov 18 16:27:06 2008 +0000 @@ -1,3 +1,13 @@ +2008-11-18 Juanma Barranquero <lekktu@gmail.com> + + * server.el (server-temp-file-p): Use `string-match-p'. + (server-socket-dir): Set to nil if local sockets are unsupported. + (server-start): Don't try to delete local socket if unsupported. + (server-kill-new-buffers): Reflow docstring. + (server-delete-client, server-handle-delete-frame) + (server-save-buffers-kill-terminal): Doc fixes. + (server-send-string): Fix typo in docstring. + 2008-11-18 Sam Steingold <sds@gnu.org> * progmodes/compile.el (compilation-start-hook): New hook.
--- a/lisp/server.el Tue Nov 18 15:07:35 2008 +0000 +++ b/lisp/server.el Tue Nov 18 16:27:06 2008 +0000 @@ -185,8 +185,8 @@ it with the Emacs server. If nil, kill only buffers as specified by `server-temp-file-regexp'. Please note that only buffers that still have a client are killed, -i.e. buffers visited with \"emacsclient --no-wait\" are never killed in -this way." +i.e. buffers visited with \"emacsclient --no-wait\" are never killed +in this way." :group 'server :type 'boolean :version "21.1") @@ -203,8 +203,10 @@ (defvar server-name "server") (defvar server-socket-dir - (format "%s/emacs%d" (or (getenv "TMPDIR") "/tmp") (user-uid)) - "The directory in which to place the server socket.") + (and (featurep 'make-network-process '(:family local)) + (format "%s/emacs%d" (or (getenv "TMPDIR") "/tmp") (user-uid))) + "The directory in which to place the server socket. +If local sockets are not supported, this is nil.") (defun server-clients-with (property value) "Return a list of clients with PROPERTY set to VALUE." @@ -238,8 +240,8 @@ (defun server-delete-client (proc &optional noframe) "Delete PROC, including its buffers, terminals and frames. -If NOFRAME is non-nil, let the frames live. (To be used from -`delete-frame-functions'.)" +If NOFRAME is non-nil, let the frames live. +Updates `server-clients'." (server-log (concat "server-delete-client" (if noframe " noframe")) proc) ;; Force a new lookup of client (prevents infinite recursion). (when (memq proc server-clients) @@ -333,7 +335,7 @@ (defun server-select-display (display) ;; If the current frame is on `display' we're all set. - ;; Similarly if we are unable to open a frames on other displays, there's + ;; Similarly if we are unable to open frames on other displays, there's ;; nothing more we can do. (unless (or (not (fboundp 'make-frame-on-display)) (equal (frame-parameter (selected-frame) 'display) display)) @@ -375,7 +377,8 @@ (set-frame-parameter frame 'server-dummy-buffer nil))) (defun server-handle-delete-frame (frame) - "Delete the client connection when the emacsclient frame is deleted." + "Delete the client connection when the emacsclient frame is deleted. +\(To be used from `delete-frame-functions'.)" (let ((proc (frame-parameter frame 'client))) (when (and (frame-live-p frame) proc @@ -425,7 +428,7 @@ arg t t)) (defun server-send-string (proc string) - "A wrapper around `proc-send-string' for logging." + "A wrapper around `process-send-string' for logging." (server-log (concat "Sent " string) proc) (process-send-string proc string)) @@ -465,9 +468,10 @@ ;; kill it dead! (ignore-errors (delete-process server-process))) ;; Delete the socket files made by previous server invocations. - (condition-case () - (delete-file (expand-file-name server-name server-socket-dir)) - (error nil)) + (when server-socket-dir + (condition-case () + (delete-file (expand-file-name server-name server-socket-dir)) + (error nil))) ;; If this Emacs already had a server, clear out associated status. (while server-clients (server-delete-client (car server-clients))) @@ -645,7 +649,6 @@ (switch-to-buffer (get-buffer-create "*scratch*") 'norecord) frame))) - (defun server-goto-toplevel (proc) (condition-case nil ;; If we're running isearch, we must abort it to allow Emacs to @@ -1144,7 +1147,7 @@ The variable `server-temp-file-regexp' controls which filenames are considered temporary." (and (buffer-file-name buffer) - (string-match server-temp-file-regexp (buffer-file-name buffer)))) + (string-match-p server-temp-file-regexp (buffer-file-name buffer)))) (defun server-done () "Offer to save current buffer, mark it as \"done\" for clients. @@ -1303,7 +1306,7 @@ ;; Called from save-buffers-kill-terminal in files.el. "Offer to save each buffer, then kill PROC. -With prefix arg, silently save all file-visiting buffers, then kill. +With ARG non-nil, silently save all file-visiting buffers, then kill. If emacsclient was started with a list of filenames to edit, then only these files will be asked to be saved."