From unknown Mon Jun 23 14:57:43 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#40576 <40576@debbugs.gnu.org> To: bug#40576 <40576@debbugs.gnu.org> Subject: Status: call-process-region does not accept nil as first argument Reply-To: bug#40576 <40576@debbugs.gnu.org> Date: Mon, 23 Jun 2025 21:57:43 +0000 retitle 40576 call-process-region does not accept nil as first argument reassign 40576 emacs submitter 40576 Pietro Giorgianni severity 40576 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 11:43:59 2020 Received: (at submit) by debbugs.gnu.org; 12 Apr 2020 15:43:59 +0000 Received: from localhost ([127.0.0.1]:58684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNem6-0003ip-OU for submit@debbugs.gnu.org; Sun, 12 Apr 2020 11:43:59 -0400 Received: from lists.gnu.org ([209.51.188.17]:49318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNdYU-0001pB-58 for submit@debbugs.gnu.org; Sun, 12 Apr 2020 10:25:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33928) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNdYQ-0008PT-VI for bug-gnu-emacs@gnu.org; Sun, 12 Apr 2020 10:25:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNdYP-0007uj-UK for bug-gnu-emacs@gnu.org; Sun, 12 Apr 2020 10:25:46 -0400 Received: from mail-vk1-xa29.google.com ([2607:f8b0:4864:20::a29]:34865) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jNdYP-0007uV-P6 for bug-gnu-emacs@gnu.org; Sun, 12 Apr 2020 10:25:45 -0400 Received: by mail-vk1-xa29.google.com with SMTP id u8so1341616vkl.2 for ; Sun, 12 Apr 2020 07:25:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=cpRSbCCwezKukndl0zlEmKAdRv1fsuJLrx60Z9ZL8Js=; b=J5+VrphER6iXb2b5xZCUgN9N2zw9mrV46QegNiTn1QhDHGRgsbWW+VI6JG5yMerdqB irfVMRP5qpeVWxnphwwAW2+6B5Aj8K4/+kvJB5g3ppDTNfYEK/NZyHJT4eRy67pq8RAJ JNK20f2+yz9D1TIyq/NvSDjiPspn9hDrvwOuhRKWi1vlo7O7VS+zNnEYTjnVle2UIz3M Id4zX2ZF28YYNwYf+R0s4/5g4AYMTtQFy+50DBitV5ljHW9Sez3JRZWkW8/cZQU48BOC ioX+hounTisDWb9DklShP8MZHZ0PaT4NMdrYYeL+8rprTtR1f4JPfZUSfx6oBx0LwiDv GV2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=cpRSbCCwezKukndl0zlEmKAdRv1fsuJLrx60Z9ZL8Js=; b=rZ1xi+cUCypUjaPwyd+laSpq4iplQrQZbnqst1blNVKpr8Av32TmcpVlOwmoPPDvy9 mm00ZAnvZnzrn1Bd+g1LPEt97QJG/x6xd/8ohteFQsHZZi5UV+tlNgUWkjBVpbjdG7tV 4MwPvOgPkh+MAIRs/YmYkFrasznu8diQzsIoZgdBJjGFRRgH8hYv2vL6/7pQQ5XMOrEV 7Wu6vmnuP/AwiF9JV3yLLUu7FGvJ0HC2BTWt7LETyrAvKhMFmTc3YOdl7KmYFNt6n4SY V7io4G64L99uFdGjRjnrfy96SUKp4dIxWv/DL/6oxbB4PoEQU+hhHKTi+Sioq1owV5/x YLIg== X-Gm-Message-State: AGi0PuaGHDvFjJzGy18oJbG14o+DxDIfDB1HkSVRloxF/08kKAjH8CuC 6YF5O5YpJ9xUk6JElY0gXFgDGOXEwoa9AmTyDeoD+gjH X-Google-Smtp-Source: APiQypJsHU0HvkTezPWBIASwWzhhH76TEhKKXgnb1P5jg0F6DByVQjGhSi6nU0rFQXiqbBt6ZJCleGemxSojy1HyvrI= X-Received: by 2002:a1f:d841:: with SMTP id p62mr8677262vkg.13.1586701544603; Sun, 12 Apr 2020 07:25:44 -0700 (PDT) MIME-Version: 1.0 From: Pietro Giorgianni Date: Sun, 12 Apr 2020 16:25:33 +0200 Message-ID: Subject: call-process-region does not accept nil as first argument To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="000000000000ee449805a318bd97" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::a29 X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, According to the documentation of call-process-region, If START is nil, that means to use the entire buffer contents; END is ignored. But when I run: (call-process-region nil nil "/bin/cat" t (current-buffer)) I get: Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil) call-process-region(nil nil "/bin/cat" t [...] Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (giorgian[at]gmail.com) 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 HTML_MESSAGE BODY: HTML included in message -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [209.51.188.17 listed in list.dnswl.org] 2.0 SPOOFED_FREEMAIL No description available. X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 12 Apr 2020 11:43:57 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --000000000000ee449805a318bd97 Content-Type: text/plain; charset="UTF-8" Hi, According to the documentation of call-process-region, If START is nil, that means to use the entire buffer contents; END is ignored. But when I run: (call-process-region nil nil "/bin/cat" t (current-buffer)) I get: Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil) call-process-region(nil nil "/bin/cat" t #) eval((call-process-region nil nil "/bin/cat" t (current-buffer)) nil) elisp--eval-last-sexp(t) eval-last-sexp(t) eval-print-last-sexp(nil) funcall-interactively(eval-print-last-sexp nil) call-interactively(eval-print-last-sexp nil nil) command-execute(eval-print-last-sexp) If, instead, I run: (call-process-region (point-min) (point-max) "/bin/cat" t (current-buffer)) It works. Am I interpreting the documentation wrong? Emacs version: GNU Emacs 26.3 (build 1, x86_64-apple-darwin18.2.0, NS appkit-1671.20 Version 10.14.3 (Build 18D109)) of 2019-09-02 Thank you --000000000000ee449805a318bd97 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

