changeset 24474:3b77bf7b709e

(server-start): Set coding system for the server process to raw-text. (server-process-filter): Decode file names if necessary.
author Kenichi Handa <handa@m17n.org>
date Sat, 13 Mar 1999 00:21:24 +0000
parents e80a549e7dd8
children 1e20dcb26ff7
files lisp/server.el
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/server.el	Fri Mar 12 18:48:09 1999 +0000
+++ b/lisp/server.el	Sat Mar 13 00:21:24 1999 +0000
@@ -195,6 +195,10 @@
       (setq server-process (start-process "server" nil server-program)))
     (set-process-sentinel server-process 'server-sentinel)
     (set-process-filter server-process 'server-process-filter)
+    ;; We must receive file names without being decoded.  Those are
+    ;; decoded by server-process-filter accoding to
+    ;; file-name-coding-system.
+    (set-process-coding-system server-process 'raw-text 'raw-text)
     (process-kill-without-query server-process)))
 
 ;Process a request from the server to edit some files.
@@ -206,6 +210,9 @@
   ;; process each line individually.
   (while (string-match "\n" string)
     (let ((request (substring string 0 (match-beginning 0)))
+	  (coding-system (and default-enable-multibyte-characters
+			      (or file-name-coding-system
+				  default-file-name-coding-system)))
 	  client nowait
 	  (files nil)
 	  (lineno 1))
@@ -242,6 +249,9 @@
 				 (setq arg (replace-match "-" t t arg)))
 				(t
 				 (setq arg (replace-match " " t t arg))))))
+		      ;; Now decode the file name if necessary.
+		      (if coding-system
+			  (setq arg (decode-coding-string arg coding-system)))
 		      (setq files
 			    (cons (list arg lineno)
 				  files))