From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#6843: grep-mode and filenames with colons Date: Wed, 26 Jul 2017 19:32:27 -0400 Message-ID: <87h8xy93lg.fsf@users.sourceforge.net> References: <4C628768.5060808@cs.rpi.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1501111875 29430 195.159.176.226 (26 Jul 2017 23:31:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 26 Jul 2017 23:31:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) To: bug#6843 <6843@debbugs.gnu.org>, Andreas Schwab , Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 27 01:31:11 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1daVlk-0007G0-GW for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Jul 2017 01:31:08 +0200 Original-Received: from localhost ([::1]:40356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1daVlq-000088-8p for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Jul 2017 19:31:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1daVlh-000069-NA for bug-gnu-emacs@gnu.org; Wed, 26 Jul 2017 19:31:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1daVle-0004og-Hu for bug-gnu-emacs@gnu.org; Wed, 26 Jul 2017 19:31:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55096) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1daVle-0004oT-FS for bug-gnu-emacs@gnu.org; Wed, 26 Jul 2017 19:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1daVle-0004Cy-AJ for bug-gnu-emacs@gnu.org; Wed, 26 Jul 2017 19:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Jul 2017 23:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6843 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed patch Original-Received: via spool by 6843-submit@debbugs.gnu.org id=B6843.150111185816159 (code B ref 6843); Wed, 26 Jul 2017 23:31:02 +0000 Original-Received: (at 6843) by debbugs.gnu.org; 26 Jul 2017 23:30:58 +0000 Original-Received: from localhost ([127.0.0.1]:57772 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1daVlZ-0004CZ-PA for submit@debbugs.gnu.org; Wed, 26 Jul 2017 19:30:57 -0400 Original-Received: from mail-it0-f54.google.com ([209.85.214.54]:33873) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1daVlX-0004CM-Sv for 6843@debbugs.gnu.org; Wed, 26 Jul 2017 19:30:56 -0400 Original-Received: by mail-it0-f54.google.com with SMTP id v205so23105836itf.1 for <6843@debbugs.gnu.org>; Wed, 26 Jul 2017 16:30:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:in-reply-to:message-id:user-agent :mime-version; bh=qNLPxcy1z8GG84r6EIFEUR04pK1yU5g7mzMRsTCvgiI=; b=Zga+iZuM5TDsLP9/xtyLauEvubMS8cstXn/yTv3zAc4dH68z6LMmsuONG90dibUnWZ lvahxvyeZs3zoOlni6oK8TWg3SIW93Q8GGkJ9xLJjO3tZY2y9hR8wYUksKr+0zRIsOiA YFt3OFtbWdYjmMUhUHEX1lETZHh2F4Lh657JF0azSKJKYGx9LxngQBQKHuxvdXzbd3bM /i5wlfVWn5zjf2Wwd4k+zOGAdC62FaUkMmE4nczJMK/YY1SWpJF9hMkKK5w2D+CtQsyK N5CCZlJPWsMC6L7eA3mZEscclg4KudqLAe9ojMo3u+yiXf90iy+UePz33sXCDg6GtVO0 ADzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:in-reply-to :message-id:user-agent:mime-version; bh=qNLPxcy1z8GG84r6EIFEUR04pK1yU5g7mzMRsTCvgiI=; b=YKCz4iYnKHGePbjDBRT4CcRQIsy2QurC83xohxlUyPc4FrY6FPs9t3Wt83ziR1plaT oAHsQwfXHwTzCCh/RMj2Q82sa7m55ZBMdoGtVGW0LPM5zxzIO9Y/8wXAOopBeYfwjpWO vrqLCQLB+7h6K90V6Khc1pvnCSb4o2GRsLaTc3aKYkap7OBGxx/Wj6U7rjF5Eh8BAArf guJkeHSyvglKe8YgNHkgGBaO4rV9N5nwdOibeFf+H64NE7LuCYSHLavKaB/a+h7ia6mV dhP9HB+0rx9/40CZMWfSyHFZ7I7FBEz3FfnZ6Lt+EDY09RsI2EGFZykMeWW8yxdAj+Dw ALXQ== X-Gm-Message-State: AIVw113W4VAX3Eqf68RroH01+c22B2t8zaInzHqMHEh7NObgoZi8diP5 oS6k/ZBMHJQHfA== X-Received: by 10.36.50.83 with SMTP id j80mr2740335ita.32.1501111850212; Wed, 26 Jul 2017 16:30:50 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id y95sm2817967ita.4.2017.07.26.16.30.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Jul 2017 16:30:49 -0700 (PDT) In-Reply-To: bug's message of "Wed\, 26 Jul 2017 22\:31\:22 +0000" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:135035 Archived-At: On Wed, Jul 26, 2017 at 12:58 PM, Dmitry Gutov wrote: > >> +*** 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. As noted in the emacs-devel thread, non-GNU greps don't support it. >> +(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? It's on the next line, I capture the \0 so as to display it with a nicer string than "^@". >> + (2 '(face unspecified display ":"))) > 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. Might be worth using explicitly numbered groups to keep the numbers for FILE and COLUMN the same though. >> + ,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. Hmm yeah, I think I had them originally as let-bindings, and then I forgot to space them out when converting to defconst.