🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #98363

bug fix

#98363
From: Kirk 'UhOh' Johnson
Date: Tue, 27 Aug 1991 00:09
94 lines
3956 bytes
we're running emacs 18.57 on top of SunOS 4.1.1 and have noticed some
odd behavior -- in particular, we often run T (lisp) in an emacs
buffer via:

  (defun run-tea (arg)
    "Run an inferior T process.
  Input and output via buffer *tea*.
  With argument it asks for a command line."
    (interactive "P")
    (if arg (call-interactively 'tea)
      (switch-to-buffer (make-shell "tea" tea-program-name nil "-emacs"))
      (inferior-tea-mode)))

to send text from another buffer to the T process, we use:

  (defun tea-send-definition ()
    "Send the current definition to the T process made by M-x run-tea."
    (interactive)
    (save-excursion
     (end-of-defun)
     (let ((end (point)))
       (beginning-of-defun)
       (send-region "tea" (point) end)
       (send-string "tea" "\n"))))

when this mechanism is used to send a large region (around 1000 bytes
or more), emacs complains 

    writing to process: no more processes, tea

in the minibuffer. (needless to say, the text doesn't get sent.)

the following changes to process.c in the emacs/src directory seem to
fix this behavior (and similar behavior when sending large regions to
other processes running within an emacs buffer):

  RCS file: RCS/process.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -c -r1.1 -r1.2
  *** 1.1 1991/08/26 21:14:01
  --- 1.2 1991/08/26 21:33:39
  ***************
  *** 1920,1925 ****
  --- 1920,1930 ----
                  continue;
                }
    #endif
  + #ifdef EAGAIN
  +           /* chaiken 08/26/91: just wait! */
  +           if (errno == EAGAIN)
  +               continue;
  + #endif
              report_file_error ("writing to process", Fcons (proc, Qnil));
            }
          buf += rv;

this would appear to be due to gradual SysV creepage on the part of
SunOS; according to the write() man page, EAGAIN is a SysV-ism. thanks
to david chaiken <chaiken@vindaloo.lcs.mit.edu> for tracking this
down. and, on a lighter note:

  ;; thesis.el
  ;; david chaiken <chaiken@vindaloo.lcs.mit.edu>
  ;; august 1991

  (defun write-thesis (string)
    "Writes a thesis, all you have to do is wait."
    (interactive "sWhat type of thesis? (bachelor, master or phd): ")
    (let ((thesis-type string))
      (while (not (or (equal thesis-type "master") 
                      (equal thesis-type "phd")
                      (equal thesis-type "bachelor")))
        (setq thesis-type (read-string "Please answer bachelor, master or phd. ")))
      (let ((thesis-buffer (get-buffer-create "*Thesis*")))
        (pop-to-buffer thesis-buffer)
        (let ((message (format "Formatting thesis, please wait %s..." 
                               (if (equal thesis-type "bachelor")
                                   "1 year"
                                 (if (equal thesis-type "master")
                                     "3 years"
                                   "8 years")))))
          (funcall 'message message))
        (sit-for 0)
        (delete-windows-on thesis-buffer)
        (kill-buffer thesis-buffer)
        (while t))))

thanks muchly,

kirk

 ----------------------------------------------------------------------
 kirk johnson        tuna@lcs.mit.edu        bananas: mellow, versatile
Technical Details
Message-ID: <9108270009.AA23691@kanchenjunga.LCS.MIT.EDU>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cis.ohio-state.edu!kanchenjunga.lcs.mit.edu!tuna

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,e0492b6876b38c68,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1991-08-26 17:09:26 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cis.ohio-state.edu!kanchenjunga.lcs.mit.edu!tuna
From: tuna@kanchenjunga.lcs.mit.edu (Kirk 'UhOh' Johnson)
Newsgroups: gnu.emacs.bug
Subject: bug fix
Message-ID: <9108270009.AA23691@kanchenjunga.LCS.MIT.EDU>
Date: 27 Aug 91 00:09:26 GMT
Sender: gnulists@ai.mit.edu
Reply-To: Kirk Johnson <tuna@lcs.mit.edu>
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 94
Approved: bug-gnu-emacs@prep.ai.mit.edu