GNU bug report logs - #40576
call-process-region does not accept nil as first argument

Previous Next

Package: emacs;

Reported by: Pietro Giorgianni <giorgian <at> gmail.com>

Date: Sun, 12 Apr 2020 15:44:01 UTC

Severity: normal

Done: Philipp Stephani <p.stephani2 <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 40576 <at> debbugs.gnu.org, Pietro Giorgianni <giorgian <at> gmail.com>
Subject: bug#40576: call-process-region does not accept nil as first argument
Date: Sun, 12 Apr 2020 19:09:12 +0200
Am So., 12. Apr. 2020 um 19:07 Uhr schrieb Eli Zaretskii <eliz <at> gnu.org>:
>
> > From: Philipp Stephani <p.stephani2 <at> gmail.com>
> > Date: Sun, 12 Apr 2020 18:44:58 +0200
> > Cc: Pietro Giorgianni <giorgian <at> gmail.com>, 40576 <at> 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.




This bug report was last modified 5 years and 44 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.