[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#52509: 27.2; `call-process-region' won't accept nil as START argumen
From: |
LdBeth |
Subject: |
bug#52509: 27.2; `call-process-region' won't accept nil as START argument |
Date: |
Wed, 15 Dec 2021 18:59:59 +0800 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (Gojō) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.2 (x86_64-apple-darwin18.7.0) MULE/6.0 (HANACHIRUSATO) |
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
- bug#52509: 27.2; `call-process-region' won't accept nil as START argument,
LdBeth <=