Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!sunic!dkuug!iesd!iesd.auc.dk!lbn From: lbn@iesd.auc.dk (Lars Bo Nielsen) Newsgroups: gnu.emacs Subject: Re: sending regions to child processes Message-ID: Date: 16 Jan 90 14:51:48 GMT References: Sender: lbn@iesd.auc.dk (Lars Bo Nielsen) Distribution: gnu Organization: Mathematics and Computer Science, University of Aalborg Lines: 41 In-Reply-To: windley@cheetah.ucdavis.edu's message of 16 Jan 90 04:57:38 GMT In article windley@cheetah.ucdavis.edu (Phil Windley/20000000) writes: > >Scenario: > > 1.) GNU Emacs running standard shell mode (using pty's) > 2.) Start up large interpreter under shell > 3.) Cut a large region from another window and paste it in shell window > 4.) Only first X (I don't know exactly how many) characters are sent and > the rest are ignored. >Has anyone seen this before? I'm fairly certain that its not the >interpreter, but I'm not sure. I'm not sure even how to debug this one. There is is bug/restriction in the un*x operative system. I "discovered" it when I was writing sml-mode. When you "paste" your region into the shell-window, it is handled by the emacs function: process-send-region: Send current contents of region as input to PROCESS. PROCESS may be a process name. Called from program, takes three arguments, PROCESS, START and END. Now the problem is that emacs talks to the shell (or the program running under the shell) through a pipe. Depending on which version of un*x you are running, there is a certain limit of the buffer that is allocated for the pipe. If, say, this limit is 4K and you "paste" >4K into the shell-window, this will block the pipe, and you may even run into some strange error-messages. I got around this problem, by writing a emacs-function that writes the region to a temporary file, and then sends a "use" to the interpreter (in this case sml). Hope this helps. --- Lars Bo Nielsen @ Aalborg University - Denmark lbn@iesd.auc.dk Wise words: Vir prudens non contra ventum mingit. {...}!mcvax!diku!iesd!lbn ---