GNU bug report logs -
#23936
25.1.50; shell-command shell-command-on-region doc fix
Previous Next
Reported by: Tino Calancha <tino.calancha <at> gmail.com>
Date: Sun, 10 Jul 2016 16:42:02 UTC
Severity: normal
Found in version 25.1.50
Done: Tino Calancha <tino.calancha <at> gmail.com>
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 23936 in the body.
You can then email your comments to 23936 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#23936
; Package
emacs
.
(Sun, 10 Jul 2016 16:42:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Tino Calancha <tino.calancha <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 10 Jul 2016 16:42:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Doc strings don't specify correctly when the buffer
is erased, in what buffer position the output is
inserted or when the mark is set.
emacs -Q
;; Evaluate following two forms
(progn
(switch-to-buffer (get-buffer-create "*out*"))
(insert (format "1 2\n\n\n\nfoo\n")) ; point is at 12
(shell-command-on-region 1 4 "printf 'bar\n'" t)) ; point is at 5
(progn
(switch-to-buffer (get-buffer-create "*out*"))
(shell-command "date" t)) ; buffer is not erased
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 90915fdad69939886a3a1dcc377453b2e98b2089 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha <at> gmail.com>
Date: Mon, 11 Jul 2016 01:33:22 +0900
Subject: [PATCH] * lisp/simple.el (shell-command,
shell-command-on-region):
Fix doc strings
---
lisp/simple.el | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index ba026af..cb8c0ce 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3235,11 +3235,11 @@ shell-command
The optional second argument OUTPUT-BUFFER, if non-nil,
says to put the output in some other buffer.
-If OUTPUT-BUFFER is a buffer or buffer name, put the output there.
-If OUTPUT-BUFFER is not a buffer and not nil,
-insert output in current buffer. (This cannot be done asynchronously.)
-In either case, the buffer is first erased, and the output is
-inserted after point (leaving mark after it).
+If OUTPUT-BUFFER is a buffer or buffer name, erase that buffer
+and insert the output there after point.
+If OUTPUT-BUFFER is not a buffer and not nil, insert the output
+in current buffer after point leaving mark after it.
+(This cannot be done asynchronously).
If the command terminates without error, but generates output,
and you did not specify \"insert it in the current buffer\",
@@ -3504,10 +3504,10 @@ shell-command-on-region
Optional fourth arg OUTPUT-BUFFER specifies where to put the
command's output. If the value is a buffer or buffer name,
-put the output there. If the value is nil, use the buffer
-`*Shell Command Output*'. Any other value, excluding nil,
-means to insert the output in the current buffer. In either case,
-the output is inserted after point (leaving mark after it).
+erase that buffer and insert the output there.
+If the value is nil, use the buffer `*Shell Command Output*'.
+Any other value, excluding nil, means to insert the output
+in the current buffer after START.
Optional fifth arg REPLACE, if non-nil, means to insert the
output in place of text from START to END, putting point and mark
--
2.8.1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In GNU Emacs 25.1.50.5 (x86_64-pc-linux-gnu, GTK+ Version 3.20.6)
of 2016-07-10 built on calancha-pc
Repository revision: 04a7977f700fc46cf29d5a41bc7dcffef71044c6
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#23936
; Package
emacs
.
(Sun, 10 Jul 2016 17:23:01 GMT)
Full text and
rfc822 format available.
Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
LGTM, but: why do you need to say it's inserted after point, since the buffer is erased anyway?
> +Any other value, excluding nil, means to insert the output
> +in the current buffer after START.
"Any other non-nil value"? I read this wrong on the first read. Doesn't matter much though.
Clément.
On 2016-07-10 18:41, Tino Calancha wrote:
>
> Doc strings don't specify correctly when the buffer
> is erased, in what buffer position the output is
> inserted or when the mark is set.
>
> emacs -Q
> ;; Evaluate following two forms
> (progn
> (switch-to-buffer (get-buffer-create "*out*"))
> (insert (format "1 2\n\n\n\nfoo\n")) ; point is at 12
> (shell-command-on-region 1 4 "printf 'bar\n'" t)) ; point is at 5
>
> (progn
> (switch-to-buffer (get-buffer-create "*out*"))
> (shell-command "date" t)) ; buffer is not erased
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
>> From 90915fdad69939886a3a1dcc377453b2e98b2089 Mon Sep 17 00:00:00 2001
> From: Tino Calancha <tino.calancha <at> gmail.com>
> Date: Mon, 11 Jul 2016 01:33:22 +0900
> Subject: [PATCH] * lisp/simple.el (shell-command, shell-command-on-region):
> Fix doc strings
>
> ---
> lisp/simple.el | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/lisp/simple.el b/lisp/simple.el
> index ba026af..cb8c0ce 100644
> --- a/lisp/simple.el
> +++ b/lisp/simple.el
> @@ -3235,11 +3235,11 @@ shell-command
>
> The optional second argument OUTPUT-BUFFER, if non-nil,
> says to put the output in some other buffer.
> -If OUTPUT-BUFFER is a buffer or buffer name, put the output there.
> -If OUTPUT-BUFFER is not a buffer and not nil,
> -insert output in current buffer. (This cannot be done asynchronously.)
> -In either case, the buffer is first erased, and the output is
> -inserted after point (leaving mark after it).
> +If OUTPUT-BUFFER is a buffer or buffer name, erase that buffer
> +and insert the output there after point.
> +If OUTPUT-BUFFER is not a buffer and not nil, insert the output
> +in current buffer after point leaving mark after it.
> +(This cannot be done asynchronously).
>
> If the command terminates without error, but generates output,
> and you did not specify \"insert it in the current buffer\",
> @@ -3504,10 +3504,10 @@ shell-command-on-region
>
> Optional fourth arg OUTPUT-BUFFER specifies where to put the
> command's output. If the value is a buffer or buffer name,
> -put the output there. If the value is nil, use the buffer
> -`*Shell Command Output*'. Any other value, excluding nil,
> -means to insert the output in the current buffer. In either case,
> -the output is inserted after point (leaving mark after it).
> +erase that buffer and insert the output there.
> +If the value is nil, use the buffer `*Shell Command Output*'.
> +Any other value, excluding nil, means to insert the output
> +in the current buffer after START.
>
> Optional fifth arg REPLACE, if non-nil, means to insert the
> output in place of text from START to END, putting point and mark
[signature.asc (application/pgp-signature, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#23936
; Package
emacs
.
(Sun, 10 Jul 2016 17:52:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 23936 <at> debbugs.gnu.org (full text, mbox):
>LGTM, but: why do you need to say it's inserted after point, since the
buffer is erased anyway?
You are right. I removed that part.
>"Any other non-nil value"? I read this wrong on the first read. Doesn't
matter much though.
Your wording reads better. I rewrote following your suggstion.
Thank you.
Reply sent
to
Tino Calancha <tino.calancha <at> gmail.com>
:
You have taken responsibility.
(Sun, 10 Jul 2016 17:56:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Tino Calancha <tino.calancha <at> gmail.com>
:
bug acknowledged by developer.
(Sun, 10 Jul 2016 17:56:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 23936-done <at> debbugs.gnu.org (full text, mbox):
Fixed in master branch
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#23936
; Package
emacs
.
(Sun, 10 Jul 2016 18:00:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 23936 <at> debbugs.gnu.org (full text, mbox):
On Sun, Jul 10, 2016 at 1:55 PM, Tino Calancha <tino.calancha <at> gmail.com> wrote:
> Fixed in master branch
Doc only fixes should go in emacs-25, I think (unless they document
something that's only in master, but AFAIK shell-command-{on-region}
hasn't been changed...)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#23936
; Package
emacs
.
(Sun, 10 Jul 2016 18:10:01 GMT)
Full text and
rfc822 format available.
Message #22 received at 23936 <at> debbugs.gnu.org (full text, mbox):
On Sun, 10 Jul 2016, Noam Postavsky wrote:
> On Sun, Jul 10, 2016 at 1:55 PM, Tino Calancha <tino.calancha <at> gmail.com> wrote:
>> Fixed in master branch
>
> Doc only fixes should go in emacs-25, I think (unless they document
> something that's only in master, but AFAIK shell-command-{on-region}
> hasn't been changed...)
Sorry for that. I assumed fixes to emacs-25 would hardly being accepted
because the proximity of the release.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#23936
; Package
emacs
.
(Thu, 21 Jul 2016 08:51:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 23936 <at> debbugs.gnu.org (full text, mbox):
There is another wrong sentence in the doc strings for
shell-command[-on-region]
The output buffer is not deleted: the code killing that buffer was
commented:
;; It is rude to delete a buffer which the command is not using.
;; Don't kill: there might be useful info in the undo-log.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 33e7bb2c459ffdf918ccbad4693c641d09349178 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha <at> gmail.com>
Date: Thu, 21 Jul 2016 17:35:17 +0900
Subject: [PATCH] Doc string fixes
* lisp/simple.el (shell-command, shell-command-on-region): These
commands never delete the buffer '*Shell-Command Output*'; update
their doc strings (Bug#23936).
---
lisp/simple.el | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index 51c9100..e91b6e0 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3288,9 +3288,6 @@ shell-command
in the current buffer\", a message about the error goes at the end
of the output.
-If there is no output, or if output is inserted in the current buffer,
-then `*Shell Command Output*' is deleted.
-
If the optional third argument ERROR-BUFFER is non-nil, it is a buffer
or buffer name to which to direct the command's standard error output.
If it is nil, error output is mingled with regular output.
@@ -3535,9 +3532,7 @@ shell-command-on-region
The output is available in that buffer in both cases.
If there is output and an error, a message about the error
-appears at the end of the output. If there is no output, or if
-output is inserted in the current buffer, the buffer `*Shell
-Command Output*' is deleted.
+appears at the end of the output.
Optional fourth arg OUTPUT-BUFFER specifies where to put the
command's output. If the value is a buffer or buffer name,
--
2.8.1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#23936
; Package
emacs
.
(Thu, 21 Jul 2016 08:54:02 GMT)
Full text and
rfc822 format available.
Message #28 received at 23936 <at> debbugs.gnu.org (full text, mbox):
There is another wrong sentence in the doc strings for
shell-command[-on-region]
The output buffer is not deleted: the code killing that buffer was
commented:
;; It is rude to delete a buffer which the command is not using.
;; Don't kill: there might be useful info in the undo-log.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 33e7bb2c459ffdf918ccbad4693c641d09349178 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha <at> gmail.com>
Date: Thu, 21 Jul 2016 17:35:17 +0900
Subject: [PATCH] Doc string fixes
* lisp/simple.el (shell-command, shell-command-on-region): These
commands never delete the buffer '*Shell-Command Output*'; update
their doc strings (Bug#23936).
---
lisp/simple.el | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index 51c9100..e91b6e0 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3288,9 +3288,6 @@ shell-command
in the current buffer\", a message about the error goes at the end
of the output.
-If there is no output, or if output is inserted in the current buffer,
-then `*Shell Command Output*' is deleted.
-
If the optional third argument ERROR-BUFFER is non-nil, it is a buffer
or buffer name to which to direct the command's standard error output.
If it is nil, error output is mingled with regular output.
@@ -3535,9 +3532,7 @@ shell-command-on-region
The output is available in that buffer in both cases.
If there is output and an error, a message about the error
-appears at the end of the output. If there is no output, or if
-output is inserted in the current buffer, the buffer `*Shell
-Command Output*' is deleted.
+appears at the end of the output.
Optional fourth arg OUTPUT-BUFFER specifies where to put the
command's output. If the value is a buffer or buffer name,
--
2.8.1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#23936
; Package
emacs
.
(Fri, 22 Jul 2016 05:55:01 GMT)
Full text and
rfc822 format available.
Message #31 received at 23936 <at> debbugs.gnu.org (full text, mbox):
I am going to push the patch fixing the new issue
(sentence saying that command may delete buffer '*Shell Command Output*')
to the master branch.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 19 Aug 2016 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 8 years and 307 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.