diff options
| author | Paul Eggert | 2018-02-12 12:52:43 -0800 |
|---|---|---|
| committer | Paul Eggert | 2018-02-12 12:57:58 -0800 |
| commit | d43a724f4ee247ad7a95d9e6ef174c7d16195fbe (patch) | |
| tree | 48d9180e3ecfe87dea83b06939d2d6d36ac1d158 /lisp | |
| parent | e1ca0ea87222e70710b3878ac80ed01f2378f050 (diff) | |
| download | emacs-d43a724f4ee247ad7a95d9e6ef174c7d16195fbe.tar.gz emacs-d43a724f4ee247ad7a95d9e6ef174c7d16195fbe.zip | |
Minor cleanups for server-name fix (Bug#24218)
* lisp/server.el (server--external-socket-initialized): Rename
from server-external-socket-initialised, since it should be
private and Emacs uses American spelling. All uses changed.
* src/emacs.c, src/lisp.h: Revert previous changes, as the
initialization is now done in src/process.c, which already
includes the relevant files.
* src/process.c (union u_sockaddr): Move decl to top level.
(external_sock_name, Fget_external_sockname): Remove, replacing
with Vinternal__external_sockname. All uses changed.
(init_process_emacs): Deduce socket name ourselves rather than
have main.c do it. Use conv_sockaddr_to_lisp instead of doing
it by hand. Conditionalize it on HAVE_GETSOCKNAME.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/server.el | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lisp/server.el b/lisp/server.el index d2406e21bdf..70ac51e27db 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -251,15 +251,15 @@ This means that the server should not kill the buffer when you say you | |||
| 251 | are done with it in the server.") | 251 | are done with it in the server.") |
| 252 | (make-variable-buffer-local 'server-existing-buffer) | 252 | (make-variable-buffer-local 'server-existing-buffer) |
| 253 | 253 | ||
| 254 | (defvar server-external-socket-initialised nil | 254 | (defvar server--external-socket-initialized nil |
| 255 | "When an external socket is passed into Emacs, we need to call | 255 | "When an external socket is passed into Emacs, we need to call |
| 256 | `server-start' in order to initialise the connection. This flag | 256 | `server-start' in order to initialize the connection. This flag |
| 257 | prevents multiple initialisations when an external socket has | 257 | prevents multiple initializations when an external socket has |
| 258 | been consumed.") | 258 | been consumed.") |
| 259 | 259 | ||
| 260 | (defcustom server-name | 260 | (defcustom server-name |
| 261 | (if (get-external-sockname) | 261 | (if internal--external-sockname |
| 262 | (file-name-nondirectory (get-external-sockname)) | 262 | (file-name-nondirectory internal--external-sockname) |
| 263 | "server") | 263 | "server") |
| 264 | "The name of the Emacs server, if this Emacs process creates one. | 264 | "The name of the Emacs server, if this Emacs process creates one. |
| 265 | The command `server-start' makes use of this. It should not be | 265 | The command `server-start' makes use of this. It should not be |
| @@ -271,8 +271,8 @@ changed while a server is running." | |||
| 271 | ;; We do not use `temporary-file-directory' here, because emacsclient | 271 | ;; We do not use `temporary-file-directory' here, because emacsclient |
| 272 | ;; does not read the init file. | 272 | ;; does not read the init file. |
| 273 | (defvar server-socket-dir | 273 | (defvar server-socket-dir |
| 274 | (if (get-external-sockname) | 274 | (if internal--external-sockname |
| 275 | (file-name-directory (get-external-sockname)) | 275 | (file-name-directory internal--external-sockname) |
| 276 | (and (featurep 'make-network-process '(:family local)) | 276 | (and (featurep 'make-network-process '(:family local)) |
| 277 | (format "%s/emacs%d" (or (getenv "TMPDIR") "/tmp") (user-uid)))) | 277 | (format "%s/emacs%d" (or (getenv "TMPDIR") "/tmp") (user-uid)))) |
| 278 | "The directory in which to place the server socket. | 278 | "The directory in which to place the server socket. |
| @@ -628,15 +628,15 @@ To force-start a server, do \\[server-force-delete] and then | |||
| 628 | (when server-process | 628 | (when server-process |
| 629 | ;; kill it dead! | 629 | ;; kill it dead! |
| 630 | (ignore-errors (delete-process server-process))) | 630 | (ignore-errors (delete-process server-process))) |
| 631 | ;; Check to see if an uninitialised external socket has been | 631 | ;; Check to see if an uninitialized external socket has been |
| 632 | ;; passed in, if that is the case, skip checking | 632 | ;; passed in, if that is the case, skip checking |
| 633 | ;; `server-running-p' as this will return the wrong result. | 633 | ;; `server-running-p' as this will return the wrong result. |
| 634 | (if (and (get-external-sockname) | 634 | (if (and internal--external-sockname |
| 635 | (not server-external-socket-initialised)) | 635 | (not server--external-socket-initialized)) |
| 636 | (setq server-external-socket-initialised t) | 636 | (setq server--external-socket-initialized t) |
| 637 | ;; Delete the socket files made by previous server invocations. | 637 | ;; Delete the socket files made by previous server invocations. |
| 638 | (if (not (eq t (server-running-p server-name))) | 638 | (if (not (eq t (server-running-p server-name))) |
| 639 | ;; Remove any leftover socket or authentication file | 639 | ;; Remove any leftover socket or authentication file. |
| 640 | (ignore-errors | 640 | (ignore-errors |
| 641 | (let (delete-by-moving-to-trash) | 641 | (let (delete-by-moving-to-trash) |
| 642 | (delete-file server-file))) | 642 | (delete-file server-file))) |