From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: args-out-of-range for 'call-process-region'. Date: Mon, 26 Sep 2011 22:03:50 +0300 Message-ID: <83zkhrf7mx.fsf@gnu.org> References: NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1317063893 7653 80.91.229.12 (26 Sep 2011 19:04:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 26 Sep 2011 19:04:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 26 21:04:49 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R8GTx-0007Mg-9d for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Sep 2011 21:04:49 +0200 Original-Received: from localhost ([::1]:57932 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8GTw-0003TU-Mo for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Sep 2011 15:04:48 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:37928) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8GTs-0003TE-AU for help-gnu-emacs@gnu.org; Mon, 26 Sep 2011 15:04:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8GTr-0003LG-Ak for help-gnu-emacs@gnu.org; Mon, 26 Sep 2011 15:04:44 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:62286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8GTr-0003L5-0V for help-gnu-emacs@gnu.org; Mon, 26 Sep 2011 15:04:43 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LS500D008G4RI00@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Mon, 26 Sep 2011 22:03:53 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.228.8.215]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LS500D718YDH160@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Mon, 26 Sep 2011 22:03:50 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.166 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82348 Archived-At: > From: Oleksandr Gavenko > Date: Mon, 26 Sep 2011 20:26:43 +0300 > > I try eval: > > (call-process-region 1 6 "cat" nil t) > > and get > > (args-out-of-range 0 5) > call-process-region(0 5 "cat" nil t) This works for me as expected. I cannot see how could it happen that you specified positions 1 to 6 as the region and got an error about 0 to 5. > Also I get same error with such code: > > (with-temp-buffer > (insert "hello") > (message "ret: %d" (call-process-region 0 (point-max) "cat" nil t)) > (message (buffer-string))) > > What is wrong? Buffer positions start from 1, so using zero will definitely and correctly signal an error.