According to the documen= tation of call-process-region,
=C2=A0 If START is nil, that = means to use the entire buffer contents; END is
ignored.
<= br>
But when I run:
(call-process-region nil nil "= /bin/cat" t (current-buffer))
I get:
Debugger ente= red--Lisp error: (wrong-type-argument integer-or-marker-p nil)
=C2=A0 ca= ll-process-region(nil nil "/bin/cat" t #<buffer *scratch*>)=
=C2=A0 eval((call-process-region nil nil "/bin/cat" t (curren= t-buffer)) nil)
=C2=A0 elisp--eval-last-sexp(t)
=C2=A0 eval-last-sexp= (t)
=C2=A0 eval-print-last-sexp(nil)
=C2=A0 funcall-interactively(eva= l-print-last-sexp nil)
=C2=A0 call-interactively(eval-print-last-sexp ni= l nil)
=C2=A0 command-execute(eval-print-last-sexp)

=
If, instead, I run:
(call-process-region (point-min) (point-= max) "/bin/cat" t (current-buffer))

It w= orks.

Am I interpreting the documentation wrong?

Emacs version:
GNU Emacs 26.3 (build= 1, x86_64-apple-darwin18.2.0, NS appkit-1671.20 Version 10.14.3 (Build 18D= 109)) of 2019-09-02


Thank you
--000000000000ee449805a318bd97-- From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 12:02:01 2020 Received: (at 40576) by debbugs.gnu.org; 12 Apr 2020 16:02:01 +0000 Received: from localhost ([127.0.0.1]:58695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNf3Y-0004B2-L1 for submit@debbugs.gnu.org; Sun, 12 Apr 2020 12:02:01 -0400 Received: from mail-ot1-f47.google.com ([209.85.210.47]:38226) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNf3V-0004Ak-B5 for 40576@debbugs.gnu.org; Sun, 12 Apr 2020 12:01:57 -0400 Received: by mail-ot1-f47.google.com with SMTP id n8so1431162otk.5 for <40576@debbugs.gnu.org>; Sun, 12 Apr 2020 09:01:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jqObcBaApbDD/waqdtfV6nRqhI1A6d7LiggSgKvLwhI=; b=sXNgo4hHoPirzc9/+j9O20FiSd2iW1ZzFu8wWLGQHuCtLRnSw693aWR9udxNRXTJJ6 WyvrFQLpSreY0WNx1SJM6vwDCYKFBQkJ46usKJ3Q/c91cPUOmqsM+C+WRYL3QosXdAbV Dc+SJWEplKEkA2/xYZe1UTtlb7CzWwu7BBma27tFDg/RBeikS7dr1SzKcHP6p1QRC3Cm Qn+8BPCwld2bO0OHOOiF/g8iBkUVMcKAIUQNAs9Fa2mVl/Vn/zWD0BPVMhcujr0ZwQ+k cQbJ9PmFT5HpmSrfTJJdx5r3JDlTCHissecFmxw0ouVTSbpITvUWW1RlbQI+f4EWiez5 0zxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jqObcBaApbDD/waqdtfV6nRqhI1A6d7LiggSgKvLwhI=; b=oM7+xSNqkpfIWYwKecK0zh5IJyw2zEqsuol7H0xqAFn5j2n7hsQxDmL5FyU/rdI5QS TxOXp3+qD0LhErxbe9xBrnPKlsok0a0mYptWbYhgD1xqkTdfAEFcDgcD1gKa1PBKR/64 F/r3d3Vx+9vxoL3r9HXuPoBu8knPu4NcKb7Z0Oykyl8vhFLGJHRcqZSgAy7S35QjeGLK FsVyZOjcTTmiCqpkmsm263ESxf86i/7I9nbAFHJCwQWAjksHbfESKxWWuYDyqv1yiIrg ce/2lg59rBeXHAPlhHOVqbYetoCEdMQXfF9wde79hTa3RpeQ8CRERRDdteV+cugfxvAF apBg== X-Gm-Message-State: AGi0Pua9XmzXDZNyQMOl2e64WDI4wDRKUcw4M6cjRKXbaGqpxcxN97mf XWr6xMq6foUn+MXOgU8t+Z1tk39frvQAon/bsvc= X-Google-Smtp-Source: APiQypIWEUM9KNSJnaWEbyvPiWH6JgOWKVQyQU9KLuIzGN79Ry5L6jWXnVK57LGDZsmvxoR6YQua3AmbMSlD8TmdkH8= X-Received: by 2002:a05:6830:1e79:: with SMTP id m25mr11248857otr.36.1586707311608; Sun, 12 Apr 2020 09:01:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Philipp Stephani Date: Sun, 12 Apr 2020 18:01:40 +0200 Message-ID: Subject: Re: bug#40576: call-process-region does not accept nil as first argument To: Pietro Giorgianni Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 40576 Cc: 40576@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Am So., 12. Apr. 2020 um 17:44 Uhr schrieb Pietro Giorgianni : > > Hi, > > According to the documentation of call-process-region, > If START is nil, that means to use the entire buffer contents; END is > ignored. > > But when I run: > (call-process-region nil nil "/bin/cat" t (current-buffer)) > I get: > Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil) > call-process-region(nil nil "/bin/cat" t #) > eval((call-process-region nil nil "/bin/cat" t (current-buffer)) nil) > elisp--eval-last-sexp(t) > eval-last-sexp(t) > eval-print-last-sexp(nil) > funcall-interactively(eval-print-last-sexp nil) > call-interactively(eval-print-last-sexp nil nil) > command-execute(eval-print-last-sexp) > > If, instead, I run: > (call-process-region (point-min) (point-max) "/bin/cat" t (current-buffer)) > > It works. > > Am I interpreting the documentation wrong? Nope, looks like a genuine bug (that happens only if DELETE is non-nil). From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 12:21:26 2020 Received: (at 40576) by debbugs.gnu.org; 12 Apr 2020 16:21:26 +0000 Received: from localhost ([127.0.0.1]:58709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNfML-0004fE-TC for submit@debbugs.gnu.org; Sun, 12 Apr 2020 12:21:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56827) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNfMJ-0004ev-Oi for 40576@debbugs.gnu.org; Sun, 12 Apr 2020 12:21:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60990) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jNfME-0008FV-L0; Sun, 12 Apr 2020 12:21:18 -0400 Received: from [176.228.60.248] (port=2125 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jNfMD-0007te-M2; Sun, 12 Apr 2020 12:21:18 -0400 Date: Sun, 12 Apr 2020 19:21:06 +0300 Message-Id: <83zhbgk74d.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-Reply-To: (message from Philipp Stephani on Sun, 12 Apr 2020 18:01:40 +0200) Subject: Re: bug#40576: call-process-region does not accept nil as first argument References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40576 Cc: 40576@debbugs.gnu.org, giorgian@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Philipp Stephani > Date: Sun, 12 Apr 2020 18:01:40 +0200 > Cc: 40576@debbugs.gnu.org > > > According to the documentation of call-process-region, > > If START is nil, that means to use the entire buffer contents; END is > > ignored. > > > > But when I run: > > (call-process-region nil nil "/bin/cat" t (current-buffer)) > > I get: > > Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil) > > call-process-region(nil nil "/bin/cat" t #) > > eval((call-process-region nil nil "/bin/cat" t (current-buffer)) nil) > > elisp--eval-last-sexp(t) > > eval-last-sexp(t) > > eval-print-last-sexp(nil) > > funcall-interactively(eval-print-last-sexp nil) > > call-interactively(eval-print-last-sexp nil nil) > > command-execute(eval-print-last-sexp) > > > > If, instead, I run: > > (call-process-region (point-min) (point-max) "/bin/cat" t (current-buffer)) > > > > It works. > > > > Am I interpreting the documentation wrong? > > Nope, looks like a genuine bug (that happens only if DELETE is non-nil). Right. But there's more here than meets the eye, because the change after which we started advertising the special meaning of nil for START exposed a problem: write_region, called from create_temp_file, has special meaning for START = nil: it widens the buffer and writes the entire buffer contents to the temp file. Which isn't right when write_region is called from call-process-region, as it allows access to inaccessible portion of the buffer, something we shouldn't do. So I propose the patch below to fix this bug on the master branch. Any objections? diff --git a/src/callproc.c b/src/callproc.c index 8883415..7f495a3 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -1039,8 +1039,8 @@ DEFUN ("call-process-region", Fcall_process_region, Scall_process_region, START and END are normally buffer positions specifying the part of the buffer to send to the process. -If START is nil, that means to use the entire buffer contents; END is -ignored. +If START is nil, that means to use the entire accessible part of the +buffer; END is ignored. If START is a string, then send that string to the process instead of any buffer contents; END is ignored. The remaining arguments are optional. @@ -1087,6 +1087,14 @@ t (mix it with ordinary output), or a file name string. empty_input = XFIXNUM (start) == XFIXNUM (end); } + if (NILP (start)) + { + XSETFASTINT (start, BEGV); + args[0] = start; + XSETFASTINT (end, ZV); + args[1] = end; + } + if (!empty_input) fd = create_temp_file (nargs, args, &infile); else From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 12:45:16 2020 Received: (at 40576) by debbugs.gnu.org; 12 Apr 2020 16:45:16 +0000 Received: from localhost ([127.0.0.1]:58723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNfjQ-0005Fl-Co for submit@debbugs.gnu.org; Sun, 12 Apr 2020 12:45:16 -0400 Received: from mail-ot1-f49.google.com ([209.85.210.49]:46813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNfjP-0005FT-3z for 40576@debbugs.gnu.org; Sun, 12 Apr 2020 12:45:15 -0400 Received: by mail-ot1-f49.google.com with SMTP id w12so6016816otm.13 for <40576@debbugs.gnu.org>; Sun, 12 Apr 2020 09:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1DFuo5Q+PKzs94SycesqmKsjcXgHJxd1ZGZlknEd5r4=; b=lQFOnpYTQ+yU9fIW9F1DOPZJlHOi7grl97vB9s5z8PEA5fFDQWFEx0B80x3aeebYu/ bk7hEpIqE/iWJ1t0dZ1pwWjkDfXTjq4dWqlJG0bZGkVkIbJazKPgEVoBzuegZu7oD+hE fj7N8wBcb8shYnQUAWI5IlIQ/6S+XJbx7uiMv9MGpzGOjuulUuu/TXIu4EILM58XcG+b f5atgkzRRM2PfWUIGB6EoKZBT2ZvP+/RqMBgGb2JATTt1Wu0VC3fBBJdytIl9XrGrPWd rgDWJpMeo2hL+7sjAypriXgt3WzbmoBqa+eRE75aIeH9LTIJy2k1ZQpkKmIUAYoPxo5S 5/Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1DFuo5Q+PKzs94SycesqmKsjcXgHJxd1ZGZlknEd5r4=; b=V/NhclGIqjzqULYCXpZ7kQFnoM28LaWQ3Ll4l3erwTD605KiWtLehnYeCwmV9sfY+I dcppgxY23d5LxPEUh/pUq6WJd1m/GByz1/36Lc1W0BD7c5cjV+VVRzklkaV9a8xzDoA4 HIJkMTXR1Hdo5ybib5YXuD+bRwhtvSfBEt/ox1C+yx12QRwFdNotTh1+f4Qj6Uq84T3f 2Se2hLxg/ZtmHdNvOSFtzJ5JM83a8nh0KMQRTVX+438aGXK0MZp8CnEl3Dca0SQ96cwv 9+7pjVp0wdJv2gFFooFkbkexMaZPAV+N4hk9S7JDk8pr+fR0dOmliT7bqWwCfwhw/N0b Mh1g== X-Gm-Message-State: AGi0PubrfCzG1LLnz61SkjhAp88tAYeKXQD5328RFmZBYT2DM3TMmYYl Yl6xPUFSxN3MkP7oxjrMblaCB4nRMYG8rNPNU7s= X-Google-Smtp-Source: APiQypI6rKyHoTAJgVAKkPXGirL3JL991HoMhYq+q+VLEmTgS+HAcSP/0B7net4QMIepCzUDfeK7UJ0ow2IIkMhKsl0= X-Received: by 2002:a05:6830:1e79:: with SMTP id m25mr11364689otr.36.1586709909380; Sun, 12 Apr 2020 09:45:09 -0700 (PDT) MIME-Version: 1.0 References: <83zhbgk74d.fsf@gnu.org> In-Reply-To: <83zhbgk74d.fsf@gnu.org> From: Philipp Stephani Date: Sun, 12 Apr 2020 18:44:58 +0200 Message-ID: Subject: Re: bug#40576: call-process-region does not accept nil as first argument To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 40576 Cc: 40576@debbugs.gnu.org, Pietro Giorgianni X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Am So., 12. Apr. 2020 um 18:21 Uhr schrieb Eli Zaretskii : > > > From: Philipp Stephani > > Date: Sun, 12 Apr 2020 18:01:40 +0200 > > Cc: 40576@debbugs.gnu.org > > > > > According to the documentation of call-process-region, > > > If START is nil, that means to use the entire buffer contents; END is > > > ignored. > > > > > > But when I run: > > > (call-process-region nil nil "/bin/cat" t (current-buffer)) > > > I get: > > > Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil) > > > call-process-region(nil nil "/bin/cat" t #) > > > eval((call-process-region nil nil "/bin/cat" t (current-buffer)) nil) > > > elisp--eval-last-sexp(t) > > > eval-last-sexp(t) > > > eval-print-last-sexp(nil) > > > funcall-interactively(eval-print-last-sexp nil) > > > call-interactively(eval-print-last-sexp nil nil) > > > command-execute(eval-print-last-sexp) > > > > > > If, instead, I run: > > > (call-process-region (point-min) (point-max) "/bin/cat" t (current-buffer)) > > > > > > It works. > > > > > > Am I interpreting the documentation wrong? > > > > Nope, looks like a genuine bug (that happens only if DELETE is non-nil). > > Right. But there's more here than meets the eye, because the change > after which we started advertising the special meaning of nil for > START exposed a problem: write_region, called from create_temp_file, > has special meaning for START = nil: it widens the buffer and writes > the entire buffer contents to the temp file. Which isn't right when > write_region is called from call-process-region, as it allows access > to inaccessible portion of the buffer, something we shouldn't do. I think that's pretty much intentional. The documentation says "If START is nil, that means to use the entire buffer contents" It specifically doesn't say to only use the accessible portion of the buffer. Given that this behavior probably has been in place since commit 561cb8e159e7eff7a6487a45a1cfab47ba456030 from 1994, it would be rather unwise to introduce such a breaking change. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 13:07:20 2020 Received: (at 40576) by debbugs.gnu.org; 12 Apr 2020 17:07:20 +0000 Received: from localhost ([127.0.0.1]:58751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNg4l-0005p5-Rr for submit@debbugs.gnu.org; Sun, 12 Apr 2020 13:07:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNg4k-0005or-2p for 40576@debbugs.gnu.org; Sun, 12 Apr 2020 13:07:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33227) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jNg4f-0001gZ-00; Sun, 12 Apr 2020 13:07:13 -0400 Received: from [176.228.60.248] (port=4912 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jNg4e-0006ZL-8x; Sun, 12 Apr 2020 13:07:12 -0400 Date: Sun, 12 Apr 2020 20:07:01 +0300 Message-Id: <83y2r0k4zu.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-Reply-To: (message from Philipp Stephani on Sun, 12 Apr 2020 18:44:58 +0200) Subject: Re: bug#40576: call-process-region does not accept nil as first argument References: <83zhbgk74d.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40576 Cc: 40576@debbugs.gnu.org, giorgian@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Philipp Stephani > Date: Sun, 12 Apr 2020 18:44:58 +0200 > Cc: Pietro Giorgianni , 40576@debbugs.gnu.org > > > Right. But there's more here than meets the eye, because the change > > after which we started advertising the special meaning of nil for > > START exposed a problem: write_region, called from create_temp_file, > > has special meaning for START = nil: it widens the buffer and writes > > the entire buffer contents to the temp file. Which isn't right when > > write_region is called from call-process-region, as it allows access > > to inaccessible portion of the buffer, something we shouldn't do. > > I think that's pretty much intentional. The documentation says > > "If START is nil, that means to use the entire buffer contents" That sentence is an addition made in 2016, AFAICT. > It specifically doesn't say to only use the accessible portion of the > buffer. Given that this behavior probably has been in place since > commit 561cb8e159e7eff7a6487a45a1cfab47ba456030 from 1994, it would be > rather unwise to introduce such a breaking change. But then START = nil would work, whereas START = 2 will signal an error if the buffer is narrowed. Does that make sense? From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 13:07:22 2020 Received: (at 40576-done) by debbugs.gnu.org; 12 Apr 2020 17:07:22 +0000 Received: from localhost ([127.0.0.1]:58754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNg4o-0005pJ-3D for submit@debbugs.gnu.org; Sun, 12 Apr 2020 13:07:22 -0400 Received: from mail-ot1-f50.google.com ([209.85.210.50]:34222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNg4m-0005ou-DD for 40576-done@debbugs.gnu.org; Sun, 12 Apr 2020 13:07:21 -0400 Received: by mail-ot1-f50.google.com with SMTP id m2so6975915otr.1 for <40576-done@debbugs.gnu.org>; Sun, 12 Apr 2020 10:07:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/lsk7ujMu2E5e4/8uxigEQ2bk4H2aOP1yBR24Rb0VS4=; b=igN+xaJ7jOA+kwi20q5ijD6dSgaQUCApGnx71HhxvgjVph6lhzWFeKyckC5ZIBikGr mwV3j/P0ZlMgzQPEAQW7BV3/rN7TDLULhJ3ZqOYLtesUyiT2N3hBXTyPTeCNSQ/fhOu2 aEK83S83FLjEKfwFRilRRcU62Sjttd0REF2R4LntGH1PaXXgr0LXDf6JuQlwHUssw4o+ uc0AfLobF7d3SKXCuLwSMGLDmABt+SmwgmJdbgqIj+iixVysvifLyGRp7XuTCIv6qhY9 i3XjHJVyiqePrCUKuVhYKLBFZGMXpS61rXbVzvn69+Hka71IBNCelJ9ycLcobT3FNpHH jm7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/lsk7ujMu2E5e4/8uxigEQ2bk4H2aOP1yBR24Rb0VS4=; b=FzU2hxxAqbSm+6W8iibD7VKF3JO4iUxhToEjR9miSp+KuaQg1lXmp6sYRrwhjWxAz0 PPBPHD4nXL3ygPBlmKqX8QFtIyISH/kPjPihVD/NXtQTvge5j0sIbSi1g4zTwXpERLpm FIyku/RkvQSj1KR++vHElkyC3Q0n1nY7d5T4C9qqaU9iZMT6A/hC6yjpQ5BHdy8Rzp0A Yb6o7+VPlv47hL4aItdPo4k5utJMjiIDg6V9MLJiEdFKIzl+jy7yZACIx6f6U8LwY7ch SpqBP7Px1jij1NGHEz+TfP746FISmr7/6g9w71LaWSnn1aMc7BULALdT7N2P/T3T9uvj 2Ftw== X-Gm-Message-State: AGi0PuY0rt6uqw3phsUa7nYz7s2vr/Gx+zwKHj7dsCcl3NBID6iOTV2h tiFmEDtNbnlcSNA8sSbtA7VHPKGzLkqaB2YqVtk= X-Google-Smtp-Source: APiQypJAK1ArNRrX+CQBpPceTchaVIXf3E5QAgMaaJmXTnjmmhLsYgYl+6Ij6PRUvdMAY+bTsS1vvwQgYiVOHTmTeIE= X-Received: by 2002:a9d:2963:: with SMTP id d90mr10985361otb.149.1586711234849; Sun, 12 Apr 2020 10:07:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Philipp Stephani Date: Sun, 12 Apr 2020 19:07:03 +0200 Message-ID: Subject: Re: bug#40576: call-process-region does not accept nil as first argument To: Pietro Giorgianni Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 40576-done Cc: 40576-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Am So., 12. Apr. 2020 um 18:01 Uhr schrieb Philipp Stephani : > > Am So., 12. Apr. 2020 um 17:44 Uhr schrieb Pietro Giorgianni > : > > > > Hi, > > > > According to the documentation of call-process-region, > > If START is nil, that means to use the entire buffer contents; END is > > ignored. > > > > But when I run: > > (call-process-region nil nil "/bin/cat" t (current-buffer)) > > I get: > > Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil) > > call-process-region(nil nil "/bin/cat" t #) > > eval((call-process-region nil nil "/bin/cat" t (current-buffer)) nil) > > elisp--eval-last-sexp(t) > > eval-last-sexp(t) > > eval-print-last-sexp(nil) > > funcall-interactively(eval-print-last-sexp nil) > > call-interactively(eval-print-last-sexp nil nil) > > command-execute(eval-print-last-sexp) > > > > If, instead, I run: > > (call-process-region (point-min) (point-max) "/bin/cat" t (current-buffer)) > > > > It works. > > > > Am I interpreting the documentation wrong? > > Nope, looks like a genuine bug (that happens only if DELETE is non-nil). I've now fixed this on master (commit 42306747d8). From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 13:08:17 2020 Received: (at 40576) by debbugs.gnu.org; 12 Apr 2020 17:08:17 +0000 Received: from localhost ([127.0.0.1]:58762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNg5h-0005rK-Bx for submit@debbugs.gnu.org; Sun, 12 Apr 2020 13:08:17 -0400 Received: from mail-ot1-f54.google.com ([209.85.210.54]:40884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNg5g-0005r6-AB for 40576@debbugs.gnu.org; Sun, 12 Apr 2020 13:08:16 -0400 Received: by mail-ot1-f54.google.com with SMTP id i27so4046137ota.7 for <40576@debbugs.gnu.org>; Sun, 12 Apr 2020 10:08:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WNIzZM/HGNVuCHPySS85yQsDDzeztT5gAummDuPnBNw=; b=SLNwEKs/y5ZlzV46nx+9WRcwHs1QC1duIAS2Etc95wrVeXEHVSmPyA+4NTufa46W+C 764Go7oZgu/3rIUP4/4C6lQxhsGsKvOQsvBkCtJtsI/D4w4qabmv3y791m/Kqwnqe0a8 Cd4qY7A51Tq+2J6cV+WKTaQFWk8BMiNdNl0kUCXJbEOlPFzgzvgosVGQjOeP9sSfy4Cb kQxHB/TNKRWbbVIBcAatGcaq4J0CpAVugcDsH+Ro0htiTSGZcXXWaUbOxD7mkTBhFbLD YIQyxeWuH/mMyzqwBfos3sEzROuiyoGZfCv4qDS4Y5uN7mtZj9nq4Ii0HsTPwxqKMSFY mILA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WNIzZM/HGNVuCHPySS85yQsDDzeztT5gAummDuPnBNw=; b=A8FCkuXo+zgLKSEfPhKFmXAz2xVnxN/reVgbnEUH0sqeboyG6rWfFN9TFrrDdBh+oE 13ieONltGP4Pn0/YgFn7wlMG4ux1ORhyUIFEApAnO5L7/BNEsFR6egsOqd9r31FmFAh0 ZUmWymiMqE5m35xuOXHJt5hnvIcjodSaGy0xxLKScEe2rIJO0nj/PH0AghtqvD0dsEnS jGeizdVsBFPnij7EKoWQ/9cCpR58NVf0cdED8zxEqMcTIW5AfionYyeIaajdVGS+fM+9 WFE3Dw8M7S5hPkVlForOAWwDQYpUr+SIVkIwmh24i8yzqK9+63iL/EZMj5SqEWlc+B/S 9P9A== X-Gm-Message-State: AGi0Puasw4EcL8dpEx/buRmrAAE/AnaD0nW1ZRl4xzL+F533N+ibVHPS rdYWcJSX2sebhaKMqqvGaYsDLkwlDGB+l6tA/Y4= X-Google-Smtp-Source: APiQypLRT36TrcCo8XKWHaSQ+A/HWm6qfDS38BiOKMuSdj29ORebm7DehHJzy/8TtnmEoBR0AMsbAc7m/7447r11tco= X-Received: by 2002:a9d:2948:: with SMTP id d66mr9285437otb.174.1586711290793; Sun, 12 Apr 2020 10:08:10 -0700 (PDT) MIME-Version: 1.0 References: <83zhbgk74d.fsf@gnu.org> In-Reply-To: From: Philipp Stephani Date: Sun, 12 Apr 2020 19:07:59 +0200 Message-ID: Subject: Re: bug#40576: call-process-region does not accept nil as first argument To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 40576 Cc: 40576@debbugs.gnu.org, Pietro Giorgianni X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Am So., 12. Apr. 2020 um 18:44 Uhr schrieb Philipp Stephani : > > Am So., 12. Apr. 2020 um 18:21 Uhr schrieb Eli Zaretskii : > > > > > From: Philipp Stephani > > > Date: Sun, 12 Apr 2020 18:01:40 +0200 > > > Cc: 40576@debbugs.gnu.org > > > > > > > According to the documentation of call-process-region, > > > > If START is nil, that means to use the entire buffer contents; END is > > > > ignored. > > > > > > > > But when I run: > > > > (call-process-region nil nil "/bin/cat" t (current-buffer)) > > > > I get: > > > > Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil) > > > > call-process-region(nil nil "/bin/cat" t #) > > > > eval((call-process-region nil nil "/bin/cat" t (current-buffer)) nil) > > > > elisp--eval-last-sexp(t) > > > > eval-last-sexp(t) > > > > eval-print-last-sexp(nil) > > > > funcall-interactively(eval-print-last-sexp nil) > > > > call-interactively(eval-print-last-sexp nil nil) > > > > command-execute(eval-print-last-sexp) > > > > > > > > If, instead, I run: > > > > (call-process-region (point-min) (point-max) "/bin/cat" t (current-buffer)) > > > > > > > > It works. > > > > > > > > Am I interpreting the documentation wrong? > > > > > > Nope, looks like a genuine bug (that happens only if DELETE is non-nil). > > > > Right. But there's more here than meets the eye, because the change > > after which we started advertising the special meaning of nil for > > START exposed a problem: write_region, called from create_temp_file, > > has special meaning for START = nil: it widens the buffer and writes > > the entire buffer contents to the temp file. Which isn't right when > > write_region is called from call-process-region, as it allows access > > to inaccessible portion of the buffer, something we shouldn't do. > > I think that's pretty much intentional. The documentation says > > "If START is nil, that means to use the entire buffer contents" > > It specifically doesn't say to only use the accessible portion of the > buffer. Given that this behavior probably has been in place since > commit 561cb8e159e7eff7a6487a45a1cfab47ba456030 from 1994, it would be > rather unwise to introduce such a breaking change. While the behavior of call-process-region and write-region is unfortunate in this respect, I think it's way too late to change it now. We should rather explicitly call out in the docstrings that buffer restrictions are ignored. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 13:09:30 2020 Received: (at 40576) by debbugs.gnu.org; 12 Apr 2020 17:09:31 +0000 Received: from localhost ([127.0.0.1]:58766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNg6s-0005tl-Ny for submit@debbugs.gnu.org; Sun, 12 Apr 2020 13:09:30 -0400 Received: from mail-ot1-f47.google.com ([209.85.210.47]:45761) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNg6r-0005tU-Dh for 40576@debbugs.gnu.org; Sun, 12 Apr 2020 13:09:29 -0400 Received: by mail-ot1-f47.google.com with SMTP id 60so6911746otl.12 for <40576@debbugs.gnu.org>; Sun, 12 Apr 2020 10:09:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZJ+kuPEz55pafV2xLDkOuxpwhYuF8xGbRfgN93Fsn4E=; b=c5vKtzeZRTnVny6QHyla8jEb8GB4W7ZJr2k7KJLdA70HcTngrivqixBKlEG0T6fzu+ Es3l/pFIViA5R4WPDt01PRAHhr/dVK4pA9B5y0j9zg3F+wtIJFnnL+nlnddnsBr4SVkA dU3LsmlhkWjj61aZk7UEAYGXZ/3HZnZ+7AqiEXsByHmvfMco3bYr7v/UeXqNSk1/cqgy Y1xbWwhcaA8kln+lQX2+D91D8ipVBHN7c8XhZ2XMaVE7R8WSd1Bg3e0fjhNXGt5s3cny 8YBPhFyKiz8ny9Vwd+j3z3ZFtehsBNnYlMklHNR9RD8ZXqIfa1ajpVOD02CjMTySDJ6x LHtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZJ+kuPEz55pafV2xLDkOuxpwhYuF8xGbRfgN93Fsn4E=; b=GQ37xjdkFKt5N/lsh420Oc6IDDoBf5Ee2965BZEuyfASzU7CoopdGE4w3mBp7FEf10 xr5XmYMscM6GQpTQm0oqLF/5iPW5ogEnyr9Ap037KkIOS8kxv2h2fNdqEK2796Exiv5p ltAI9qGgF91lDwIDwhCfuBacUCr7i0xk0u5BiazwLkF+Ieqsods/IvAYbGklugMYzSaa UQWhc1v3C27dU2Fc0zup8LVW5Omha2DiULMps7atklUwWmiki1H2/4Y8TlxkbBN1qlyx 59mrx8r+MPO3IR/msT+A1iNvOlQT06hUaS3//zx1LiNKNcRjp00YcXKv8cvKdNFbZM8k Z+iA== X-Gm-Message-State: AGi0Pubi3Q5YnpIBaeWlASP8SbQqLbXtuzHm7A9Fl+8Q6VJiuKnj6cO3 42d7OSLV/r1uOCFirx/gV0hmrPOdSJlDQjJG4HU= X-Google-Smtp-Source: APiQypIdtT78K0/xKcWZRDgBp2KFcfB1cdCY8dNl/zijtJWuUp3n0/m+SShtZD/Q08Awf7TR6LtmiZG0qeBnze+QpT8= X-Received: by 2002:a05:6830:1e79:: with SMTP id m25mr11421539otr.36.1586711363966; Sun, 12 Apr 2020 10:09:23 -0700 (PDT) MIME-Version: 1.0 References: <83zhbgk74d.fsf@gnu.org> <83y2r0k4zu.fsf@gnu.org> In-Reply-To: <83y2r0k4zu.fsf@gnu.org> From: Philipp Stephani Date: Sun, 12 Apr 2020 19:09:12 +0200 Message-ID: Subject: Re: bug#40576: call-process-region does not accept nil as first argument To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 40576 Cc: 40576@debbugs.gnu.org, Pietro Giorgianni X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Am So., 12. Apr. 2020 um 19:07 Uhr schrieb Eli Zaretskii : > > > From: Philipp Stephani > > Date: Sun, 12 Apr 2020 18:44:58 +0200 > > Cc: Pietro Giorgianni , 40576@debbugs.gnu.org > > > > > Right. But there's more here than meets the eye, because the change > > > after which we started advertising the special meaning of nil for > > > START exposed a problem: write_region, called from create_temp_file, > > > has special meaning for START = nil: it widens the buffer and writes > > > the entire buffer contents to the temp file. Which isn't right when > > > write_region is called from call-process-region, as it allows access > > > to inaccessible portion of the buffer, something we shouldn't do. > > > > I think that's pretty much intentional. The documentation says > > > > "If START is nil, that means to use the entire buffer contents" > > That sentence is an addition made in 2016, AFAICT. Sure, but the behavior has been around for so long that it's very likely somebody already relies on it. > > > It specifically doesn't say to only use the accessible portion of the > > buffer. Given that this behavior probably has been in place since > > commit 561cb8e159e7eff7a6487a45a1cfab47ba456030 from 1994, it would be > > rather unwise to introduce such a breaking change. > > But then START = nil would work, whereas START = 2 will signal an > error if the buffer is narrowed. Does that make sense? No, absolutely not. But I think it's too late to change it. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 13:25:20 2020 Received: (at 40576) by debbugs.gnu.org; 12 Apr 2020 17:25:20 +0000 Received: from localhost ([127.0.0.1]:58790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNgMC-0006JC-5S for submit@debbugs.gnu.org; Sun, 12 Apr 2020 13:25:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34007) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNgMB-0006J1-0c for 40576@debbugs.gnu.org; Sun, 12 Apr 2020 13:25:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jNgM1-0004y5-0k; Sun, 12 Apr 2020 13:25:13 -0400 Received: from [176.228.60.248] (port=2019 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jNgLo-0007ui-4A; Sun, 12 Apr 2020 13:25:04 -0400 Date: Sun, 12 Apr 2020 20:24:44 +0300 Message-Id: <83tv1ok46b.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-Reply-To: (message from Philipp Stephani on Sun, 12 Apr 2020 19:07:59 +0200) Subject: Re: bug#40576: call-process-region does not accept nil as first argument References: <83zhbgk74d.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40576 Cc: 40576@debbugs.gnu.org, giorgian@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Philipp Stephani > Date: Sun, 12 Apr 2020 19:07:59 +0200 > Cc: Pietro Giorgianni , 40576@debbugs.gnu.org > > We should rather explicitly call out in the docstrings that buffer > restrictions are ignored. But the restrictions aren't ignored. They are only ignored if START is nil. That makes no sense. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 13:37:26 2020 Received: (at 40576) by debbugs.gnu.org; 12 Apr 2020 17:37:26 +0000 Received: from localhost ([127.0.0.1]:58799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNgXu-0006bl-Do for submit@debbugs.gnu.org; Sun, 12 Apr 2020 13:37:26 -0400 Received: from mail-oi1-f172.google.com ([209.85.167.172]:44947) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNgXs-0006bX-OM for 40576@debbugs.gnu.org; Sun, 12 Apr 2020 13:37:25 -0400 Received: by mail-oi1-f172.google.com with SMTP id o25so5754568oic.11 for <40576@debbugs.gnu.org>; Sun, 12 Apr 2020 10:37:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RA/iZOTahUgBgJsQ2MlFhkWU9t+fStlGz+9b7lEtOVo=; b=hRtuT4TKLJ+vxWvQii8WN1XVI0qPvahC+hFb+b8fI0hcGKnEQKyrCh1xnlp721OpS6 w4eJtsm2UyY4U59aXYMKO7omJGuVjSjzlnCfAOic1K/MCDOBHqSns+I5BkrAuo313zzj Q6sfYxNoCf4alUAVSHR4tsLmgsyt51uHoo8ZCwUsvy6bUGwzs0zkLh0QgYuJywOEQZCZ zrFVju2NEr123VoI3jyD4YhzmlX8hlPyEHDKxwF+slDd4zQwFBlf1itFOv/FugOZ5rCt NAkZc5xONkV6TjCSSX0+OZLF6kGT95cTTeMoOmlulkj3gGI3v9+sxyUxgMVChPiF/rLs 2eFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RA/iZOTahUgBgJsQ2MlFhkWU9t+fStlGz+9b7lEtOVo=; b=a8lZO/GPzUuRMhcrWImi+eSfIuA6N9B2pRNQIj7j2rjARRa3j2598p0+wxuncmHsat rstaPx21tX2eXlItQzqgj+ICCKZuW/kTCMQLBnk8O1ACRFkVbIZlbHImrEoxVjrt4Oz2 H5hS3gBHFdKz7P4v1lx3rSIUd6DU8G5z91rNCFs5/ljkZPRasZ5YFHMPn/xM6nr2B156 sVaRGq9FBAh5DPxpRO3MWsMM7uL8F32GU3HArxg10GT4zTGtV56GTxi9jTWvWHY5WYZU HxiaA0plS8GAZ+BN5eFL4vIOrFS90oZIHIFVzFvkV0dcyo8MPYuIaY/LYLx9caA31olo Z6Lw== X-Gm-Message-State: AGi0PuZRst0wbEM0XokNQfJ76y+QgUuYtvKLVzgVE7aZLgaDVc7BujSW OQlzjatdPEN1EqyeclgJn36t4ZPAKSSS02L6hT8= X-Google-Smtp-Source: APiQypIcv1SL48Hddpghj7y8Y2FF8BVNe+XnWGMlfRr1HNPF7oj4QA0BEh3IsjoQvTiTpHwxithU2AMPI4UxyE+PtiU= X-Received: by 2002:aca:5243:: with SMTP id g64mr9749265oib.65.1586713038193; Sun, 12 Apr 2020 10:37:18 -0700 (PDT) MIME-Version: 1.0 References: <83zhbgk74d.fsf@gnu.org> <83tv1ok46b.fsf@gnu.org> In-Reply-To: <83tv1ok46b.fsf@gnu.org> From: Philipp Stephani Date: Sun, 12 Apr 2020 19:37:07 +0200 Message-ID: Subject: Re: bug#40576: call-process-region does not accept nil as first argument To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.6 (/) X-Debbugs-Envelope-To: 40576 Cc: 40576@debbugs.gnu.org, Pietro Giorgianni X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.6 (-) Am So., 12. Apr. 2020 um 19:25 Uhr schrieb Eli Zaretskii : > > > From: Philipp Stephani > > Date: Sun, 12 Apr 2020 19:07:59 +0200 > > Cc: Pietro Giorgianni , 40576@debbugs.gnu.org > > > > We should rather explicitly call out in the docstrings that buffer > > restrictions are ignored. > > But the restrictions aren't ignored. They are only ignored if START > is nil. That makes no sense. I completely agree that it doesn't make sense. I'm just saying that the behavior has been there for so long that we realistically can't change it any more. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 14:29:55 2020 Received: (at 40576) by debbugs.gnu.org; 12 Apr 2020 18:29:55 +0000 Received: from localhost ([127.0.0.1]:58845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNhMg-0007sV-Qz for submit@debbugs.gnu.org; Sun, 12 Apr 2020 14:29:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40331) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNhMf-0007sJ-5P for 40576@debbugs.gnu.org; Sun, 12 Apr 2020 14:29:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jNhMa-0002dX-0y; Sun, 12 Apr 2020 14:29:48 -0400 Received: from [176.228.60.248] (port=1977 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jNhMY-0000uv-MH; Sun, 12 Apr 2020 14:29:47 -0400 Date: Sun, 12 Apr 2020 21:29:33 +0300 Message-Id: <83sgh8k16a.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-Reply-To: (message from Philipp Stephani on Sun, 12 Apr 2020 19:37:07 +0200) Subject: Re: bug#40576: call-process-region does not accept nil as first argument References: <83zhbgk74d.fsf@gnu.org> <83tv1ok46b.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40576 Cc: 40576@debbugs.gnu.org, giorgian@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Philipp Stephani > Date: Sun, 12 Apr 2020 19:37:07 +0200 > Cc: Pietro Giorgianni , 40576@debbugs.gnu.org > > > But the restrictions aren't ignored. They are only ignored if START > > is nil. That makes no sense. > > I completely agree that it doesn't make sense. I'm just saying that > the behavior has been there for so long that we realistically can't > change it any more. I think we can change it, but I won't argue further. From unknown Mon Jun 23 14:57:43 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 11 May 2020 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator