GNU bug report logs -
#44409
Example in manual no longer works
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 44409 in the body.
You can then email your comments to 44409 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#44409
; Package
emacs
.
(Tue, 03 Nov 2020 05:29:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 03 Nov 2020 05:29:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
(info "(emacs) Grep Searching") Says
For instance, you can chain ‘grep’ commands, like this: ...
But the example it then gives is for older emacs versions.
Newer emacs versions' grep string contains "--null" (proof: try
$ emacs -f grep
) which will cause the example to fail.
How can one rewrite the example to work with newer emacs versions?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44409
; Package
emacs
.
(Tue, 03 Nov 2020 07:18:02 GMT)
Full text and
rfc822 format available.
Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
On November 3, 2020 7:28:41 AM GMT+02:00, "積丹尼 Dan Jacobson" <jidanni <at> jidanni.org> wrote:
> (info "(emacs) Grep Searching") Says
>
> For instance, you can chain ‘grep’ commands, like this: ...
>
> But the example it then gives is for older emacs versions.
>
> Newer emacs versions' grep string contains "--null" (proof: try
> $ emacs -f grep
> ) which will cause the example to fail.
>
> How can one rewrite the example to work with newer emacs versions?
I just tried the example in the manual with a recent version of Enacs, and the example works just fine. So in what sense doesn't the example work for you? And what is the significance of --null for this purpose?
IOW, I see no reason to rewrite the example.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44409
; Package
emacs
.
(Tue, 03 Nov 2020 07:18:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44409
; Package
emacs
.
(Tue, 03 Nov 2020 07:48:02 GMT)
Full text and
rfc822 format available.
Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):
$ grep --color -nH --null -e a /etc/motd
/etc/motd:2:The programs included with the Debian GNU/Linux system are free software;
/etc/motd:3:the exact distribution terms for each program are described in the...
$ grep --color -nH --null -e a /etc/motd | grep x
Binary file (standard input) matches
>>>>> "EZ" == Eli Zaretskii <eliz <at> gnu.org> writes:
EZ> And what is the significance of --null for this purpose?
grep -nH -e
is not the current emacs prompt. It is an older emacs prompt.
The current emacs prompt is
grep --color -nH --null -e
You can verify this via
$ emacs -f grep
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44409
; Package
emacs
.
(Tue, 03 Nov 2020 07:48:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44409
; Package
emacs
.
(Tue, 03 Nov 2020 11:17:01 GMT)
Full text and
rfc822 format available.
Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):
On November 3, 2020 9:47:37 AM GMT+02:00, "積丹尼 Dan Jacobson" <jidanni <at> jidanni.org> wrote:
> $ grep --color -nH --null -e a /etc/motd
> /etc/motd:2:The programs included with the Debian GNU/Linux system are
> free software;
> /etc/motd:3:the exact distribution terms for each program are
> described in the...
> $ grep --color -nH --null -e a /etc/motd | grep x
> Binary file (standard input) matches
The example in the manual doesn't mention /etc/motd of any other binary file. It uses text files, where this issue doesn't exist.
If you are seeking information for how to use Grep with binary files, you should be looking in the Grep manual, not the Emacs manual.
> >>>>> "EZ" == Eli Zaretskii <eliz <at> gnu.org> writes:
> EZ> And what is the significance of --null for this purpose?
>
> grep -nH -e
>
> is not the current emacs prompt. It is an older emacs prompt.
>
> The current emacs prompt is
>
> grep --color -nH --null -e
Yes, but you need to edit that prompt anyway in order to type the command with a pipe, so the original prompt doesn't matter much.
I see no problem here that needs tk be fixed.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44409
; Package
emacs
.
(Tue, 03 Nov 2020 11:17:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44409
; Package
emacs
.
(Tue, 03 Nov 2020 23:33:02 GMT)
Full text and
rfc822 format available.
Message #26 received at submit <at> debbugs.gnu.org (full text, mbox):
>>>>> "EZ" == Eli Zaretskii <eliz <at> gnu.org> writes:
EZ> The example in the manual doesn't mention /etc/motd of any other binary file. It uses text files, where this issue doesn't exist.
Since when is /etc/motd a binary file?
If it were a binary file, the first grep,
>> $ grep --color -nH --null -e a /etc/motd
>> /etc/motd:2:The programs included with the Debian GNU/Linux system are free software;
>> /etc/motd:3:the exact distribution terms for each program are
>> described in the...
would fail.
But it doesn't. Only the second grep fails:
>> $ grep --color -nH --null -e a /etc/motd | grep x
>> Binary file (standard input) matches
So we see the issue indeed exists with text files!!
Double proof:
$ file /etc/motd
/etc/motd: ASCII text
Thus we see that one cannot simply slap
"| grep bar | grep toto"
onto the end of a working grep command anymore!
Back when the manual was written, one could. But not anymore.
EZ> Yes, but you need to edit that prompt anyway in order to type the
EZ> command with a pipe, so the original prompt doesn't matter much.
No!
In the past one could simply slap the pipe(s) on to the back.
Now that no longer works.
Therefore the example needs to be rewritten to make it work again.
(Or specific instructions need to be given: "Be sure to remove any
'--null' that emacs has stuck in, for this example to work.")
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44409
; Package
emacs
.
(Tue, 03 Nov 2020 23:33:03 GMT)
Full text and
rfc822 format available.
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Wed, 04 Nov 2020 03:25:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
:
bug acknowledged by developer.
(Wed, 04 Nov 2020 03:25:02 GMT)
Full text and
rfc822 format available.
Message #34 received at 44409-done <at> debbugs.gnu.org (full text, mbox):
> From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
> Cc: bug-gnu-emacs <at> gnu.org, 44409 <at> debbugs.gnu.org
> Date: Wed, 04 Nov 2020 07:32:42 +0800
>
> >>>>> "EZ" == Eli Zaretskii <eliz <at> gnu.org> writes:
>
> EZ> The example in the manual doesn't mention /etc/motd of any other binary file. It uses text files, where this issue doesn't exist.
>
> Since when is /etc/motd a binary file?
I didn't say it was.
> >> $ grep --color -nH --null -e a /etc/motd | grep x
> >> Binary file (standard input) matches
>
> So we see the issue indeed exists with text files!!
No, it exists if you use Grep incorrectly.
> EZ> Yes, but you need to edit that prompt anyway in order to type the
> EZ> command with a pipe, so the original prompt doesn't matter much.
>
> No!
>
> In the past one could simply slap the pipe(s) on to the back.
>
> Now that no longer works.
>
> Therefore the example needs to be rewritten to make it work again.
The example already works without any changes, so it doesn't need to
be rewritten.
> (Or specific instructions need to be given: "Be sure to remove any
> '--null' that emacs has stuck in, for this example to work.")
That's the stuff for Grep manual, not for Emacs.
So I don't see any problem here to fix, and I'm closing this bug
report.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 02 Dec 2020 12:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 4 years and 198 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.