diff options
| author | Juanma Barranquero | 2007-10-28 15:17:08 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2007-10-28 15:17:08 +0000 |
| commit | c48254fbbfb493a29def89154bd43ca6923fdf2a (patch) | |
| tree | 76287be058e85c9fd3eadfd9791c5d873ab5064d /lisp/server.el | |
| parent | 72a69d7f8170f7224f98205e32ccf488563e28e9 (diff) | |
| download | emacs-c48254fbbfb493a29def89154bd43ca6923fdf2a.tar.gz emacs-c48254fbbfb493a29def89154bd43ca6923fdf2a.zip | |
(server-process-filter): Fix typo in docstring.
(server-log): Reflow docstrings.
(server-delete-client, server-kill-emacs-query-function): Doc fixes.
(server-goto-line-column): Use `when'.
Diffstat (limited to 'lisp/server.el')
| -rw-r--r-- | lisp/server.el | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/lisp/server.el b/lisp/server.el index 70d2283b0eb..6d73bb6ee9b 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -239,7 +239,7 @@ ENV should be in the same format as `process-environment'." | |||
| 239 | (progn ,@body)))) | 239 | (progn ,@body)))) |
| 240 | 240 | ||
| 241 | (defun server-delete-client (proc &optional noframe) | 241 | (defun server-delete-client (proc &optional noframe) |
| 242 | "Delete CLIENT, including its buffers, terminals and frames. | 242 | "Delete PROC, including its buffers, terminals and frames. |
| 243 | If NOFRAME is non-nil, let the frames live. (To be used from | 243 | If NOFRAME is non-nil, let the frames live. (To be used from |
| 244 | `delete-frame-functions'.)" | 244 | `delete-frame-functions'.)" |
| 245 | (server-log (concat "server-delete-client" (if noframe " noframe")) | 245 | (server-log (concat "server-delete-client" (if noframe " noframe")) |
| @@ -294,8 +294,7 @@ If NOFRAME is non-nil, let the frames live. (To be used from | |||
| 294 | 294 | ||
| 295 | (defun server-log (string &optional client) | 295 | (defun server-log (string &optional client) |
| 296 | "If a *server* buffer exists, write STRING to it for logging purposes. | 296 | "If a *server* buffer exists, write STRING to it for logging purposes. |
| 297 | If CLIENT is non-nil, add a description of it to the logged | 297 | If CLIENT is non-nil, add a description of it to the logged message." |
| 298 | message." | ||
| 299 | (when (get-buffer "*server*") | 298 | (when (get-buffer "*server*") |
| 300 | (with-current-buffer "*server*" | 299 | (with-current-buffer "*server*" |
| 301 | (goto-char (point-max)) | 300 | (goto-char (point-max)) |
| @@ -572,7 +571,7 @@ Server mode runs a process that accepts commands from the | |||
| 572 | "BAUDRATE" "COLUMNS" "ESCDELAY" "HOME" "LINES" | 571 | "BAUDRATE" "COLUMNS" "ESCDELAY" "HOME" "LINES" |
| 573 | "NCURSES_ASSUMED_COLORS" "NCURSES_NO_PADDING" | 572 | "NCURSES_ASSUMED_COLORS" "NCURSES_NO_PADDING" |
| 574 | "NCURSES_NO_SETBUF" "TERM" "TERMCAP" "TERMINFO" | 573 | "NCURSES_NO_SETBUF" "TERM" "TERMCAP" "TERMINFO" |
| 575 | "TERMINFO_DIRS" "TERMPATH" | 574 | "TERMINFO_DIRS" "TERMPATH" |
| 576 | ;; rxvt wants these | 575 | ;; rxvt wants these |
| 577 | "COLORFGBG" "COLORTERM") | 576 | "COLORFGBG" "COLORTERM") |
| 578 | (make-frame-on-tty tty type | 577 | (make-frame-on-tty tty type |
| @@ -590,7 +589,7 @@ Server mode runs a process that accepts commands from the | |||
| 590 | ;; C functions `child_setup' and | 589 | ;; C functions `child_setup' and |
| 591 | ;; `getenv_internal' accordingly. | 590 | ;; `getenv_internal' accordingly. |
| 592 | (environment . ,(process-get proc 'env))))))) | 591 | (environment . ,(process-get proc 'env))))))) |
| 593 | 592 | ||
| 594 | ;; ttys don't use the `display' parameter, but callproc.c does to set | 593 | ;; ttys don't use the `display' parameter, but callproc.c does to set |
| 595 | ;; the DISPLAY environment on subprocesses. | 594 | ;; the DISPLAY environment on subprocesses. |
| 596 | (set-frame-parameter frame 'display | 595 | (set-frame-parameter frame 'display |
| @@ -737,7 +736,7 @@ The following commands are accepted by the server: | |||
| 737 | on this tty until it gets a -resume command. | 736 | on this tty until it gets a -resume command. |
| 738 | 737 | ||
| 739 | `-resume' | 738 | `-resume' |
| 740 | Resume this tty frame. The client sends this string when it | 739 | Resume this tty frame. The client sends this string when it |
| 741 | gets the SIGCONT signal and it is the foreground process on its | 740 | gets the SIGCONT signal and it is the foreground process on its |
| 742 | controlling tty. | 741 | controlling tty. |
| 743 | 742 | ||
| @@ -753,9 +752,8 @@ The following commands are accepted by the client: | |||
| 753 | used to forward window change signals to it. | 752 | used to forward window change signals to it. |
| 754 | 753 | ||
| 755 | `-window-system-unsupported' | 754 | `-window-system-unsupported' |
| 756 | Signals that the server does not | 755 | Signals that the server does not support creating X frames; |
| 757 | support creating X frames; the client must try again with a tty | 756 | the client must try again with a tty frame. |
| 758 | frame. | ||
| 759 | 757 | ||
| 760 | `-print STRING' | 758 | `-print STRING' |
| 761 | Print STRING on stdout. Used to send values | 759 | Print STRING on stdout. Used to send values |
| @@ -765,8 +763,8 @@ The following commands are accepted by the client: | |||
| 765 | Signal an error (but continue processing). | 763 | Signal an error (but continue processing). |
| 766 | 764 | ||
| 767 | `-suspend' | 765 | `-suspend' |
| 768 | Suspend this terminal, i.e., stop the client process. Sent | 766 | Suspend this terminal, i.e., stop the client process. |
| 769 | when the user presses C-z." | 767 | Sent when the user presses C-z." |
| 770 | (server-log (concat "Received " string) proc) | 768 | (server-log (concat "Received " string) proc) |
| 771 | ;; First things first: let's check the authentication | 769 | ;; First things first: let's check the authentication |
| 772 | (unless (process-get proc :authenticated) | 770 | (unless (process-get proc :authenticated) |
| @@ -793,7 +791,7 @@ The following commands are accepted by the client: | |||
| 793 | ;; Save for later any partial line that remains. | 791 | ;; Save for later any partial line that remains. |
| 794 | (when (> (length string) 0) | 792 | (when (> (length string) 0) |
| 795 | (process-put proc 'previous-string string)) | 793 | (process-put proc 'previous-string string)) |
| 796 | 794 | ||
| 797 | ;; In earlier versions of server.el (where we used an `emacsserver' | 795 | ;; In earlier versions of server.el (where we used an `emacsserver' |
| 798 | ;; process), there could be multiple lines. Nowadays this is not | 796 | ;; process), there could be multiple lines. Nowadays this is not |
| 799 | ;; supported any more. | 797 | ;; supported any more. |
| @@ -931,7 +929,7 @@ The following commands are accepted by the client: | |||
| 931 | 929 | ||
| 932 | ;; Unknown command. | 930 | ;; Unknown command. |
| 933 | (t (error "Unknown command: %s" arg))))) | 931 | (t (error "Unknown command: %s" arg))))) |
| 934 | 932 | ||
| 935 | (setq frame | 933 | (setq frame |
| 936 | (case tty-name | 934 | (case tty-name |
| 937 | ((nil) (if display (server-select-display display))) | 935 | ((nil) (if display (server-select-display display))) |
| @@ -967,7 +965,7 @@ The following commands are accepted by the client: | |||
| 967 | (run-hooks 'post-command-hook))))) | 965 | (run-hooks 'post-command-hook))))) |
| 968 | 966 | ||
| 969 | (mapc 'funcall (nreverse commands)) | 967 | (mapc 'funcall (nreverse commands)) |
| 970 | 968 | ||
| 971 | ;; Delete the client if necessary. | 969 | ;; Delete the client if necessary. |
| 972 | (cond | 970 | (cond |
| 973 | (nowait | 971 | (nowait |
| @@ -1008,8 +1006,8 @@ FILE-LINE-COL should be a three-element list as described in | |||
| 1008 | `server-visit-files'." | 1006 | `server-visit-files'." |
| 1009 | (goto-line (nth 1 file-line-col)) | 1007 | (goto-line (nth 1 file-line-col)) |
| 1010 | (let ((column-number (nth 2 file-line-col))) | 1008 | (let ((column-number (nth 2 file-line-col))) |
| 1011 | (if (> column-number 0) | 1009 | (when (> column-number 0) |
| 1012 | (move-to-column (1- column-number))))) | 1010 | (move-to-column (1- column-number))))) |
| 1013 | 1011 | ||
| 1014 | (defun server-visit-files (files proc &optional nowait) | 1012 | (defun server-visit-files (files proc &optional nowait) |
| 1015 | "Find FILES and return a list of buffers created. | 1013 | "Find FILES and return a list of buffers created. |
| @@ -1159,7 +1157,7 @@ specifically for the clients and did not exist before their request for it." | |||
| 1159 | (buffer-name (current-buffer)))))) | 1157 | (buffer-name (current-buffer)))))) |
| 1160 | 1158 | ||
| 1161 | (defun server-kill-emacs-query-function () | 1159 | (defun server-kill-emacs-query-function () |
| 1162 | "Ask before exiting Emacs it has live clients." | 1160 | "Ask before exiting Emacs if it has live clients." |
| 1163 | (or (not server-clients) | 1161 | (or (not server-clients) |
| 1164 | (let (live-client) | 1162 | (let (live-client) |
| 1165 | (dolist (proc server-clients live-client) | 1163 | (dolist (proc server-clients live-client) |