all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] master 644cdd1: Use grep's --null option (Bug#6843)
       [not found] ` <20170720000210.0E44020A56@vcs0.savannah.gnu.org>
@ 2017-07-26 16:58   ` Dmitry Gutov
  2017-07-26 18:10     ` Michael Albinus
                       ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Dmitry Gutov @ 2017-07-26 16:58 UTC (permalink / raw)
  To: emacs-devel, Noam Postavsky

Hey Noam,
Sorry I'm late to the party. Some questions below. Thanks.

On 7/20/17 3:02 AM, Noam Postavsky wrote:
> branch: master
> commit 644cdd1aa0a10dbfffa3b9b4c7a97f8cddded0b8
> Author: Noam Postavsky <npostavs@gmail.com>
> Commit: Noam Postavsky <npostavs@gmail.com>
...
> +*** Grep commands will now use GNU grep's '--null' option if
> +available, which allows distinguishing the filename from contents if
> +they contain colons.  This can be controlled by the new custom option
> +'grep-use-null-filename-separator'.

Why do the want the option?

And on the same note, are there any versions of Grep in widespread usage 
that don't support '--null'? AFAICT this flag was added to GNU Grep 2.4 
which was released in 1999.

> +(defconst grep--regexp-alist-bin-matcher
> +  '("^Binary file \\(.+\\) matches$" 1 nil nil 0 1))
> +(defconst grep-with-null-regexp-alist
> +  `(("^\\([^\0]+\\)\\(\0\\)\\([0-9]+\\):" 1 3 ,grep--regexp-alist-column nil nil

Any reason to change 2 to 3? Why don't we use a non-capturing group for 
\0 here?

If the numbers are the same, we could keep the variable's name the same 
as well. As a result, most third-party code would continue to simply work.

> +     (2 '(face unspecified display ":")))
> +    ,grep--regexp-alist-bin-matcher)
> +  "Regexp used to match grep hits.
> +See `compilation-error-regexp-alist'.")
> +(defconst grep-fallback-regexp-alist

Compensating for the multitude of variables by eliminating newlines 
between them doesn't look too hot to me.



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

* Re: [Emacs-diffs] master 644cdd1: Use grep's --null option (Bug#6843)
  2017-07-26 16:58   ` [Emacs-diffs] master 644cdd1: Use grep's --null option (Bug#6843) Dmitry Gutov
@ 2017-07-26 18:10     ` Michael Albinus
  2017-07-27 12:01       ` Dmitry Gutov
  2017-07-26 18:54     ` Andreas Schwab
                       ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Michael Albinus @ 2017-07-26 18:10 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Noam Postavsky, emacs-devel

Dmitry Gutov <dgutov@yandex.ru> writes:

Hy Dmitry,

> And on the same note, are there any versions of Grep in widespread
> usage that don't support '--null'? AFAICT this flag was added to GNU
> Grep 2.4 which was released in 1999.

# grep --null a *
grep: unrecognized option `--null'
BusyBox v1.01 (2017.06.06-18:34+0000) multi-call binary

Best regards, Michael.



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

* Re: [Emacs-diffs] master 644cdd1: Use grep's --null option (Bug#6843)
  2017-07-26 16:58   ` [Emacs-diffs] master 644cdd1: Use grep's --null option (Bug#6843) Dmitry Gutov
  2017-07-26 18:10     ` Michael Albinus
@ 2017-07-26 18:54     ` Andreas Schwab
  2017-07-26 19:01     ` Eli Zaretskii
  2017-07-26 23:31     ` Noam Postavsky
  3 siblings, 0 replies; 11+ messages in thread
From: Andreas Schwab @ 2017-07-26 18:54 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Noam Postavsky, emacs-devel

On Jul 26 2017, Dmitry Gutov <dgutov@yandex.ru> wrote:

>> +(defconst grep--regexp-alist-bin-matcher
>> +  '("^Binary file \\(.+\\) matches$" 1 nil nil 0 1))
>> +(defconst grep-with-null-regexp-alist
>> +  `(("^\\([^\0]+\\)\\(\0\\)\\([0-9]+\\):" 1 3 ,grep--regexp-alist-column nil nil
>
> Any reason to change 2 to 3? Why don't we use a non-capturing group for \0
> here?

Why using a group at all?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

* Re: [Emacs-diffs] master 644cdd1: Use grep's --null option (Bug#6843)
  2017-07-26 16:58   ` [Emacs-diffs] master 644cdd1: Use grep's --null option (Bug#6843) Dmitry Gutov
  2017-07-26 18:10     ` Michael Albinus
  2017-07-26 18:54     ` Andreas Schwab
@ 2017-07-26 19:01     ` Eli Zaretskii
  2017-07-26 23:31     ` Noam Postavsky
  3 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2017-07-26 19:01 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: npostavs, emacs-devel

> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Wed, 26 Jul 2017 19:58:32 +0300
> 
> And on the same note, are there any versions of Grep in widespread usage 
> that don't support '--null'? AFAICT this flag was added to GNU Grep 2.4 
> which was released in 1999.

That option is specific to GNU Grep, the other versions of Grep don't
support it.



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

* Re: [Emacs-diffs] master 644cdd1: Use grep's --null option (Bug#6843)
  2017-07-26 16:58   ` [Emacs-diffs] master 644cdd1: Use grep's --null option (Bug#6843) Dmitry Gutov
                       ` (2 preceding siblings ...)
  2017-07-26 19:01     ` Eli Zaretskii
@ 2017-07-26 23:31     ` Noam Postavsky
  3 siblings, 0 replies; 11+ messages in thread
From: Noam Postavsky @ 2017-07-26 23:31 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Emacs developers

On Wed, Jul 26, 2017 at 12:58 PM, Dmitry Gutov <dgutov@yandex.ru> wrote:
> Hey Noam,
> Sorry I'm late to the party. Some questions below. Thanks.

I responded in Bug#6843 (also see #27840 since it's due to this commit).



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

* Re: [Emacs-diffs] master 644cdd1: Use grep's --null option (Bug#6843)
  2017-07-26 18:10     ` Michael Albinus
@ 2017-07-27 12:01       ` Dmitry Gutov
  2017-07-27 12:51         ` Alexis
                           ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Dmitry Gutov @ 2017-07-27 12:01 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Noam Postavsky, emacs-devel

On 7/26/17 9:10 PM, Michael Albinus wrote:

> # grep --null a *
> grep: unrecognized option `--null'
> BusyBox v1.01 (2017.06.06-18:34+0000) multi-call binary

Thanks.

Do people use [recent versions of] Emacs in BusyBox environments, though?



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

* Re: [Emacs-diffs] master 644cdd1: Use grep's --null option (Bug#6843)
  2017-07-27 12:01       ` Dmitry Gutov
@ 2017-07-27 12:51         ` Alexis
  2017-07-27 12:53         ` Herring, Davis
                           ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Alexis @ 2017-07-27 12:51 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Michael Albinus, Noam Postavsky, emacs-devel


Dmitry Gutov <dgutov@yandex.ru> writes:

> On 7/26/17 9:10 PM, Michael Albinus wrote:
>
>> # grep --null a *
>> grep: unrecognized option `--null'
>> BusyBox v1.01 (2017.06.06-18:34+0000) multi-call binary
>
> Thanks.
>
> Do people use [recent versions of] Emacs in BusyBox 
> environments, though?

Iirc, BusyBox is the default userland on Alpine Linux.


Alexis.



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

* Re: [Emacs-diffs] master 644cdd1: Use grep's --null option (Bug#6843)
  2017-07-27 12:01       ` Dmitry Gutov
  2017-07-27 12:51         ` Alexis
@ 2017-07-27 12:53         ` Herring, Davis
  2017-07-27 13:09         ` Kaushal Modi
  2017-07-27 13:30         ` Michael Albinus
  3 siblings, 0 replies; 11+ messages in thread
From: Herring, Davis @ 2017-07-27 12:53 UTC (permalink / raw)
  To: Dmitry Gutov, Michael Albinus; +Cc: Noam Postavsky, emacs-devel@gnu.org

> Do people use [recent versions of] Emacs in BusyBox environments, though?

Isn't the point of BusyBox to save enough disk and memory to install Emacs on otherwise overconstrained devices?

Davis

PS - I meant this as a joke, but having written it, it starts to sound like a good idea...


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

* Re: [Emacs-diffs] master 644cdd1: Use grep's --null option (Bug#6843)
  2017-07-27 12:01       ` Dmitry Gutov
  2017-07-27 12:51         ` Alexis
  2017-07-27 12:53         ` Herring, Davis
@ 2017-07-27 13:09         ` Kaushal Modi
  2017-07-27 13:30         ` Michael Albinus
  3 siblings, 0 replies; 11+ messages in thread
From: Kaushal Modi @ 2017-07-27 13:09 UTC (permalink / raw)
  To: Dmitry Gutov, Michael Albinus; +Cc: Noam Postavsky, emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 522 bytes --]

On Thu, Jul 27, 2017, 8:01 AM Dmitry Gutov <dgutov@yandex.ru> wrote:

> On 7/26/17 9:10 PM, Michael Albinus wrote:
>
> > # grep --null a *
> > grep: unrecognized option `--null'
> > BusyBox v1.01 (2017.06.06-18:34+0000) multi-call binary
>
> Thanks.
>
> Do people use [recent versions of] Emacs in BusyBox environments, though?
>

I use Emacs 25.2 on my Android phone via Termux. I occasionally use grep
from within Emacs too directly (and pretty sure more so, indirectly,
through some other package).


-- 

Kaushal Modi

[-- Attachment #1.2: Type: text/html, Size: 1266 bytes --]

[-- Attachment #2: Screenshot_20170727-090641.png --]
[-- Type: image/png, Size: 314714 bytes --]

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

* Re: [Emacs-diffs] master 644cdd1: Use grep's --null option (Bug#6843)
  2017-07-27 12:01       ` Dmitry Gutov
                           ` (2 preceding siblings ...)
  2017-07-27 13:09         ` Kaushal Modi
@ 2017-07-27 13:30         ` Michael Albinus
  2017-07-27 13:55           ` Dmitry Gutov
  3 siblings, 1 reply; 11+ messages in thread
From: Michael Albinus @ 2017-07-27 13:30 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Noam Postavsky, emacs-devel

Dmitry Gutov <dgutov@yandex.ru> writes:

Hi Dmitry,

>> # grep --null a *
>> grep: unrecognized option `--null'
>> BusyBox v1.01 (2017.06.06-18:34+0000) multi-call binary
>
> Do people use [recent versions of] Emacs in BusyBox environments, though?

The example above is from my QNAP NAS server. Indeed, there is an Emacs
installation on this machine. But this is not my use case.

And it is not only BusyBox which counts. On HP-UX 11.31, you'll see HP's
grep implementation:

--8<---------------cut here---------------start------------->8---
# what /usr/bin/grep
/usr/bin/grep:
         $Revision: B.11.31_LR
# grep --null a *  
grep: illegal option -- -
grep: illegal option -- u
usage: grep [-E|-F] [-c|-l|-q] [-bhinsvwx] -e pattern_list...
        [-f pattern_file...] [file...]
usage: grep [-E|-F] [-c|-l|-q] [-bhinsvwx] [-e pattern_list...]
        -f pattern_file... [file...]
usage: grep [-E|-F] [-c|-l|-q] [-bhinsvwx] pattern [file...]
--8<---------------cut here---------------end--------------->8---

And yes, there's also an Emacs installation on HP-UX 11.31, I'll use
occasionally @work.

But my major use case is to call `grep' and friends remotely, from my
local Emacs, running in an Ubuntu environment. The remote machine could
run anything, which does not conform to GNU grep.

Best regards, Michael.



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

* Re: [Emacs-diffs] master 644cdd1: Use grep's --null option (Bug#6843)
  2017-07-27 13:30         ` Michael Albinus
@ 2017-07-27 13:55           ` Dmitry Gutov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Gutov @ 2017-07-27 13:55 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Noam Postavsky, emacs-devel

On 7/27/17 4:30 PM, Michael Albinus wrote:

> And yes, there's also an Emacs installation on HP-UX 11.31, I'll use
> occasionally @work.
> 
> But my major use case is to call `grep' and friends remotely, from my
> local Emacs, running in an Ubuntu environment. The remote machine could
> run anything, which does not conform to GNU grep.

All right. Thanks for the explanation.



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

end of thread, other threads:[~2017-07-27 13:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20170720000208.23054.66272@vcs0.savannah.gnu.org>
     [not found] ` <20170720000210.0E44020A56@vcs0.savannah.gnu.org>
2017-07-26 16:58   ` [Emacs-diffs] master 644cdd1: Use grep's --null option (Bug#6843) Dmitry Gutov
2017-07-26 18:10     ` Michael Albinus
2017-07-27 12:01       ` Dmitry Gutov
2017-07-27 12:51         ` Alexis
2017-07-27 12:53         ` Herring, Davis
2017-07-27 13:09         ` Kaushal Modi
2017-07-27 13:30         ` Michael Albinus
2017-07-27 13:55           ` Dmitry Gutov
2017-07-26 18:54     ` Andreas Schwab
2017-07-26 19:01     ` Eli Zaretskii
2017-07-26 23:31     ` Noam Postavsky

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.