/[emacs]/emacs/lisp/server.el
ViewVC logotype

Diff of /emacs/lisp/server.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.89 by fx, Wed Jan 15 17:49:32 2003 UTC revision 1.90 by monnier, Mon Feb 10 21:44:24 2003 UTC
# Line 100  Line 100 
100  (defvar server-process nil  (defvar server-process nil
101    "The current server process.")    "The current server process.")
102    
 (defvar server-previous-strings nil)  
   
103  (defvar server-clients nil  (defvar server-clients nil
104    "List of current server clients.    "List of current server clients.
105  Each element is (CLIENTID BUFFERS...) where CLIENTID is a string  Each element is (CLIENTID BUFFERS...) where CLIENTID is a string
# Line 179  are done with it in the server.") Line 177  are done with it in the server.")
177          (or (bolp) (newline)))))          (or (bolp) (newline)))))
178    
179  (defun server-sentinel (proc msg)  (defun server-sentinel (proc msg)
   ;; Purge server-previous-strings of the now irrelevant entry.  
   (setq server-previous-strings  
         (delq (assq proc server-previous-strings) server-previous-strings))  
180    (let ((client (assq proc server-clients)))    (let ((client (assq proc server-clients)))
181      ;; Remove PROC from the list of clients.      ;; Remove PROC from the list of clients.
182      (when client      (when client
# Line 282  Server mode runs a process that accepts Line 277  Server mode runs a process that accepts
277    "Process a request from the server to edit some files.    "Process a request from the server to edit some files.
278  PROC is the server process.  Format of STRING is \"PATH PATH PATH... \\n\"."  PROC is the server process.  Format of STRING is \"PATH PATH PATH... \\n\"."
279    (server-log string proc)    (server-log string proc)
280    (let ((ps (assq proc server-previous-strings)))    (let ((prev (process-get proc 'previous-string)))
281      (when (cdr ps)      (when prev
282        (setq string (concat (cdr ps) string))        (setq string (concat prev string))
283        (setcdr ps nil)))        (process-put proc 'previous-string nil)))
284    ;; If the input is multiple lines,    ;; If the input is multiple lines,
285    ;; process each line individually.    ;; process each line individually.
286    (while (string-match "\n" string)    (while (string-match "\n" string)
# Line 362  PROC is the server process.  Format of S Line 357  PROC is the server process.  Format of S
357                        "When done with a buffer, type \\[server-edit]")))))))                        "When done with a buffer, type \\[server-edit]")))))))
358    ;; Save for later any partial line that remains.    ;; Save for later any partial line that remains.
359    (when (> (length string) 0)    (when (> (length string) 0)
360      (let ((ps (assq proc server-previous-strings)))      (process-put proc 'previous-string string)))
       (if ps (setcdr ps string)  
         (push (cons proc string) server-previous-strings)))))  
361    
362  (defun server-goto-line-column (file-line-col)  (defun server-goto-line-column (file-line-col)
363    (goto-line (nth 1 file-line-col))    (goto-line (nth 1 file-line-col))

Legend:
Removed from v.1.89  
changed lines
  Added in v.1.90

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26