GNU bug report logs - #52509
27.2; `call-process-region' won't accept nil as START argument

Previous Next

Package: emacs;

Reported by: LdBeth <andpuke <at> foxmail.com>

Date: Wed, 15 Dec 2021 12:56:03 UTC

Severity: normal

Tags: moreinfo

Found in version 27.2

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 52509 in the body.
You can then email your comments to 52509 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#52509; Package emacs. (Wed, 15 Dec 2021 12:56:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to LdBeth <andpuke <at> foxmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 15 Dec 2021 12:56:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: LdBeth <andpuke <at> foxmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.2; `call-process-region' won't accept nil as START argument
Date: Wed, 15 Dec 2021 18:59:59 +0800
The docstring of `call-process-region' writes:

  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 a string, then send that string to the process
  instead of any buffer contents; END is ignored.
  The remaining arguments are optional.
  Delete the text if fourth arg DELETE is non-nil.

To reproduce this bug, define these functions:

```
(defun this-works ()
  (call-process-region (point-min) (point-max) "/bin/cat"
                       t t))

(defun this-wont ()
  (call-process-region nil 0 "/bin/cat"
                       t t))
```

and use `M-:` to execute these two function. The second one would give
the error trace:

```
Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  call-process-region(nil 0 "/bin/cat" t t)
  this-wont()
  eval((this-wont) t)
  eval-expression((this-wont) nil nil 127)
  funcall-interactively(eval-expression (this-wont) nil nil 127)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)
```

While if my understanding to the docstring is right, these two should
give identical effect.

The Emacs version I'm using is 27.2, however I suspect this can also
be reproduced in master branch.

-- 
LDB




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52509; Package emacs. (Wed, 15 Dec 2021 14:10:01 GMT) Full text and rfc822 format available.

Message #8 received at 52509 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: LdBeth <andpuke <at> foxmail.com>
Cc: 52509 <at> debbugs.gnu.org
Subject: Re: bug#52509: 27.2; `call-process-region' won't accept nil as
 START argument
Date: Wed, 15 Dec 2021 15:09:08 +0100
On Wed, 15 Dec 2021 18:59:59 +0800 LdBeth <andpuke <at> foxmail.com> wrote:

> The docstring of `call-process-region' writes:
>
>   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 a string, then send that string to the process
>   instead of any buffer contents; END is ignored.
>   The remaining arguments are optional.
>   Delete the text if fourth arg DELETE is non-nil.
>
> To reproduce this bug, define these functions:
>
> ```
> (defun this-works ()
>   (call-process-region (point-min) (point-max) "/bin/cat"
>                        t t))
>
> (defun this-wont ()
>   (call-process-region nil 0 "/bin/cat"
>                        t t))
> ```
>
> and use `M-:` to execute these two function. The second one would give
> the error trace:
>
> ```
> Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
>   call-process-region(nil 0 "/bin/cat" t t)
>   this-wont()
>   eval((this-wont) t)
>   eval-expression((this-wont) nil nil 127)
>   funcall-interactively(eval-expression (this-wont) nil nil 127)
>   call-interactively(eval-expression nil nil)
>   command-execute(eval-expression)
> ```
>
> While if my understanding to the docstring is right, these two should
> give identical effect.
>
> The Emacs version I'm using is 27.2, however I suspect this can also
> be reproduced in master branch.

Nope:

commit 42306747d8dece897805e89c36c3741bfb8d5e7c
Author:     Philipp Stephani <phst <at> google.com>
Commit:     Philipp Stephani <phst <at> google.com>
CommitDate: Sun Apr 12 19:04:11 2020 +0200

    Fix error in 'call-process-region' when START is nil (Bug#40576)

Steve Berman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52509; Package emacs. (Wed, 15 Dec 2021 14:26:01 GMT) Full text and rfc822 format available.

Message #11 received at 52509 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: LdBeth <andpuke <at> foxmail.com>
Cc: 52509 <at> debbugs.gnu.org
Subject: Re: bug#52509: 27.2;
 `call-process-region' won't accept nil as START argument
Date: Wed, 15 Dec 2021 16:24:47 +0200
> Date: Wed, 15 Dec 2021 18:59:59 +0800
> From: LdBeth <andpuke <at> foxmail.com>
> 
> Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
>   call-process-region(nil 0 "/bin/cat" t t)
>   this-wont()
>   eval((this-wont) t)
>   eval-expression((this-wont) nil nil 127)
>   funcall-interactively(eval-expression (this-wont) nil nil 127)
>   call-interactively(eval-expression nil nil)
>   command-execute(eval-expression)
> ```
> 
> While if my understanding to the docstring is right, these two should
> give identical effect.
> 
> The Emacs version I'm using is 27.2, however I suspect this can also
> be reproduced in master branch.

I can reproduce this in Emacs 27, but not in Emacs 28.  So I guess
this has been fixed meanwhile.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52509; Package emacs. (Wed, 15 Dec 2021 15:27:01 GMT) Full text and rfc822 format available.

Message #14 received at 52509 <at> debbugs.gnu.org (full text, mbox):

From: LdBeth <andpuke <at> foxmail.com>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 52509 <at> debbugs.gnu.org
Subject: Re: bug#52509: 27.2;
 `call-process-region' won't accept nil as START argument
Date: Wed, 15 Dec 2021 23:26:11 +0800
On Wed, 15 Dec 2021 22:09:08 +0800,
Stephen Berman wrote:
> 
> Nope:
> 
> commit 42306747d8dece897805e89c36c3741bfb8d5e7c
> Author:     Philipp Stephani <phst <at> google.com>
> Commit:     Philipp Stephani <phst <at> google.com>
> CommitDate: Sun Apr 12 19:04:11 2020 +0200
> 
>     Fix error in 'call-process-region' when START is nil (Bug#40576)
> 
> Steve Berman

Thank you for confirmation. I'll check out 28.0 seen ;-).

--
LDB




Added tag(s) moreinfo. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Wed, 15 Dec 2021 20:53:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52509; Package emacs. (Sun, 19 Dec 2021 12:47:02 GMT) Full text and rfc822 format available.

Message #19 received at 52509 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: LdBeth <andpuke <at> foxmail.com>, 52509 <at> debbugs.gnu.org
Subject: Re: bug#52509: 27.2; `call-process-region' won't accept nil as
 START argument
Date: Sun, 19 Dec 2021 13:46:24 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

> I can reproduce this in Emacs 27, but not in Emacs 28.  So I guess
> this has been fixed meanwhile.

So I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 52509 <at> debbugs.gnu.org and LdBeth <andpuke <at> foxmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 19 Dec 2021 12:47:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 17 Jan 2022 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 247 days ago.

Previous Next


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