diff src/process.c @ 408:501cfd01ee6d r21-2-34

Import from CVS: tag r21-2-34
author cvs
date Mon, 13 Aug 2007 11:18:11 +0200
parents a86b2b5e0111
children de805c49cfc1
line wrap: on
line diff
--- a/src/process.c	Mon Aug 13 11:17:10 2007 +0200
+++ b/src/process.c	Mon Aug 13 11:18:11 2007 +0200
@@ -1073,24 +1073,25 @@
   return XPROCESS (proc)->filter;
 }
 
-DEFUN ("process-send-region", Fprocess_send_region, 3, 3, 0, /*
-Send current contents of region as input to PROCESS.
+DEFUN ("process-send-region", Fprocess_send_region, 3, 4, 0, /*
+Send current contents of the region between START and END as input to PROCESS.
 PROCESS may be a process name or an actual process.
-Called from program, takes three arguments, PROCESS, START and END.
+BUFFER specifies the buffer to look in; if nil, the current buffer is used.
 If the region is more than 500 or so characters long,
 it is sent in several bunches.  This may happen even for shorter regions.
 Output from processes can arrive in between bunches.
 */
-       (process, start, end))
+       (process, start, end, buffer))
 {
   /* This function can GC */
   Lisp_Object proc = get_process (process);
   Bufpos st, en;
-
-  get_buffer_range_char (current_buffer, start, end, &st, &en, 0);
+  struct buffer *buf = decode_buffer (buffer, 0);
 
-  send_process (proc, Fcurrent_buffer (), 0,
-                st, en - st);
+  XSETBUFFER (buffer, buf);
+  get_buffer_range_char (buf, start, end, &st, &en, 0);
+
+  send_process (proc, buffer, 0, st, en - st);
   return Qnil;
 }