home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / gnu / emacs / bug / 1609 < prev    next >
Encoding:
Text File  |  1993-01-07  |  4.0 KB  |  105 lines

  1. Newsgroups: gnu.emacs.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!comm.mot.com!rittle
  3. From: rittle@comm.mot.com (Loren James Rittle)
  4. Subject: bug and fix in server.el
  5. Message-ID: <9301062218.AA06220@supra.comm.mot.com>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Wed, 6 Jan 1993 10:18:41 GMT
  10. Approved: bug-gnu-emacs@prep.ai.mit.edu
  11. Lines: 92
  12.  
  13. Dear GNU Emacs maintainer:
  14.  
  15. I have tracked down a bug in server.el (18.56 & 18.58 and most
  16. likely, earlier releases as well).
  17.  
  18. The problem:
  19.  
  20. If two or more emacsclient's send in requests to server at about
  21. the same time, it is possible that server.el will receive more
  22. than one client's line of input at a time from server (IMHO from
  23. looking at all the pieces, this can happen any time server.el
  24. gets behind in processing requests from server).  The process
  25. filter in server.el didn't handle this case at all.  The result
  26. was a mess and a confused server.el.
  27.  
  28. I am so glad that I obtained all the source to the text editor I
  29. use daily.  I happily provide the source diff needed to fix this
  30. problem.
  31.  
  32. Regards,
  33. Loren J. Rittle
  34.  
  35. The bug fix diffs:
  36.  
  37. *** /usr/local/lib/emacs/lisp/server.el    Mon Sep  2 19:28:21 1991
  38. --- server.el    Wed Jan  6 15:21:03 1993
  39. ***************
  40. *** 2,6 ****
  41.   ;; Copyright (C) 1986, 1987, 1990 Free Software Foundation, Inc.
  42.   ;; Author William Sommerfeld, wesommer@athena.mit.edu.
  43. ! ;; Changes by peck@sun.com and by rms.
  44.   
  45.   ;; This file is part of GNU Emacs.
  46. --- 2,6 ----
  47.   ;; Copyright (C) 1986, 1987, 1990 Free Software Foundation, Inc.
  48.   ;; Author William Sommerfeld, wesommer@athena.mit.edu.
  49. ! ;; Changes by peck@sun.com and by rms and by rittle@comm.mot.com.
  50.   
  51.   ;; This file is part of GNU Emacs.
  52. ***************
  53. *** 133,143 ****
  54.     (server-log string)
  55.     (setq string (concat server-previous-string string))
  56. !   (if (not (and (eq ?\n (aref string (1- (length string))))
  57. !         (eq 0 (string-match "Client: " string))))
  58. !       ;; If input is not complete, save it for later.
  59.         (setq server-previous-string string)
  60. !     ;; If it is complete, process it now, and discard what was saved.
  61. !     (setq string (substring string (match-end 0)))
  62.       (setq server-previous-string "")
  63.       (let ((client (list (substring string 0 (string-match " " string))))
  64.         (files nil)
  65. --- 133,145 ----
  66.     (server-log string)
  67.     (setq string (concat server-previous-string string))
  68. !   ;; Setup server-previous-string in case we fall through while loop.
  69.     (setq server-previous-string string)
  70. !   (while (eq 0 (string-match "Client: \\(.*\n\\)" string))
  71. !     ;; While a complete record is available:
  72. !     ;; process it, and discard it from the input string.
  73. !     (if (eq (length string) (1+ (match-end 0)))
  74.       (setq server-previous-string "")
  75. +       (setq server-previous-string (substring string (match-end 0))))
  76. +     (setq string (substring string (match-beginning 1) (match-end 1)))
  77.       (let ((client (list (substring string 0 (string-match " " string))))
  78.         (files nil)
  79. ***************
  80. *** 157,163 ****
  81.         ;; CLIENT is now a list (CLIENTNUM BUFFERS...)
  82.         (setq server-clients (cons client server-clients))
  83.         (switch-to-buffer (nth 1 client))
  84.         (message (substitute-command-keys
  85. !         "When done with a buffer, type \\[server-edit].")))))
  86.   
  87.   (defun server-visit-files (files client)
  88. --- 159,173 ----
  89.         ;; CLIENT is now a list (CLIENTNUM BUFFERS...)
  90.         (setq server-clients (cons client server-clients))
  91. +       ;; local addition to allow emacs to open a new window for our client,
  92. +       ;; if needed.  Considered to be needed, if name not *scratch*.
  93. +       ;(if (not (string-equal "*scratch*" (buffer-name (window-buffer))))
  94. +     ;  (split-window-vertically))
  95.         (switch-to-buffer (nth 1 client))
  96.         (message (substitute-command-keys
  97. !         "When done with a buffer, type \\[server-edit]."))
  98. !       ;; local addition to allow emacs to pop to front when a client first
  99. !       ;; accesses it. NOTE: x-pop-window is a local addition to emacs.
  100. !       ;(x-pop-window)
  101. !       (setq string server-previous-string))))
  102.   
  103.   (defun server-visit-files (files client)
  104.  
  105.