From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#40576: call-process-region does not accept nil as first argument Date: Sun, 12 Apr 2020 20:07:01 +0300 Message-ID: <83y2r0k4zu.fsf@gnu.org> References: <83zhbgk74d.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="26005"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40576@debbugs.gnu.org, giorgian@gmail.com To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 12 19:08:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jNg5b-0006gg-9R for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Apr 2020 19:08:11 +0200 Original-Received: from localhost ([::1]:35314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNg5Z-0003zT-CF for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Apr 2020 13:08:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47493) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNg5S-0003zK-UV for bug-gnu-emacs@gnu.org; Sun, 12 Apr 2020 13:08:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNg5S-0002WA-0v for bug-gnu-emacs@gnu.org; Sun, 12 Apr 2020 13:08:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47208) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jNg5R-0002Vx-U3 for bug-gnu-emacs@gnu.org; Sun, 12 Apr 2020 13:08:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jNg5R-0005qC-Pz for bug-gnu-emacs@gnu.org; Sun, 12 Apr 2020 13:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Apr 2020 17:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40576 X-GNU-PR-Package: emacs Original-Received: via spool by 40576-submit@debbugs.gnu.org id=B40576.158671124022391 (code B ref 40576); Sun, 12 Apr 2020 17:08:01 +0000 Original-Received: (at 40576) by debbugs.gnu.org; 12 Apr 2020 17:07:20 +0000 Original-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 Original-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 Original-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 Original-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 In-Reply-To: (message from Philipp Stephani on Sun, 12 Apr 2020 18:44:58 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:178262 Archived-At: > 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?