From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 644cdd1: Use grep's --null option (Bug#6843) Date: Wed, 26 Jul 2017 19:58:32 +0300 Message-ID: <10f1ac4b-aca5-53e9-5112-b8312471df82@yandex.ru> References: <20170720000208.23054.66272@vcs0.savannah.gnu.org> <20170720000210.0E44020A56@vcs0.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1501088329 16168 195.159.176.226 (26 Jul 2017 16:58:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 26 Jul 2017 16:58:49 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Thunderbird/55.0 To: emacs-devel@gnu.org, Noam Postavsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 26 18:58:44 2017 Return-path: Envelope-to: ged-emacs-devel@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 1daPdy-0003qO-IH for ged-emacs-devel@m.gmane.org; Wed, 26 Jul 2017 18:58:42 +0200 Original-Received: from localhost ([::1]:39241 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1daPe4-0004X2-7e for ged-emacs-devel@m.gmane.org; Wed, 26 Jul 2017 12:58:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1daPdx-0004Wt-O8 for emacs-devel@gnu.org; Wed, 26 Jul 2017 12:58:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1daPdt-0006X2-Mt for emacs-devel@gnu.org; Wed, 26 Jul 2017 12:58:41 -0400 Original-Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:38519) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1daPdt-0006WI-Ef for emacs-devel@gnu.org; Wed, 26 Jul 2017 12:58:37 -0400 Original-Received: by mail-wm0-x243.google.com with SMTP id r123so11325780wmb.5 for ; Wed, 26 Jul 2017 09:58:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=krYmS/03t+JNnrqDrvORNlDSmwIQLACMOdC4sknWziI=; b=Iu2mzQD0l07d2Vnb3THGUjV891CCj6nTessEhm6meaYFV1bNXCneUPsNKvKu/NYmKk z/DxSWAVsY021/4D9eyPm+YgdoDI7pFuA/nitXrJM87UV/vo01k4AODWWufmUxyrRzdD goRdy4zzDYVbfBHHMxF0HxYLqoj7mRojhBkp/EZOcHaSyhW9+Y+rc2U6xON9YoagL3Oa 5BP36Uk8PY6uIGVpdCOss58GJ6yjg3gtXcAYsc4yS3eqsSY+aoHHSkrnQf0DYeO1KHU4 zN155cUXhvR5hvx+syjNy9s9w5gdEOD+NraUBzpCgV/VcT9t2mfaz/vJ3whwX/Lk+6yx IZDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=krYmS/03t+JNnrqDrvORNlDSmwIQLACMOdC4sknWziI=; b=Yr7ywwk4pP/9tEwg2TvWP4vz34CJI9fJp1p0+8dme5yLV8gZKAy2T7QoeHVTqP/qSr /bArzdrWb/2WG9igA8vnjFx6u+v+H0WIcSvFAjeeVcf3Ho+KVyiskYiYidLhunC/5qft fmVgcv18UEajF8HKp764qY0RTTS91r5VOdlaz7fQsoxWg6fjG1WvnczZxaABD7+x5v6m NLKhbw4S/h5RZGcHDudqn6pbUA09F3hSMLhsLlypaIW/p/WXsmarAAZIkQwRWvI7bMBF +xNUxKoBO8alj2sIftjy+zd5bZymngzoiD0HOJdhT4RH6DGrbEAbFQA5JCutuq2WM2BK zbSQ== X-Gm-Message-State: AIVw110Cq/IKG1MHyLnG1U4iO310hRgXj6mIQUSweAoZO+iYLvywRnyf furvG1NQCaFEXA== X-Received: by 10.80.224.200 with SMTP id j8mr1340931edl.230.1501088314858; Wed, 26 Jul 2017 09:58:34 -0700 (PDT) Original-Received: from [192.168.0.133] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by smtp.googlemail.com with ESMTPSA id x36sm8838385edb.64.2017.07.26.09.58.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Jul 2017 09:58:33 -0700 (PDT) In-Reply-To: <20170720000210.0E44020A56@vcs0.savannah.gnu.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:217050 Archived-At: 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 > Commit: Noam Postavsky ... > +*** 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.