unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 20728@debbugs.gnu.org
Subject: bug#20728: 25.0.50; grep and grep-find templates should have a place holder for the --color argument
Date: Mon, 29 Jun 2015 18:01:58 +0300	[thread overview]
Message-ID: <55915DE6.3030108@yandex.ru> (raw)
In-Reply-To: <8361666035.fsf@gnu.org>

On 06/29/2015 05:49 PM, Eli Zaretskii wrote:

>>> We could, if we want to test Grep's output ourselves.  That is, we
>>> will have to decide when to bind it to nil and when to non-nil,
>>
>> What do you mean by "test"?
>
> "Examine".  The behavior with pipes, files, consoles, and ptys is
> different.

I don't understand this. Grep's output happens after we bind, or not 
bind, this variable. So we can't test in beforehand (or do you mean in 
`grep-compute-defaults'?).

>> My point is, we have to decide whether to highlight matches or not, if
>> only to be compatible with Windows. And by "we", I mean in the
>> implementation of each given command.
>
> Yes, the alternative is to do everything in Lisp, and then use only
> "--color=no" or "--color=always", as appropriate.

That's what I'm proposing. This seems simpler and less error-prone. So 
this discussion is about the possible downsides.

>> Whether we want a given command to use a colorized Grep output, is not
>> dependent on the OS, is it?
>
> I don't think so.  But it might depend on the values of grep-program
> etc., i.e. on user customizations.  Users might want to put shell
> scripts or pipelines there.

Well, okay. If it's a significant use case, we might want to continue 
supporting it.

On the other hand, we might want to choose to set 
`grep-highlight-matches' to `always' in grep-compute-defaults, 
irrespective of the OS.

So that every command that knows it does not need the ANSI codes, will 
bind this variable to nil without relying on auto-detection thanks to 
calling Grep via a pipe. Then we won't have to test on Windows to find 
bugs like that.

And if a user customized grep-program, etc, to unexpectedly postprocess 
Grep ouput using a pipe, they can customize `grep-highlight-matches' to 
`auto' as well.





  reply	other threads:[~2015-06-29 15:01 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-03 23:42 bug#20728: 25.0.50; grep and grep-find templates should have a place holder for the --color argument Dmitry Gutov
2015-06-04  2:43 ` Eli Zaretskii
2015-06-04  8:58   ` Dmitry Gutov
2015-06-04 15:01     ` Eli Zaretskii
2015-06-04 15:18       ` Dmitry Gutov
2015-06-04 15:34         ` Eli Zaretskii
2015-06-04 15:36           ` Dmitry Gutov
2015-06-04 15:39             ` Eli Zaretskii
2015-06-04 16:55               ` Dmitry Gutov
2015-06-04 17:16                 ` Eli Zaretskii
2015-06-04 17:46                   ` Dmitry Gutov
2015-06-04 19:23                     ` Eli Zaretskii
2015-06-04 20:20                       ` Dmitry Gutov
2015-06-05  6:58                         ` Eli Zaretskii
2015-06-05  8:29                           ` Dmitry Gutov
2015-06-05  8:59                             ` Eli Zaretskii
2015-06-05  9:07                               ` Dmitry Gutov
2015-06-05  9:23                                 ` Eli Zaretskii
2015-06-05  9:47                                   ` Dmitry Gutov
2015-06-05 22:17                                     ` Juri Linkov
2015-06-06 10:19                                       ` Dmitry Gutov
2015-06-06 22:04                                         ` Juri Linkov
2015-06-07 22:22                                           ` Dmitry Gutov
2015-06-09 23:32                                             ` Juri Linkov
2015-06-10 17:55                                               ` Dmitry Gutov
2015-06-10 23:49                                                 ` Juri Linkov
2015-06-11  7:23                                                   ` Dmitry Gutov
2015-06-11 23:20                                                     ` Juri Linkov
2015-06-22  0:49                                                       ` Dmitry Gutov
2015-06-22 22:33                                                         ` Juri Linkov
2015-06-23  0:33                                                           ` Dmitry Gutov
2015-06-27 21:11                                                       ` Dmitry Gutov
2015-06-27 22:49                                                         ` Juri Linkov
2015-06-28  1:22                                                           ` Dmitry Gutov
2015-06-28  1:39                                                             ` Dmitry Gutov
2015-06-28  2:42                                                         ` Eli Zaretskii
2015-06-28  8:05                                                           ` Dmitry Gutov
2015-06-28 14:35                                                             ` Eli Zaretskii
2015-06-28 19:02                                                               ` Dmitry Gutov
2015-06-28 20:28                                                                 ` Eli Zaretskii
2015-06-28 20:31                                                                   ` Dmitry Gutov
2015-06-29  2:36                                                                     ` Eli Zaretskii
2015-06-29 10:08                                                                       ` Dmitry Gutov
2015-06-29 14:49                                                                         ` Eli Zaretskii
2015-06-29 15:01                                                                           ` Dmitry Gutov [this message]
2015-06-29 15:26                                                                             ` Eli Zaretskii
2015-06-29 16:11                                                                               ` Dmitry Gutov
2015-06-29 16:24                                                                                 ` Eli Zaretskii
2015-06-29 16:26                                                                                   ` Dmitry Gutov
2015-07-11 13:58                                                                                   ` Eli Zaretskii
2015-07-11 15:57                                                                                     ` Dmitry Gutov
2015-06-29 10:05                                                                   ` Dmitry Gutov
2015-06-29 14:44                                                                     ` Eli Zaretskii
2015-06-29 14:50                                                                       ` Dmitry Gutov
2015-06-29 15:15                                                                         ` Eli Zaretskii
2015-06-04 22:50 ` Juri Linkov
2015-06-05  9:49   ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55915DE6.3030108@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=20728@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).