diff options
| author | Stefan Kangas | 2022-09-05 15:44:01 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2022-09-05 15:46:30 +0200 |
| commit | ecbdb3b0adf0515233cac050e5366108ba0e3d03 (patch) | |
| tree | 00ca336a86b76e4e4ce491bf6e03589e318f2f85 | |
| parent | ee5c59124982978c608d7b658c53ba66d1f656d8 (diff) | |
| download | emacs-ecbdb3b0adf0515233cac050e5366108ba0e3d03.tar.gz emacs-ecbdb3b0adf0515233cac050e5366108ba0e3d03.zip | |
* lisp/server.el: Improve Commentary.
| -rw-r--r-- | lisp/server.el | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/lisp/server.el b/lisp/server.el index 65602cd1a11..7542c02d67e 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -27,12 +27,12 @@ | |||
| 27 | 27 | ||
| 28 | ;;; Commentary: | 28 | ;;; Commentary: |
| 29 | 29 | ||
| 30 | ;; This Lisp code is run in Emacs when it is to operate as | 30 | ;; This library allows Emacs to operate as a server for other |
| 31 | ;; a server for other processes. | 31 | ;; processes. |
| 32 | 32 | ||
| 33 | ;; Load this library and do M-x server-edit to enable Emacs as a server. | 33 | ;; Load this library and do `M-x server-start' to enable Emacs as a server. |
| 34 | ;; Emacs opens up a socket for communication with clients. If there are no | 34 | ;; Emacs opens up a socket for communication with clients. If there are no |
| 35 | ;; client buffers to edit, server-edit acts like (switch-to-buffer | 35 | ;; client buffers to edit, `server-edit' acts like (switch-to-buffer |
| 36 | ;; (other-buffer)) | 36 | ;; (other-buffer)) |
| 37 | 37 | ||
| 38 | ;; When some other program runs "the editor" to edit a file, | 38 | ;; When some other program runs "the editor" to edit a file, |
| @@ -42,10 +42,10 @@ | |||
| 42 | 42 | ||
| 43 | ;; Note that any number of clients may dispatch files to Emacs to be edited. | 43 | ;; Note that any number of clients may dispatch files to Emacs to be edited. |
| 44 | 44 | ||
| 45 | ;; When you finish editing a Server buffer, again call server-edit | 45 | ;; When you finish editing a Server buffer, again call `server-edit' |
| 46 | ;; to mark that buffer as done for the client and switch to the next | 46 | ;; to mark that buffer as done for the client and switch to the next |
| 47 | ;; Server buffer. When all the buffers for a client have been edited | 47 | ;; Server buffer. When all the buffers for a client have been edited |
| 48 | ;; and exited with server-edit, the client "editor" will return | 48 | ;; and exited with `server-edit', the client "editor" will return |
| 49 | ;; to the program that invoked it. | 49 | ;; to the program that invoked it. |
| 50 | 50 | ||
| 51 | ;; Your editing commands and Emacs's display output go to and from | 51 | ;; Your editing commands and Emacs's display output go to and from |
| @@ -54,25 +54,28 @@ | |||
| 54 | ;; the client. This is possible in four cases: | 54 | ;; the client. This is possible in four cases: |
| 55 | 55 | ||
| 56 | ;; 1. On a window system, where Emacs runs in one window and the | 56 | ;; 1. On a window system, where Emacs runs in one window and the |
| 57 | ;; program that wants to use "the editor" runs in another. | 57 | ;; program that wants to use "the editor" runs in another. |
| 58 | 58 | ||
| 59 | ;; 2. On a multi-terminal system, where Emacs runs on one terminal and the | 59 | ;; 2. On a multi-terminal system, where Emacs runs on one terminal and |
| 60 | ;; program that wants to use "the editor" runs on another. | 60 | ;; the program that wants to use "the editor" runs on another. |
| 61 | 61 | ||
| 62 | ;; 3. When the program that wants to use "the editor" is running | 62 | ;; 3. When the program that wants to use "the editor" is running as a |
| 63 | ;; as a subprocess of Emacs. | 63 | ;; subprocess of Emacs. |
| 64 | 64 | ||
| 65 | ;; 4. On a system with job control, when Emacs is suspended, the program | 65 | ;; 4. On a system with job control, when Emacs is suspended, the |
| 66 | ;; that wants to use "the editor" will stop and display | 66 | ;; program that wants to use "the editor" will stop and display |
| 67 | ;; "Waiting for Emacs...". It can then be suspended, and Emacs can be | 67 | ;; "Waiting for Emacs...". It can then be suspended, and Emacs can |
| 68 | ;; brought into the foreground for editing. When done editing, Emacs is | 68 | ;; be brought into the foreground for editing. When done editing, |
| 69 | ;; suspended again, and the client program is brought into the foreground. | 69 | ;; Emacs is suspended again, and the client program is brought into |
| 70 | ;; the foreground. | ||
| 70 | 71 | ||
| 71 | ;; The buffer local variable "server-buffer-clients" lists | 72 | ;; The buffer local variable `server-buffer-clients' lists |
| 72 | ;; the clients who are waiting for this buffer to be edited. | 73 | ;; the clients who are waiting for this buffer to be edited. |
| 73 | ;; The global variable "server-clients" lists all the waiting clients, | 74 | ;; The global variable `server-clients' lists all the waiting clients, |
| 74 | ;; and which files are yet to be edited for each. | 75 | ;; and which files are yet to be edited for each. |
| 75 | 76 | ||
| 77 | ;;; Code: | ||
| 78 | |||
| 76 | ;; Todo: | 79 | ;; Todo: |
| 77 | 80 | ||
| 78 | ;; - handle command-line-args-left. | 81 | ;; - handle command-line-args-left. |
| @@ -80,8 +83,6 @@ | |||
| 80 | ;; to here. | 83 | ;; to here. |
| 81 | ;; - fix up handling of the client's environment (place it in the terminal?). | 84 | ;; - fix up handling of the client's environment (place it in the terminal?). |
| 82 | 85 | ||
| 83 | ;;; Code: | ||
| 84 | |||
| 85 | (eval-when-compile (require 'cl-lib)) | 86 | (eval-when-compile (require 'cl-lib)) |
| 86 | 87 | ||
| 87 | (defgroup server nil | 88 | (defgroup server nil |