From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 11 10:10:14 2010 Received: (at submit) by debbugs.gnu.org; 11 Aug 2010 14:10:14 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OjC0T-0003ro-Bb for submit@debbugs.gnu.org; Wed, 11 Aug 2010 10:10:14 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oj9Mn-0001x8-Sj for submit@debbugs.gnu.org; Wed, 11 Aug 2010 07:21:06 -0400 Received: from lists.gnu.org ([199.232.76.165]:56694) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Oj9NY-0005uZ-9x for submit@debbugs.gnu.org; Wed, 11 Aug 2010 07:21:52 -0400 Received: from [140.186.70.92] (port=47890 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oj9NW-0001sY-K8 for bug-gnu-emacs@gnu.org; Wed, 11 Aug 2010 07:21:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_SORBS_WEB, T_DKIM_INVALID, T_RP_MATCHES_RCVD autolearn=no version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oj9NV-0001pi-L0 for bug-gnu-emacs@gnu.org; Wed, 11 Aug 2010 07:21:50 -0400 Received: from cliffclavin.cs.rpi.edu ([128.113.126.25]:55034) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oj9NV-0001oE-In for bug-gnu-emacs@gnu.org; Wed, 11 Aug 2010 07:21:49 -0400 X-Hash: SCtCte|eb6eb2b3c706ff83dafe2fca18068e667c6f25ae|4e0df4232a251636afc0ccee722c137d X-Countries: Cameroon, United States X-SMTP-From: accepted [195.24.198.206] [195.24.198.206] ([10.0.13.196]) {Cameroon} DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=cs.rpi.edu; h= message-id:date:from:mime-version:to:subject:content-type :content-transfer-encoding; s=default; i=glasse@cs.rpi.edu; t= 1281525702; x=1282130502; l=3764; bh=EUmeDYinsNYzMTJJ2twt4KVlGQQ =; b=gtY8AfOnpiJjSGCe43fwW/r6w5Oa9dHMoP6vQEt+u9DU3efaEOBDI2Dslm+ QfZd+qz6AXbajJJKas2Nhs4Ri86MX0U7Vei5ZXhuc4AnDm7rbada348iWZ8wdY+Z ocKOkwZI7U+AjunFpCqsuB/V/NNVvxyKsN0BND0OBe7H/SYY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cs.rpi.edu; h=message-id :date:from:mime-version:to:subject:content-type :content-transfer-encoding; q=dns; s=default; b=WWulLV/MZNQnC8dE tZqTKHXJNqJu1oSsWuiaLoUuE+BIJu98qmZUlILugjpvkg/ws2jtE2XyKULGrii4 nZHUIF66LyS4uskYosJPncLpUDRCleSTa5DHUTsFwFjI15qR45IQEG1L/H5jZVfx 8z3RRxm90rhs/shinQ/ByA+JV0I= Authentication-Results: cliffclavin.cs.rpi.edu; DKIM=neutral (none) header.from=glasse@cs.rpi.edu; SPF=neutral (mfrom; Mechanism '?all' matched) smtp.mail=glasse@cs.rpi.edu X-Auth-Passed: cliffclavin.cs.rpi.edu:o7BBKUTI078287 Auth:glasse X-Virus-Scanned-By: cliffclavin.cs.rpi.edu Received: from [10.0.13.196] ([195.24.198.206]) (authenticated bits=0) by cliffclavin.cs.rpi.edu (8.14.3/8.14.3) with ESMTP id o7BBKUTI078287 for ; Wed, 11 Aug 2010 07:21:19 -0400 (EDT) (envelope-from glasse@cs.rpi.edu) Message-ID: <4C628768.5060808@cs.rpi.edu> Date: Wed, 11 Aug 2010 07:20:08 -0400 From: Ethan Glasser-Camp User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: 23.1; grep-mode and filenames with colors Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 128.113.126.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 11 Aug 2010 10:10:12 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.3 (---) grep-mode highlights matches based on the presence of a pair of colons around a number. But, for example, if you do this: ethan@joker:~$ mkdir test ethan@joker:~$ echo 'Hello' > test/10:45:20.txt ethan@joker:~$ emacs -q M-x rgrep Hello ~/test The results will mis-highlight 10:45:20, coloring "45" as the line number (when it is part of the name of the file). Correspondingly, if you do M-x grep Hello 10: The same thing happens. It's not possible to automatically jump-to-line when this happens. Thanks for your time, Ethan In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.18.3) of 2010-03-26 on palmer, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.10604000 configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Grep Minor modes in effect: shell-dirtrack-mode: t tooltip-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x r g r e p H e l l o * f o o t e s t C-x o C-a C-x k M-x H e l l o t e s t C-x o M-x f o o * s r c a m C-x o M-x H e l l o ~ ~ t e s t C-x o C-x o M-x H e l l o M-x g r e p H e l l o SPC M-x H e l l o SPC 1 0 : M-x C-g M-x e m a c b b u r e p o r t Recent messages: Grep finished (matches found) Mark set Grep finished (matches found) Mark set Grep finished (matches found) [3 times] Grep finished with no matches found Grep finished (matches found) Quit Making completion list... /usr/bin/mail is not an executable. Setting mail-interactive to t. From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 28 18:50:28 2011 Received: (at control) by debbugs.gnu.org; 28 Jan 2011 23:50:29 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Piy5E-0008Mm-2w for submit@debbugs.gnu.org; Fri, 28 Jan 2011 18:50:28 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Piy5B-0008Mb-P3 for control@debbugs.gnu.org; Fri, 28 Jan 2011 18:50:26 -0500 Received: from localhost ([127.0.0.1]:42241) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PiyD5-0004Kp-C7; Fri, 28 Jan 2011 18:58:35 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19779.22571.79126.632840@fencepost.gnu.org> Date: Fri, 28 Jan 2011 18:58:35 -0500 From: Glenn Morris To: control Subject: emacs X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: blue X-Ran: 7RjCPg68\qC=aClx[!"dQ"NlZ}.`KB~=g"b<3zWkG1&Dtj#OGT6>/)"x^|z7(d*tdZ;B31 X-Debbugs-No-Ack: yes X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) merge 6843 7378 From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 28 07:59:27 2017 Received: (at control) by debbugs.gnu.org; 28 Jun 2017 11:59:27 +0000 Received: from localhost ([127.0.0.1]:41754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQBd0-0007pz-Hu for submit@debbugs.gnu.org; Wed, 28 Jun 2017 07:59:27 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:34714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQBcz-0007pj-07; Wed, 28 Jun 2017 07:59:25 -0400 Received: by mail-io0-f196.google.com with SMTP id m19so5024367ioe.1; Wed, 28 Jun 2017 04:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=QLd8uMlW06ZP9Ok20J/lHBpmDYfIwZeyE49B6xRh0Bg=; b=mUV5JGlVf/W2Cq2nBrt4e05RSDs66q/PVIiSHm7NsE5WRu++hvB5jXUlZtLmsUugGN 0Ef+YcREv33L+VvzXrUdk1PQEuya53x7QEvwUV+7xxlIgiBtImBkJrvrS1pArTl8vHNM penqGq6iP97bNQ++kq2RSTtLnlcbid/iaGytR16iHxd0KfOOYZ4zBB2KBUPudl2JyXmX QWzD9vzscJsPpG32nsi61TwzkGlSYQvmSwt91KEubJqTyqxwu1JvOT4fKdjMz7qkeRCZ RBo8AjvHxEnKVtobKWAx4c8tYcI7IywoVXw3KcyiYWHrJkSAsgoms9oN1ohvzp3bHHJp 0ftw== 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:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=QLd8uMlW06ZP9Ok20J/lHBpmDYfIwZeyE49B6xRh0Bg=; b=C4Lp0sx+wpOW8kEOELENqXH6dvayZDI78paQ1mo6O2wLblqKYALhAovM4bt/ZHgZ7v kwWsurxqyy4ZtrHhQNvPqJG/NqW4Mw11/dYq1IeGKcEpbfmQcJt3ZWLaLLQbZ/GZGZQH +phXQdtt3oDM78+5g6/o90vWKyWe+Q8xBsTK/Mhhvl0pCZE0MBvvkyZ1zDWk85gi6aL0 +SWjWO8IgpwZ8ai978NynMqmQvDCf2kygx7TJ/YX/9Ax8cHaozXGpCXO7aUA43Q0MQY+ FBNSjMosfEqMl2O8Pe35wsu/BnGc7G59tXm1ZrP+AGACO1U89aq1BYSmsXp4REdZ2/Cw e06w== X-Gm-Message-State: AKS2vOy4Xah21w2xwsHDCV6ZytBHA5pr3VBC9Ay7cpKV9xl6UfKoto0I i6UZSCWiqBatS1v9 X-Received: by 10.107.16.81 with SMTP id y78mr12004221ioi.105.1498651159259; Wed, 28 Jun 2017 04:59:19 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id b17sm2773935itd.0.2017.06.28.04.59.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Jun 2017 04:59:18 -0700 (PDT) From: npostavs@users.sourceforge.net To: Stefan Monnier Subject: Re: bug#7378: 23.2; grep buffer misinterprets result if filename contains colon character References: <87fwv7a8pj.wl%greenrd@greenrd.org> <877hgha7fm.wl%greenrd@greenrd.org> <87obyvkgw9.fsf@mail.jurta.org> Date: Wed, 28 Jun 2017 08:00:53 -0400 In-Reply-To: (Stefan Monnier's message of "Wed, 07 Sep 2011 22:52:12 -0400") Message-ID: <87r2y4midm.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: control Cc: Juri Linkov , 7378@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) --=-=-= Content-Type: text/plain tags 7378 + patch quit >> The only way to do this reliably with GNU grep is to ask it to output >> escape sequences around file names and line numbers. > Feel free to try, but not for 24.1. And please try and quantify the > performance impact (if any), because M-x grep is already too slow. GNU grep also supports --null to output NUL bytes following file names, I haven't measured but it should be no slower and possibly faster since the regexp is simpler. There is a bit of added complexity to still support other greps which don't have --null: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Use-grep-s-null-option-Bug-6843.patch Content-Description: patch >From 0042aa5616560657e867aa977dad732ab18e30dc Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Tue, 13 Sep 2016 20:48:09 -0400 Subject: [PATCH] Use grep's --null option (Bug#6843) * lisp/progmodes/grep.el (grep-use-null-filename-separator): New option. (grep--regexp-alist-column, grep--regexp-alist-bin-matcher) (grep-with-null-regexp-alist, grep-fallback-regexp-alist): New constants, replacing `grep-regexp-alist'. (grep-regex-alist): Mark the variable obsolete, add a new function of the same name to replace it. (grep-compute-defaults): Compute default for `grep-use-null-filename-separator'. (grep-mode): Set compilation-error-regexp-alist (buffer locally) to the value of `grep-with-null-regexp-alist' or `grep-fallback-regexp-alist' according to `grep-use-null-filename-separator'. * lisp/progmodes/xref.el (xref-collect-matches): Call `grep-regex-alist' instead of the obsolete variable. Don't hardcode grep-regexp-alist match groups. --- lisp/progmodes/grep.el | 103 +++++++++++++++++++++++++++++++++++-------------- lisp/progmodes/xref.el | 33 ++++++++-------- 2 files changed, 92 insertions(+), 44 deletions(-) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index b3d8a51cee..a4b85bbbe4 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -47,8 +47,8 @@ (defvar grep-host-defaults-alist nil (defun grep-apply-setting (symbol value) "Set SYMBOL to VALUE, and update `grep-host-defaults-alist'. SYMBOL should be one of `grep-command', `grep-template', -`grep-use-null-device', `grep-find-command', -`grep-find-template', `grep-find-use-xargs', or +`grep-use-null-device', `grep-find-command' `grep-find-template', +`grep-find-use-xargs', `grep-use-null-filename-separator', or `grep-highlight-matches'." (when grep-host-defaults-alist (let* ((host-id @@ -160,6 +160,15 @@ (defcustom grep-use-null-device 'auto-detect :set 'grep-apply-setting :group 'grep) +(defcustom grep-use-null-filename-separator 'auto-detect + "If non-nil, use `grep's `--null' option. +This is done to disambiguate file names in `grep's output." + :type '(choice (const :tag "Do Not Use `--null'" nil) + (const :tag "Use `--null'" t) + (other :tag "Not Set" auto-detect)) + :set 'grep-apply-setting + :group 'grep) + ;;;###autoload (defcustom grep-find-command nil "The default find command for \\[grep-find]. @@ -357,33 +366,53 @@ (defvar grep-last-buffer nil Notice that using \\[next-error] or \\[compile-goto-error] modifies `compilation-last-buffer' rather than `grep-last-buffer'.") -;;;###autoload -(defconst grep-regexp-alist - '( - ;; Use a tight regexp to handle weird file names (with colons +(defconst grep--regexp-alist-column + ;; Calculate column positions (col . end-col) of first grep match on a line + (cons + (lambda () + (when grep-highlight-matches + (let* ((beg (match-end 0)) + (end (save-excursion (goto-char beg) (line-end-position))) + (mbeg (text-property-any beg end 'font-lock-face 'grep-match-face))) + (when mbeg + (- mbeg beg))))) + (lambda () + (when grep-highlight-matches + (let* ((beg (match-end 0)) + (end (save-excursion (goto-char beg) (line-end-position))) + (mbeg (text-property-any beg end 'font-lock-face 'grep-match-face)) + (mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil end)))) + (when mend + (- mend beg))))))) +(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 + (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 + `(;; Use a tight regexp to handle weird file names (with colons ;; in them) as well as possible. E.g., use [1-9][0-9]* rather ;; than [0-9]+ so as to accept ":034:" in file names. ("^\\(.*?[^/\n]\\):[ \t]*\\([1-9][0-9]*\\)[ \t]*:" - 1 2 - ;; Calculate column positions (col . end-col) of first grep match on a line - ((lambda () - (when grep-highlight-matches - (let* ((beg (match-end 0)) - (end (save-excursion (goto-char beg) (line-end-position))) - (mbeg (text-property-any beg end 'font-lock-face grep-match-face))) - (when mbeg - (- mbeg beg))))) - . - (lambda () - (when grep-highlight-matches - (let* ((beg (match-end 0)) - (end (save-excursion (goto-char beg) (line-end-position))) - (mbeg (text-property-any beg end 'font-lock-face grep-match-face)) - (mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil end)))) - (when mend - (- mend beg))))))) - ("^Binary file \\(.+\\) matches$" 1 nil nil 0 1)) - "Regexp used to match grep hits. See `compilation-error-regexp-alist'.") + 1 2 ,grep--regexp-alist-column) + ,grep--regexp-alist-bin-matcher) + "Regexp used to match grep hits when `--null' is not supported. +See `compilation-error-regexp-alist'.") + +(defvaralias 'grep-regex-alist 'grep-with-null-regexp-alist) +(make-obsolete-variable + 'grep-regex-alist "Call `grep-regexp-alist' instead." "26.1") + +;;;###autoload +(defun grep-regexp-alist () + "Return a regexp alist to match grep hits. +The regexp used depends on `grep-use-null-filename-separator'. +See `compilation-error-regexp-alist' for format details." + (if grep-use-null-filename-separator + grep-with-null-regexp-alist grep-fallback-regexp-alist)) (defvar grep-first-column 0 ; bug#10594 "Value to use for `compilation-first-column' in grep buffers.") @@ -538,6 +567,7 @@ (defun grep-compute-defaults () (grep-use-null-device ,grep-use-null-device) (grep-find-command ,grep-find-command) (grep-find-template ,grep-find-template) + (grep-use-null-filename-separator ,grep-use-null-filename-separator) (grep-find-use-xargs ,grep-find-use-xargs) (grep-highlight-matches ,grep-highlight-matches))))) (let* ((host-id @@ -550,7 +580,8 @@ (defun grep-compute-defaults () ;; computed for every host once. (dolist (setting '(grep-command grep-template grep-use-null-device grep-find-command - grep-find-template grep-find-use-xargs + grep-use-null-filename-separator + grep-find-template grep-find-use-xargs grep-highlight-matches)) (set setting (cadr (or (assq setting host-defaults) @@ -576,6 +607,21 @@ (defun grep-compute-defaults () (concat (regexp-quote hello-file) ":[0-9]+:English"))))))))) + (when (eq grep-use-null-filename-separator 'auto-detect) + (setq grep-use-null-filename-separator + (with-temp-buffer + (let* ((hello-file (expand-file-name "HELLO" data-directory)) + (args `("--null" "-ne" "^English" ,hello-file))) + (if grep-use-null-device + (setq args (append args (list null-device))) + (push "-H" args)) + (and (grep-probe grep-program `(nil t nil ,@args)) + (progn + (goto-char (point-min)) + (looking-at + (concat (regexp-quote hello-file) + "\0[0-9]+:English")))))))) + (when (eq grep-highlight-matches 'auto-detect) (setq grep-highlight-matches (with-temp-buffer @@ -591,6 +637,7 @@ (defun grep-compute-defaults () grep-template grep-find-template) (let ((grep-options (concat (if grep-use-null-device "-n" "-nH") + (if grep-use-null-filename-separator " --null") (if (grep-probe grep-program `(nil nil nil "-e" "foo" ,null-device) nil 1) @@ -733,7 +780,7 @@ (define-compilation-mode grep-mode "Grep" (set (make-local-variable 'compilation-error-face) grep-hit-face) (set (make-local-variable 'compilation-error-regexp-alist) - grep-regexp-alist) + (grep-regexp-alist)) ;; compilation-directory-matcher can't be nil, so we set it to a regexp that ;; can never match. (set (make-local-variable 'compilation-directory-matcher) '("\\`a\\`")) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index b8ec50f14a..cc9b794c5a 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -917,20 +917,21 @@ (defun xref-collect-matches (regexp files dir ignores) (grep-compute-defaults) (defvar grep-find-template) (defvar grep-highlight-matches) - (let* ((grep-find-template (replace-regexp-in-string "" " -E" - grep-find-template t t)) - (grep-highlight-matches nil) - ;; TODO: Sanitize the regexp to remove Emacs-specific terms, - ;; so that Grep can search for the "relaxed" version. Can we - ;; do that reliably enough, without creating false negatives? - (command (xref--rgrep-command (xref--regexp-to-extended regexp) - files - (expand-file-name dir) - ignores)) - (buf (get-buffer-create " *xref-grep*")) - (grep-re (caar grep-regexp-alist)) - status - hits) + (pcase-let* + ((grep-find-template (replace-regexp-in-string "" " -E" + grep-find-template t t)) + (grep-highlight-matches nil) + ;; TODO: Sanitize the regexp to remove Emacs-specific terms, + ;; so that Grep can search for the "relaxed" version. Can we + ;; do that reliably enough, without creating false negatives? + (command (xref--rgrep-command (xref--regexp-to-extended regexp) + files + (expand-file-name dir) + ignores)) + (buf (get-buffer-create " *xref-grep*")) + (`(,grep-re ,file-group ,line-group . ,_) (car (grep-regexp-alist))) + (status nil) + (hits nil)) (with-current-buffer buf (erase-buffer) (setq status @@ -944,8 +945,8 @@ (defun xref-collect-matches (regexp files dir ignores) (not (looking-at grep-re))) (user-error "Search failed with status %d: %s" status (buffer-string))) (while (re-search-forward grep-re nil t) - (push (list (string-to-number (match-string 2)) - (match-string 1) + (push (list (string-to-number (match-string line-group)) + (match-string file-group) (buffer-substring-no-properties (point) (line-end-position))) hits))) (xref--convert-hits (nreverse hits) regexp))) -- 2.11.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 19 20:03:20 2017 Received: (at 6843) by debbugs.gnu.org; 20 Jul 2017 00:03:20 +0000 Received: from localhost ([127.0.0.1]:48322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXyw3-0000e6-Ut for submit@debbugs.gnu.org; Wed, 19 Jul 2017 20:03:20 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:35052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXyw1-0000dd-Ag; Wed, 19 Jul 2017 20:03:17 -0400 Received: by mail-it0-f67.google.com with SMTP id v127so989010itd.2; Wed, 19 Jul 2017 17:03:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ES8QYVKTrMzeHrYBmKI9XHDLTMpXfzxh3lH8wwOcLFw=; b=hlq4+PFqr25P/9xgoPpnJ+qCZiUzj4Lt8PLGYvmeATmWvQj8yRNOIHv1lK6Kwj7jwt pB0FouSjHiktk4HtT+PJqzAQZbx1xTygPAcZq47L/ybBrooCartCNOuzi2oWfPqDrJh9 hJM6bl8NlmRTmdjmWTqn9y+aaVhJIxfgMCyf3WjxYjX80frFtrkYlSatrTmrfNbUgpCY wFgbexfFc/GBslu/dD/amdGExWsFRLS1WP4Vba3ffUkY7UXpzBDv8yUx3fzMUIIekycJ nBTxP6fqDEu0ep32mj7drgMQZ0GQSRVFbEOJsPxKZAVNUguuiiw/OyO+9jqLr907fPu8 PyRw== 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:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=ES8QYVKTrMzeHrYBmKI9XHDLTMpXfzxh3lH8wwOcLFw=; b=EbkPOmBK24/k6/7vOSYdokbFEXl3LAboTMBDCibcW0YD4wQtFXOH3GhmYqIkt6ki2k kLAPImu+lDUH7+VY67dDUwR7zIefn1W7cuEi+yZAmHs0NEYjFIaDvZ71c2IMWfVsv1iQ bZUODyO7wZJ1EdvgA0z2ReBVY8S6MJVrAtJVYodR8B/l3U6jbXLIFuYt4Knto54SXFKY jPkknw5EvRtco0mIeFT8MWQKW3r/6TuAfsoDhEExqAEtCInRzSTiIUGqUtprGaGQOQIc lYH7bI+EzGAcsa3uauox4s1gRnSsvl5cKxTlGKnS30hmsUaX63GclHR6kByJpV2ufCxj reDw== X-Gm-Message-State: AIVw110MRpOTMdulzXjvClx5PjDhACpFKv85fLjbLTc/Q/i5kjDq/RrP LYoL1lSXalxpEb/O X-Received: by 10.36.207.70 with SMTP id y67mr1641268itf.128.1500508991597; Wed, 19 Jul 2017 17:03:11 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id v65sm537381itc.32.2017.07.19.17.03.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jul 2017 17:03:10 -0700 (PDT) From: npostavs@users.sourceforge.net To: Stefan Monnier Subject: Re: bug#7378: 23.2; grep buffer misinterprets result if filename contains colon character References: <87fwv7a8pj.wl%greenrd@greenrd.org> <877hgha7fm.wl%greenrd@greenrd.org> <87obyvkgw9.fsf@mail.jurta.org> <87r2y4midm.fsf@users.sourceforge.net> Date: Wed, 19 Jul 2017 20:04:45 -0400 In-Reply-To: <87r2y4midm.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Wed, 28 Jun 2017 08:00:53 -0400") Message-ID: <87vamo9dnm.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 6843 Cc: Juri Linkov , 7378@debbugs.gnu.org, 6843@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) tags 7378 fixed close 7378 26.1 quit npostavs@users.sourceforge.net writes: > > GNU grep also supports --null to output NUL bytes following file names, > I haven't measured but it should be no slower and possibly faster since > the regexp is simpler. Pushed to master. [1: 644cdd1aa0]: 2017-07-19 20:03:00 -0400 Use grep's --null option (Bug#6843) http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=644cdd1aa0a10dbfffa3b9b4c7a97f8cddded0b8 From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 26 19:30:58 2017 Received: (at 6843) by debbugs.gnu.org; 26 Jul 2017 23:30:58 +0000 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 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 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) 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) From: npostavs@users.sourceforge.net To: bug#6843 <6843@debbugs.gnu.org>, Andreas Schwab , Dmitry Gutov Subject: bug#6843: grep-mode and filenames with colons Date: Wed, 26 Jul 2017 19:32:27 -0400 In-Reply-To: bug's message of "Wed\, 26 Jul 2017 22\:31\:22 +0000" Message-ID: <87h8xy93lg.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 6843 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 27 08:17:09 2017 Received: (at 6843) by debbugs.gnu.org; 27 Jul 2017 12:17:09 +0000 Received: from localhost ([127.0.0.1]:57981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dahj3-0003zg-8Y for submit@debbugs.gnu.org; Thu, 27 Jul 2017 08:17:09 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35743) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dahj1-0003z8-B3 for 6843@debbugs.gnu.org; Thu, 27 Jul 2017 08:17:07 -0400 Received: by mail-wm0-f67.google.com with SMTP id r77so10382887wmd.2 for <6843@debbugs.gnu.org>; Thu, 27 Jul 2017 05:17:07 -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=/ZwBf9FEDfctQX1I56XXQ9mYZ2Oxb8GIU8GHyHP6ikQ=; b=OMK5awWaGpYtGrHCkX817TpNEX8wp6IFhY/x97APQnLRzy8+pa0UpsMNiKjb7bJ8Gs 6lQseEWISkzmtddkzGth4tWrHdHLXbmlVPKZe1DNztUhMdGa3V1qKj+RoUsvod/IgF6b rmbNZeEymXpqC9BkbYP0LpRsGHxjCA+CLj2TSsWf4Nt74YlIyayRcP4TdYOlVQjInDe8 1xv3IfD+ezaxgKtSfAmWRWQO8T5GRPg83khSrZ6fKW8n6EEN8CvVriEgjBcZjbjoDOJf +Jj5v8GxxGFcn2v/naSfkvX++G9m0j4fiRsqz+tai6XxLicJDPul5pMNa9z4b244haFX d2Jg== 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=/ZwBf9FEDfctQX1I56XXQ9mYZ2Oxb8GIU8GHyHP6ikQ=; b=qj07Kmd/TCk3nhSR4PYa/qMTNaHvf48FK5wbOAbMvucFGtyVYmHzeFWr4DH+chEqsV voRAf5+Tpz1HpgvrlGZ0JRMQECgTS3U3QyJiwqzwrbFIWHBxnu1hNsqc6rAS3qNEh/nL b9SuILOye+LVUWiYq7J/VvaynKYDo59t3j1YdeNXUFO4v+tST7PeWWdeBJPEPfCN1RtA /7nheMo6gFKms5EBscBtLGEfZ2enaG1GtkNMgn2tr88YpBBnOtU25TX5CHBpZleRqL76 o/NvJZwsl5seGleiz34yvFE9VSFCh2T/0Fo/ZLkhM7bS2E2uX2iPPCksq1kHNxCnLDbd M8SQ== X-Gm-Message-State: AIVw112wPRebfJSs2tJQWC5ymxUaOnFhapm09BoBSXrdCRZnstayzpSZ g6Ud8sqAtRnnH+XrWXw= X-Received: by 10.28.211.193 with SMTP id k184mr375078wmg.21.1501157444421; Thu, 27 Jul 2017 05:10:44 -0700 (PDT) Received: from [192.168.0.133] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by smtp.googlemail.com with ESMTPSA id p45sm19115772wrb.75.2017.07.27.05.10.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jul 2017 05:10:43 -0700 (PDT) Subject: Re: bug#6843: grep-mode and filenames with colons To: npostavs@users.sourceforge.net, bug#6843 <6843@debbugs.gnu.org>, Andreas Schwab References: <87h8xy93lg.fsf@users.sourceforge.net> From: Dmitry Gutov Message-ID: Date: Thu, 27 Jul 2017 15:10:40 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Thunderbird/55.0 MIME-Version: 1.0 In-Reply-To: <87h8xy93lg.fsf@users.sourceforge.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 6843 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) On 7/27/17 2:32 AM, npostavs@users.sourceforge.net wrote: > As noted in the emacs-devel thread, non-GNU greps don't support it. And we can't always ask the user to install GNU Grep? If we do need to support both ways, maybe tweak the variable names. As of now, they look a bit inconsistent. I'd prefer to have either grep-with-null-regexp-alist and grep-[without-null-]-regexp-alist, or grep-regexp-alist and grep-fallback-regexp-alist. Just a suggestion. >> 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 "^@". Oh, right. Thanks. >>> + (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. Yes, I think it will be a good idea. Provided we can combine it with renaming either of the variables back to grep-regexp-alist. Otherwise, any backward compatibility is broken anyway. >> 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. Thanks in advance. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 27 13:21:06 2017 Received: (at 6843) by debbugs.gnu.org; 27 Jul 2017 17:21:06 +0000 Received: from localhost ([127.0.0.1]:58851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1damTC-0000sX-Ea for submit@debbugs.gnu.org; Thu, 27 Jul 2017 13:21:06 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1damTA-0000rj-S0 for 6843@debbugs.gnu.org; Thu, 27 Jul 2017 13:21:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1damT5-0008B7-2Z for 6843@debbugs.gnu.org; Thu, 27 Jul 2017 13:20:59 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55926) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1damSz-000875-WA; Thu, 27 Jul 2017 13:20:54 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2434 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1damSz-00015G-Hx; Thu, 27 Jul 2017 13:20:53 -0400 Date: Thu, 27 Jul 2017 20:20:41 +0300 Message-Id: <83tw1x4x06.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-reply-to: (message from Dmitry Gutov on Thu, 27 Jul 2017 15:10:40 +0300) Subject: Re: bug#6843: grep-mode and filenames with colons References: <87h8xy93lg.fsf@users.sourceforge.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 6843 Cc: 6843@debbugs.gnu.org, schwab@linux-m68k.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Dmitry Gutov > Date: Thu, 27 Jul 2017 15:10:40 +0300 > > On 7/27/17 2:32 AM, npostavs@users.sourceforge.net wrote: > > > As noted in the emacs-devel thread, non-GNU greps don't support it. > > And we can't always ask the user to install GNU Grep? We could, but I don't think users will indeed do that. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 30 11:00:05 2017 Received: (at 6843) by debbugs.gnu.org; 30 Jul 2017 15:00:05 +0000 Received: from localhost ([127.0.0.1]:34394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dbphN-0005Af-35 for submit@debbugs.gnu.org; Sun, 30 Jul 2017 11:00:05 -0400 Received: from mail-it0-f50.google.com ([209.85.214.50]:35608) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dbphK-00059g-QU for 6843@debbugs.gnu.org; Sun, 30 Jul 2017 11:00:03 -0400 Received: by mail-it0-f50.google.com with SMTP id h199so115145333ith.0 for <6843@debbugs.gnu.org>; Sun, 30 Jul 2017 08:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=kPUzgHr/fSI0JCwYrUvdnkPWI6Yrjyd8I9xRK0J1Ae0=; b=vaKY924xXw7gGG/MF2JMHwr3AjEYYvG/tTAo9rwkK61w4x4d1oDWChQdoweUk4B5z2 +JJpbAVAdEtdqrMhj1q4db/RriUP/jMRIwetThKMOh70+fsfinLiC71cXhrZWIh5q1fn qfXHxKvyPCzLTWQXhYctxZfMfLa76Kmdi4WrnN07qCY5OGP1r/kn/xxzQlEYSpABU35C 4WCtjFyibTmKE8aB6nYzbWp0bGOGGzX3qCySWQ3qEpjBPWJGhGoopYIhYnYrOkBH4Jg0 /P4lwTVBxkfZWml8zuqw+yefhoh0djg2+FOMBfYqQFRP4A+5Rrs7gE7MuAgsomHhLe6N HjsQ== 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:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=kPUzgHr/fSI0JCwYrUvdnkPWI6Yrjyd8I9xRK0J1Ae0=; b=XSkfkjYe7+8Eyl1wjuQUPnZhBFuLUpcAfPOfIAJOphAdb0iqKzBVdeK8MKJ969eAyd w94fHIa5FMXzGUbVvZurCWgA7pYkYPUVOjiDRtoEiDDvyCs/KVhRdysRxdawoXfF0jBF Gci1KmwY2uZ31O52l0O1lG9AmyFv8qKXsd2NzDFxbcuxQLH6FM+N3RZ06ph8T/eQquOR MpV+XsbCj99mC2pLik5GdkiwkV4QQ+sGh2yPFkoClEg0pxm7G9kOnBNswPQEMTO3GFSV E4bVQq3jO9tUuGKRkJ4VlMFn1iD1BJSccYGYA7t2MCB7vd+k89trioUqize9lCY62o4e 1M4g== X-Gm-Message-State: AIVw111VEl8XjoJSsp3bIWTAGoPtrgOjcTT83V4Ce43UZBh3IVbQX31r /z+sMcptjZzoYA== X-Received: by 10.36.152.136 with SMTP id n130mr16210862itd.79.1501426797214; Sun, 30 Jul 2017 07:59:57 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id h66sm3542087itd.29.2017.07.30.07.59.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 30 Jul 2017 07:59:56 -0700 (PDT) From: npostavs@users.sourceforge.net To: Dmitry Gutov Subject: Re: bug#6843: grep-mode and filenames with colons References: <87h8xy93lg.fsf@users.sourceforge.net> Date: Sun, 30 Jul 2017 11:01:36 -0400 In-Reply-To: (Dmitry Gutov's message of "Thu, 27 Jul 2017 15:10:40 +0300") Message-ID: <87d18i7yun.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 6843 Cc: bug#6843 <6843@debbugs.gnu.org>, Andreas Schwab X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Dmitry Gutov writes: > I'd prefer to have either grep-with-null-regexp-alist and > grep-[without-null-]-regexp-alist, or grep-regexp-alist and > grep-fallback-regexp-alist. Just a suggestion. > [...] >> >>> 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. > > Yes, I think it will be a good idea. Provided we can combine it with > renaming either of the variables back to grep-regexp-alist. Otherwise, > any backward compatibility is broken anyway. That part is already covered by this, no? (defvaralias 'grep-regex-alist 'grep-with-null-regexp-alist) (make-obsolete-variable 'grep-regex-alist "Call `grep-regexp-alist' instead." "26.1") From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 01 09:28:55 2017 Received: (at 6843) by debbugs.gnu.org; 1 Aug 2017 13:28:55 +0000 Received: from localhost ([127.0.0.1]:36250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dcXEF-0005Tj-L4 for submit@debbugs.gnu.org; Tue, 01 Aug 2017 09:28:55 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dcXEE-0005TW-Di for 6843@debbugs.gnu.org; Tue, 01 Aug 2017 09:28:54 -0400 Received: by mail-wm0-f67.google.com with SMTP id x64so3069759wmg.1 for <6843@debbugs.gnu.org>; Tue, 01 Aug 2017 06:28:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=PcYqxQcHeBePfSennjR0LQHxS8YnoayZfsU+3Mb2wWU=; b=s4ZYc4zH1z5iNmS8p7orGTsX5VzwWWX9VuIYNLPoWYMLtyDHv9ybXIWwXlpSPx/e5+ oKB6KW64bUI8yFkdfx8nlZy/UJiW9bwxBHg0QfcOBtC3i+rM2TCuXUVUu43a/sPNt98q ARhVKH9wojAyRFIIX40+9pVe8rsORQsbpWtGw2JVkLJWFHxxz4qKq6/jBklU4dynAQsR lsA4StA96JNq6OPIrmAiFqFZUoJvFXa3SaWgTpg/MCexW9p1ZI9mOM1kJ/WjNDMlAK0f qc91wSLJMf+wCRI29L6A11iOqMFOnu0LBpRhCtwFt0PDHikY5hmDsyuQ359noqHre2gp ylqg== 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:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=PcYqxQcHeBePfSennjR0LQHxS8YnoayZfsU+3Mb2wWU=; b=rgRRFHJtQjyVnaPcmMKisFTT/lTGM6L030q2VMxrGVGjsTnbDc4zKJsPOGJhxhldWC VEU/XLdAY7CatJIN92JUeVmJGA0jXtDPDo1s3MzfCdWPxL2kf8gS6KlMxxbQABOmKu01 gNtV+aTTc1O0415IOYVXpaxI22wIRbqkch2bRoVZ1wnVj4rCAiW4LDr9MtyCwZBeZWhJ Vb8kqhbn/i6CvK2k4I4Oc0FFjVSuB3z/7SR6AiCbb4OoVbCQ0/WgTFqc4bdbDmJ7o/zj tj2MjuJHqdRMY8uk5SlWAlbEVLLJIUwa/7oSPbIPpk20JucaMfcmV6vHlW4AwuQeByXa r5vg== X-Gm-Message-State: AIVw1109PH6Afn0hMufiWxhTFKg93GtplDMDrcQK3kdMzNmxexFHCBp0 4n1nxxpu14Sf2g== X-Received: by 10.80.135.216 with SMTP id 24mr17415336edz.121.1501594128649; Tue, 01 Aug 2017 06:28:48 -0700 (PDT) Received: from [192.168.0.133] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by smtp.googlemail.com with ESMTPSA id 15sm14565395edw.86.2017.08.01.06.28.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Aug 2017 06:28:47 -0700 (PDT) Subject: Re: bug#6843: grep-mode and filenames with colons To: npostavs@users.sourceforge.net References: <87h8xy93lg.fsf@users.sourceforge.net> <87d18i7yun.fsf@users.sourceforge.net> From: Dmitry Gutov Message-ID: <5111fa2b-2c6a-3e52-b7cb-1161ff554fea@yandex.ru> Date: Tue, 1 Aug 2017 16:28:44 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Thunderbird/55.0 MIME-Version: 1.0 In-Reply-To: <87d18i7yun.fsf@users.sourceforge.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 6843 Cc: bug#6843 <6843@debbugs.gnu.org>, Andreas Schwab X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) On 7/30/17 6:01 PM, npostavs@users.sourceforge.net wrote: > That part is already covered by this, no? > > (defvaralias 'grep-regex-alist 'grep-with-null-regexp-alist) > (make-obsolete-variable > 'grep-regex-alist "Call `grep-regexp-alist' instead." "26.1") I suppose so. Thanks. From unknown Mon Jun 23 11:27:11 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 30 Aug 2017 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator