unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#52509: 27.2; `call-process-region' won't accept nil as START argument
@ 2021-12-15 10:59 LdBeth
  2021-12-15 14:09 ` Stephen Berman
  2021-12-15 14:24 ` Eli Zaretskii
  0 siblings, 2 replies; 5+ messages in thread
From: LdBeth @ 2021-12-15 10:59 UTC (permalink / raw)
  To: 52509


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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#52509: 27.2; `call-process-region' won't accept nil as START argument
  2021-12-15 10:59 bug#52509: 27.2; `call-process-region' won't accept nil as START argument LdBeth
@ 2021-12-15 14:09 ` Stephen Berman
  2021-12-15 15:26   ` LdBeth
  2021-12-15 14:24 ` Eli Zaretskii
  1 sibling, 1 reply; 5+ messages in thread
From: Stephen Berman @ 2021-12-15 14:09 UTC (permalink / raw)
  To: LdBeth; +Cc: 52509

On Wed, 15 Dec 2021 18:59:59 +0800 LdBeth <andpuke@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@google.com>
Commit:     Philipp Stephani <phst@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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#52509: 27.2; `call-process-region' won't accept nil as START argument
  2021-12-15 10:59 bug#52509: 27.2; `call-process-region' won't accept nil as START argument LdBeth
  2021-12-15 14:09 ` Stephen Berman
@ 2021-12-15 14:24 ` Eli Zaretskii
  2021-12-19 12:46   ` Lars Ingebrigtsen
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2021-12-15 14:24 UTC (permalink / raw)
  To: LdBeth; +Cc: 52509

> Date: Wed, 15 Dec 2021 18:59:59 +0800
> From: LdBeth <andpuke@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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#52509: 27.2; `call-process-region' won't accept nil as START argument
  2021-12-15 14:09 ` Stephen Berman
@ 2021-12-15 15:26   ` LdBeth
  0 siblings, 0 replies; 5+ messages in thread
From: LdBeth @ 2021-12-15 15:26 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 52509

On Wed, 15 Dec 2021 22:09:08 +0800,
Stephen Berman wrote:
> 
> Nope:
> 
> commit 42306747d8dece897805e89c36c3741bfb8d5e7c
> Author:     Philipp Stephani <phst@google.com>
> Commit:     Philipp Stephani <phst@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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#52509: 27.2; `call-process-region' won't accept nil as START argument
  2021-12-15 14:24 ` Eli Zaretskii
@ 2021-12-19 12:46   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-19 12:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: LdBeth, 52509

Eli Zaretskii <eliz@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





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-12-19 12:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-15 10:59 bug#52509: 27.2; `call-process-region' won't accept nil as START argument LdBeth
2021-12-15 14:09 ` Stephen Berman
2021-12-15 15:26   ` LdBeth
2021-12-15 14:24 ` Eli Zaretskii
2021-12-19 12:46   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).