diff options
| author | Stefan Monnier | 2008-01-26 21:54:44 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-01-26 21:54:44 +0000 |
| commit | 28cbade4188cfa3037c23bcadfbbbaaf3960bc58 (patch) | |
| tree | fcdc65919e078eaa26644cf88b2c31908c92af91 | |
| parent | 15db4a13e5ae62e10bda61ed78dd5024353e6499 (diff) | |
| download | emacs-28cbade4188cfa3037c23bcadfbbbaaf3960bc58.tar.gz emacs-28cbade4188cfa3037c23bcadfbbbaaf3960bc58.zip | |
(server-buffer): New const.
(server-log): New var.
(server-log): Use them.
(server-process-filter): (Try to) run the continuation in the same cwd
as the client's.
| -rw-r--r-- | lisp/ChangeLog | 36 | ||||
| -rw-r--r-- | lisp/server.el | 46 |
2 files changed, 52 insertions, 30 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2bb50cd13a4..d6db38e535c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,7 +1,15 @@ | |||
| 1 | 2008-01-26 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * server.el (server-buffer): New const. | ||
| 4 | (server-log): New var. | ||
| 5 | (server-log): Use them. | ||
| 6 | (server-process-filter): (Try to) run the continuation in the same cwd | ||
| 7 | as the client's. | ||
| 8 | |||
| 1 | 2008-01-26 Alan Mackenzie <acm@muc.de> | 9 | 2008-01-26 Alan Mackenzie <acm@muc.de> |
| 2 | 10 | ||
| 3 | * progmodes/cc-defs.el (c-save-buffer-state): Bind | 11 | * progmodes/cc-defs.el (c-save-buffer-state): |
| 4 | buffer-file-name and buffer-file-truename to nil, to prevent | 12 | Bind buffer-file-name and buffer-file-truename to nil, to prevent |
| 5 | primitives generating "buffer is read only" messages. | 13 | primitives generating "buffer is read only" messages. |
| 6 | 14 | ||
| 7 | 2008-01-20 Ulf Jasper <ulf.jasper@web.de> | 15 | 2008-01-20 Ulf Jasper <ulf.jasper@web.de> |
| @@ -38,8 +46,8 @@ | |||
| 38 | (`vc-directory'). Maybe the implementation can be optimized. | 46 | (`vc-directory'). Maybe the implementation can be optimized. |
| 39 | 47 | ||
| 40 | * net/tramp.el (tramp-dissect-file-name): Raise an error when | 48 | * net/tramp.el (tramp-dissect-file-name): Raise an error when |
| 41 | Tramp 2.0 syntax is used. Suggested by Trent W. Buck | 49 | Tramp 2.0 syntax is used. |
| 42 | <trentbuck@gmail.com>. | 50 | Suggested by Trent W. Buck <trentbuck@gmail.com>. |
| 43 | 51 | ||
| 44 | 2008-01-26 Eli Zaretskii <eliz@gnu.org> | 52 | 2008-01-26 Eli Zaretskii <eliz@gnu.org> |
| 45 | 53 | ||
| @@ -53,7 +61,7 @@ | |||
| 53 | 61 | ||
| 54 | * blank-mode.el: New version 9.1. Handle "long" line tail | 62 | * blank-mode.el: New version 9.1. Handle "long" line tail |
| 55 | visualization. Doc fix. | 63 | visualization. Doc fix. |
| 56 | (blank-line-length): Renamed to blank-line-column. | 64 | (blank-line-length): Rename to blank-line-column. |
| 57 | (blank-chars-value-list, blank-toggle-option-alist, blank-help-text): | 65 | (blank-chars-value-list, blank-toggle-option-alist, blank-help-text): |
| 58 | Initialization fix. | 66 | Initialization fix. |
| 59 | (blank-replace-spaces-by-tabs): New fun. | 67 | (blank-replace-spaces-by-tabs): New fun. |
| @@ -108,8 +116,8 @@ | |||
| 108 | 2008-01-24 Michael Albinus <michael.albinus@gmx.de> | 116 | 2008-01-24 Michael Albinus <michael.albinus@gmx.de> |
| 109 | 117 | ||
| 110 | * net/tramp.el (tramp-do-copy-or-rename-file): Flush the cache of | 118 | * net/tramp.el (tramp-do-copy-or-rename-file): Flush the cache of |
| 111 | the source file in case of `rename'. Reported by Pete Forman | 119 | the source file in case of `rename'. |
| 112 | <pete.forman@westerngeco.com>. | 120 | Reported by Pete Forman <pete.forman@westerngeco.com>. |
| 113 | 121 | ||
| 114 | 2008-01-24 Ken Manheimer <ken.manheimer@gmail.com> | 122 | 2008-01-24 Ken Manheimer <ken.manheimer@gmail.com> |
| 115 | 123 | ||
| @@ -257,10 +265,9 @@ | |||
| 257 | (kill-buffer-if-not-modified): New function. | 265 | (kill-buffer-if-not-modified): New function. |
| 258 | (view-file): Don't kill the buffer if it is modified. | 266 | (view-file): Don't kill the buffer if it is modified. |
| 259 | 267 | ||
| 260 | * progmodes/ebrowse.el (ebrowse-view-file-other-window): | 268 | * progmodes/ebrowse.el (ebrowse-view-file-other-window): Delete. |
| 261 | Delete function. | 269 | (ebrowse-view/find-file-and-search-pattern): |
| 262 | (ebrowse-view/find-file-and-search-pattern): Call | 270 | Call view-file-other-window instead of ebrowse-view-file-other-window. |
| 263 | view-file-other-window instead of ebrowse-view-file-other-window. | ||
| 264 | (ebrowse-view-file-other-frame): Don't call | 271 | (ebrowse-view-file-other-frame): Don't call |
| 265 | current-window-configuration. Fix second argument in the call to | 272 | current-window-configuration. Fix second argument in the call to |
| 266 | view-mode-enter. Doc fix. | 273 | view-mode-enter. Doc fix. |
| @@ -271,8 +278,8 @@ | |||
| 271 | 278 | ||
| 272 | 2008-01-23 Dan Nicolaescu <dann@ics.uci.edu> | 279 | 2008-01-23 Dan Nicolaescu <dann@ics.uci.edu> |
| 273 | 280 | ||
| 274 | * files.el (safe-local-eval-forms): Mark | 281 | * files.el (safe-local-eval-forms): |
| 275 | (add-hook 'write-file-hooks 'time-stamp) as safe. | 282 | Mark (add-hook 'write-file-hooks 'time-stamp) as safe. |
| 276 | 283 | ||
| 277 | 2008-01-23 Nick Roberts <nickrob@snap.net.nz> | 284 | 2008-01-23 Nick Roberts <nickrob@snap.net.nz> |
| 278 | 285 | ||
| @@ -488,8 +495,7 @@ | |||
| 488 | 495 | ||
| 489 | * repeat.el (repeat-undo-count): New variable. | 496 | * repeat.el (repeat-undo-count): New variable. |
| 490 | (repeat): For self-insertions make undo boundary only after 20 | 497 | (repeat): For self-insertions make undo boundary only after 20 |
| 491 | repetitions. Inhibit point recording when repeat-repeat-char is | 498 | repetitions. Inhibit point recording unless repeat-repeat-char is nil. |
| 492 | non-nil. | ||
| 493 | 499 | ||
| 494 | 2008-01-19 Reiner Steib <Reiner.Steib@gmx.de> | 500 | 2008-01-19 Reiner Steib <Reiner.Steib@gmx.de> |
| 495 | 501 | ||
diff --git a/lisp/server.el b/lisp/server.el index 23f8eb36947..d3606f5c860 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -294,11 +294,20 @@ If NOFRAME is non-nil, let the frames live. (To be used from | |||
| 294 | (defvar server-log-time-function 'current-time-string | 294 | (defvar server-log-time-function 'current-time-string |
| 295 | "Function to generate timestamps for the *server* buffer.") | 295 | "Function to generate timestamps for the *server* buffer.") |
| 296 | 296 | ||
| 297 | (defconst server-buffer " *server*" | ||
| 298 | "Buffer used internally by Emacs's server. | ||
| 299 | One use is to log the I/O for debugging purposes (see `server-log'), | ||
| 300 | the other is to provide a current buffer in which the process filter can | ||
| 301 | safely let-bind buffer-local variables like default-directory.") | ||
| 302 | |||
| 303 | (defvar server-log nil | ||
| 304 | "If non-nil, log the server's inputs and outputs in the `server-buffer'.") | ||
| 305 | |||
| 297 | (defun server-log (string &optional client) | 306 | (defun server-log (string &optional client) |
| 298 | "If a *server* buffer exists, write STRING to it for logging purposes. | 307 | "If `server-log' is non-nil, log STRING to `server-buffer'. |
| 299 | If CLIENT is non-nil, add a description of it to the logged message." | 308 | If CLIENT is non-nil, add a description of it to the logged message." |
| 300 | (when (get-buffer "*server*") | 309 | (when server-log |
| 301 | (with-current-buffer "*server*" | 310 | (with-current-buffer (get-buffer-create server-buffer) |
| 302 | (goto-char (point-max)) | 311 | (goto-char (point-max)) |
| 303 | (insert (funcall server-log-time-function) | 312 | (insert (funcall server-log-time-function) |
| 304 | (cond | 313 | (cond |
| @@ -497,7 +506,7 @@ kill any existing server communications subprocess." | |||
| 497 | ;; Those are decoded by server-process-filter according | 506 | ;; Those are decoded by server-process-filter according |
| 498 | ;; to file-name-coding-system. | 507 | ;; to file-name-coding-system. |
| 499 | :coding 'raw-text | 508 | :coding 'raw-text |
| 500 | ;; The rest of the args depends on the kind of socket used. | 509 | ;; The other args depend on the kind of socket used. |
| 501 | (if server-use-tcp | 510 | (if server-use-tcp |
| 502 | (list :family nil | 511 | (list :family nil |
| 503 | :service t | 512 | :service t |
| @@ -928,17 +937,24 @@ The following commands are accepted by the client: | |||
| 928 | (server-create-window-system-frame display nowait proc)) | 937 | (server-create-window-system-frame display nowait proc)) |
| 929 | (t (server-create-tty-frame tty-name tty-type proc)))) | 938 | (t (server-create-tty-frame tty-name tty-type proc)))) |
| 930 | 939 | ||
| 931 | (process-put proc 'continuation | 940 | (process-put |
| 932 | (lexical-let ((proc proc) | 941 | proc 'continuation |
| 933 | (files files) | 942 | (lexical-let ((proc proc) |
| 934 | (nowait nowait) | 943 | (files files) |
| 935 | (commands commands) | 944 | (nowait nowait) |
| 936 | (dontkill dontkill) | 945 | (commands commands) |
| 937 | (frame frame) | 946 | (dontkill dontkill) |
| 938 | (tty-name tty-name)) | 947 | (frame frame) |
| 939 | (lambda () | 948 | (dir dir) |
| 940 | (server-execute proc files nowait commands | 949 | (tty-name tty-name)) |
| 941 | dontkill frame tty-name)))) | 950 | (lambda () |
| 951 | (with-current-buffer (get-buffer-create server-buffer) | ||
| 952 | ;; Use the same cwd as the emacsclient, if possible, so | ||
| 953 | ;; relative file names work correctly, even in `eval'. | ||
| 954 | (let ((default-directory | ||
| 955 | (if (file-directory-p dir) dir default-directory))) | ||
| 956 | (server-execute proc files nowait commands | ||
| 957 | dontkill frame tty-name)))))) | ||
| 942 | 958 | ||
| 943 | (when (or frame files) | 959 | (when (or frame files) |
| 944 | (server-goto-toplevel proc)) | 960 | (server-goto-toplevel proc)) |