1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-29 07:58:28 +00:00

(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.
This commit is contained in:
Stefan Monnier 2008-01-26 21:54:44 +00:00
parent 15db4a13e5
commit 28cbade418
2 changed files with 52 additions and 30 deletions

View File

@ -1,7 +1,15 @@
2008-01-26 Stefan Monnier <monnier@iro.umontreal.ca>
* server.el (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.
2008-01-26 Alan Mackenzie <acm@muc.de>
* progmodes/cc-defs.el (c-save-buffer-state): Bind
buffer-file-name and buffer-file-truename to nil, to prevent
* progmodes/cc-defs.el (c-save-buffer-state):
Bind buffer-file-name and buffer-file-truename to nil, to prevent
primitives generating "buffer is read only" messages.
2008-01-20 Ulf Jasper <ulf.jasper@web.de>
@ -38,8 +46,8 @@
(`vc-directory'). Maybe the implementation can be optimized.
* net/tramp.el (tramp-dissect-file-name): Raise an error when
Tramp 2.0 syntax is used. Suggested by Trent W. Buck
<trentbuck@gmail.com>.
Tramp 2.0 syntax is used.
Suggested by Trent W. Buck <trentbuck@gmail.com>.
2008-01-26 Eli Zaretskii <eliz@gnu.org>
@ -53,7 +61,7 @@
* blank-mode.el: New version 9.1. Handle "long" line tail
visualization. Doc fix.
(blank-line-length): Renamed to blank-line-column.
(blank-line-length): Rename to blank-line-column.
(blank-chars-value-list, blank-toggle-option-alist, blank-help-text):
Initialization fix.
(blank-replace-spaces-by-tabs): New fun.
@ -108,8 +116,8 @@
2008-01-24 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-do-copy-or-rename-file): Flush the cache of
the source file in case of `rename'. Reported by Pete Forman
<pete.forman@westerngeco.com>.
the source file in case of `rename'.
Reported by Pete Forman <pete.forman@westerngeco.com>.
2008-01-24 Ken Manheimer <ken.manheimer@gmail.com>
@ -257,10 +265,9 @@
(kill-buffer-if-not-modified): New function.
(view-file): Don't kill the buffer if it is modified.
* progmodes/ebrowse.el (ebrowse-view-file-other-window):
Delete function.
(ebrowse-view/find-file-and-search-pattern): Call
view-file-other-window instead of ebrowse-view-file-other-window.
* progmodes/ebrowse.el (ebrowse-view-file-other-window): Delete.
(ebrowse-view/find-file-and-search-pattern):
Call view-file-other-window instead of ebrowse-view-file-other-window.
(ebrowse-view-file-other-frame): Don't call
current-window-configuration. Fix second argument in the call to
view-mode-enter. Doc fix.
@ -271,8 +278,8 @@
2008-01-23 Dan Nicolaescu <dann@ics.uci.edu>
* files.el (safe-local-eval-forms): Mark
(add-hook 'write-file-hooks 'time-stamp) as safe.
* files.el (safe-local-eval-forms):
Mark (add-hook 'write-file-hooks 'time-stamp) as safe.
2008-01-23 Nick Roberts <nickrob@snap.net.nz>
@ -488,8 +495,7 @@
* repeat.el (repeat-undo-count): New variable.
(repeat): For self-insertions make undo boundary only after 20
repetitions. Inhibit point recording when repeat-repeat-char is
non-nil.
repetitions. Inhibit point recording unless repeat-repeat-char is nil.
2008-01-19 Reiner Steib <Reiner.Steib@gmx.de>

View File

@ -294,11 +294,20 @@ If NOFRAME is non-nil, let the frames live. (To be used from
(defvar server-log-time-function 'current-time-string
"Function to generate timestamps for the *server* buffer.")
(defconst server-buffer " *server*"
"Buffer used internally by Emacs's server.
One use is to log the I/O for debugging purposes (see `server-log'),
the other is to provide a current buffer in which the process filter can
safely let-bind buffer-local variables like default-directory.")
(defvar server-log nil
"If non-nil, log the server's inputs and outputs in the `server-buffer'.")
(defun server-log (string &optional client)
"If a *server* buffer exists, write STRING to it for logging purposes.
"If `server-log' is non-nil, log STRING to `server-buffer'.
If CLIENT is non-nil, add a description of it to the logged message."
(when (get-buffer "*server*")
(with-current-buffer "*server*"
(when server-log
(with-current-buffer (get-buffer-create server-buffer)
(goto-char (point-max))
(insert (funcall server-log-time-function)
(cond
@ -497,7 +506,7 @@ kill any existing server communications subprocess."
;; Those are decoded by server-process-filter according
;; to file-name-coding-system.
:coding 'raw-text
;; The rest of the args depends on the kind of socket used.
;; The other args depend on the kind of socket used.
(if server-use-tcp
(list :family nil
:service t
@ -928,17 +937,24 @@ The following commands are accepted by the client:
(server-create-window-system-frame display nowait proc))
(t (server-create-tty-frame tty-name tty-type proc))))
(process-put proc 'continuation
(lexical-let ((proc proc)
(files files)
(nowait nowait)
(commands commands)
(dontkill dontkill)
(frame frame)
(tty-name tty-name))
(lambda ()
(server-execute proc files nowait commands
dontkill frame tty-name))))
(process-put
proc 'continuation
(lexical-let ((proc proc)
(files files)
(nowait nowait)
(commands commands)
(dontkill dontkill)
(frame frame)
(dir dir)
(tty-name tty-name))
(lambda ()
(with-current-buffer (get-buffer-create server-buffer)
;; Use the same cwd as the emacsclient, if possible, so
;; relative file names work correctly, even in `eval'.
(let ((default-directory
(if (file-directory-p dir) dir default-directory)))
(server-execute proc files nowait commands
dontkill frame tty-name))))))
(when (or frame files)
(server-goto-toplevel proc))