GNU bug report logs - #27239
25.1; grep: current symbol substitutes part of grep-command

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: Yuri Khan <yuri.v.khan@HIDDEN>; Keywords: confirmed; dated Sun, 4 Jun 2017 17:50:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) confirmed. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 27239 <at> debbugs.gnu.org:


Received: (at 27239) by debbugs.gnu.org; 12 Dec 2020 12:54:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 12 07:54:48 2020
Received: from localhost ([127.0.0.1]:44134 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ko4QC-00055x-35
	for submit <at> debbugs.gnu.org; Sat, 12 Dec 2020 07:54:48 -0500
Received: from quimby.gnus.org ([95.216.78.240]:46802)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1ko4QA-00055d-5q
 for 27239 <at> debbugs.gnu.org; Sat, 12 Dec 2020 07:54:46 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=oKTBpUojUu48dMQzBTeSzQG3Knj1vFA3gvF9PHlHBlg=; b=J7VHQet3N8ZcRQUGibv82ErOTD
 N4uveS1ZwpVBZHkKswkNaDbPyxD1BMJoFRTat4bCUsL4/hgcNAvoWbQ8nPl6VKGGSnleTk1GqGzwi
 OVHsjENyHqalvJkIMIcWdsuJQ8su1uk9T4gXSMUQWK2/XrUsfHLAMvfReY4+Xrp6C5BE=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1ko4Q1-000608-Ld; Sat, 12 Dec 2020 13:54:40 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Yuri Khan <yuri.v.khan@HIDDEN>
Subject: Re: bug#27239: 25.1; grep: current symbol substitutes part of
 grep-command
References: <CAP_d_8UVfrjMcbP=q1WnUfGWHoT0oEV83SmZ1ck4siPdzjDTZg@HIDDEN>
X-Now-Playing: Squarepusher's _Be Up A Hello_: "Speedcrank"
Date: Sat, 12 Dec 2020 13:54:36 +0100
In-Reply-To: <CAP_d_8UVfrjMcbP=q1WnUfGWHoT0oEV83SmZ1ck4siPdzjDTZg@HIDDEN>
 (Yuri Khan's message of "Mon, 5 Jun 2017 00:48:30 +0700")
Message-ID: <87pn3f422b.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 
 Content preview:  Yuri Khan <yuri.v.khan@HIDDEN> writes: > $ emacs -Q > >
    (setq grep-command "git --no-pager grep --no-index -Hn -E -e ") C-x C-e >
    (setq grep-use-null-device nil) C-x C-e > > M-x grep RET > > ⇒ Run grep
    (like this): git --no-pager grep -- [...] 
 
 Content analysis details:   (-2.9 points, 5.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
                             [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 27239
Cc: 27239 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Yuri Khan <yuri.v.khan@HIDDEN> writes:

> $ emacs -Q
>
> (setq grep-command "git --no-pager grep --no-index -Hn -E -e ") C-x C-e
> (setq grep-use-null-device nil) C-x C-e
>
> M-x grep RET
>
> =E2=87=92 Run grep (like this): git --no-pager grep --no-index -Hn -E -e
>
> <down>
>
> =E2=87=92 Run grep (like this): git --no-pager '' --no-index -Hn -E -e
>
> Observed behavior: =E2=80=98grep=E2=80=99 takes the last command from the=
 history and
> replaces the first argument that does not start with a hyphen-minus with
> the current symbol. This is not documented anywhere.

(This bug report unfortunately didn't get any response at the time.)

This behaviour is still present in Emacs 28.

> Expected behavior: It would probably make sense to just generate the new
> command by concatenating =E2=80=98grep-command=E2=80=99 and the current s=
ymbol, without
> any heuristics to remove the search pattern from the previous command.

Yes, I think so, too.  Anybody have an opinion here?

--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27239; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 4 Jun 2017 17:49:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 04 13:49:03 2017
Received: from localhost ([127.0.0.1]:56082 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dHZeA-0002wH-SI
	for submit <at> debbugs.gnu.org; Sun, 04 Jun 2017 13:49:03 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33844)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yurivkhan@HIDDEN>) id 1dHZe9-0002vo-US
 for submit <at> debbugs.gnu.org; Sun, 04 Jun 2017 13:49:02 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <yurivkhan@HIDDEN>) id 1dHZe3-00046K-ER
 for submit <at> debbugs.gnu.org; Sun, 04 Jun 2017 13:48:56 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:33521)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <yurivkhan@HIDDEN>) id 1dHZe3-00046F-BD
 for submit <at> debbugs.gnu.org; Sun, 04 Jun 2017 13:48:55 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53013)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <yurivkhan@HIDDEN>) id 1dHZe1-0003gg-L1
 for bug-gnu-emacs@HIDDEN; Sun, 04 Jun 2017 13:48:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <yurivkhan@HIDDEN>) id 1dHZe0-00044V-J5
 for bug-gnu-emacs@HIDDEN; Sun, 04 Jun 2017 13:48:53 -0400
Received: from mail-wr0-x22c.google.com ([2a00:1450:400c:c0c::22c]:35806)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <yurivkhan@HIDDEN>) id 1dHZe0-000444-AC
 for bug-gnu-emacs@HIDDEN; Sun, 04 Jun 2017 13:48:52 -0400
Received: by mail-wr0-x22c.google.com with SMTP id q97so28001273wrb.2
 for <bug-gnu-emacs@HIDDEN>; Sun, 04 Jun 2017 10:48:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:sender:from:date:message-id:subject:to
 :content-transfer-encoding;
 bh=fgdTOq0EBf8CFecSYfL9UfUX96+zpvVvFZLnsPsh96E=;
 b=tVUTfVrHNgDgINKThfg4gkT+FGSjDNpNxdsc6zBqHT6vGsE4XmMcAoJm4kZoS48gIR
 /ALWcVC1jdiG3X/3agcCBcrN+H+J15vG7uFI25Um70eYP/amEZFtbAxCHbaTtM6cxnIy
 J3ZayLLVuU1LnreZISAnnOzEsSDnvWzkoUudLlAgWGiTX+OUwJdJR3d6IErt501NOsHj
 nLbMHKvLiu5sk7vcWdA6YDHA4KHo7LbsAVP5JGX/065ABny7saSYbcyS94zGtxsTrzzk
 u5vditARLw/gJW8yumLe7wsXaskrnVzp2X+R6NGk39OLyxewe4iQ8tWMaierJhAFDO+H
 MMZg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:sender:from:date:message-id:subject
 :to:content-transfer-encoding;
 bh=fgdTOq0EBf8CFecSYfL9UfUX96+zpvVvFZLnsPsh96E=;
 b=i+pzUalZFMK8UcbmwW/19Qg18JbF0OgObe2t9Hg2RsmFoqUvHDMc5hUWACKhkXj4bP
 k2FO/wrg4hSaSc9T4s2tqanuPeV+Zr2RMJx6+gHg1ihqE53S9ijfSt1gqcdYb0vX0J5D
 dIThTp6hE5ir7cxc0JLUo0O3EMmq9hMyr9/3gidgHveQ00WkBEPxR7Qh72qDEc2Wy8HY
 3icPLrQu0yIKzY5QGnIxPyffgw9DH8J791+y8UKmR6/BHMFwRO464//AyhCew89Gbp6S
 CCYxFgMYU6smdbKAAAMjLQuYiBW1ssw+hX0ESrRMKMxf1Pk+NxUrkoOuq6OlX3JTZo1E
 ymXQ==
X-Gm-Message-State: AODbwcA6WzJFczk/V2KJuFj9nw6WzVf6lvW7JMvDADw3QvzzntLb6P26
 vEQ3Q80+HdRN1UIUVKx2NFuRzJfvOhs4
X-Received: by 10.223.146.166 with SMTP id 35mr10981707wrn.98.1496598530962;
 Sun, 04 Jun 2017 10:48:50 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.223.164.93 with HTTP; Sun, 4 Jun 2017 10:48:30 -0700 (PDT)
From: Yuri Khan <yuri.v.khan@HIDDEN>
Date: Mon, 5 Jun 2017 00:48:30 +0700
X-Google-Sender-Auth: WREuQcQ8rKR6CDd_Ov9JbzN89KM
Message-ID: <CAP_d_8UVfrjMcbP=q1WnUfGWHoT0oEV83SmZ1ck4siPdzjDTZg@HIDDEN>
Subject: 25.1; grep: current symbol substitutes part of grep-command
To: bug-gnu-emacs@HIDDEN
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

$ emacs -Q

(setq grep-command "git --no-pager grep --no-index -Hn -E -e ") C-x C-e
(setq grep-use-null-device nil) C-x C-e

M-x grep RET

=E2=87=92 Run grep (like this): git --no-pager grep --no-index -Hn -E -e

<down>

=E2=87=92 Run grep (like this): git --no-pager '' --no-index -Hn -E -e


Observed behavior: =E2=80=98grep=E2=80=99 takes the last command from the h=
istory and
replaces the first argument that does not start with a hyphen-minus with
the current symbol. This is not documented anywhere.

Expected behavior: It would probably make sense to just generate the new
command by concatenating =E2=80=98grep-command=E2=80=99 and the current sym=
bol, without
any heuristics to remove the search pattern from the previous command.



In GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
 of 2016-12-13, modified by Debian built on lgw01-55
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description:    Ubuntu 16.04.2 LTS

Configured using:
 'configure --build x86_64-linux-gnu --prefix=3D/usr
 --sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib
 --localstatedir=3D/var/lib --infodir=3D/usr/share/info
 --mandir=3D/usr/share/man --with-pop=3Dyes
 --enable-locallisppath=3D/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25=
.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.1/site-li=
sp:/usr/share/emacs/site-lisp
 --with-sound=3Dalsa --build x86_64-linux-gnu --prefix=3D/usr
 --sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib
 --localstatedir=3D/var/lib --infodir=3D/usr/share/info
 --mandir=3D/usr/share/man --with-pop=3Dyes
 --enable-locallisppath=3D/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25=
.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.1/site-li=
sp:/usr/share/emacs/site-lisp
 --with-sound=3Dalsa --with-x=3Dyes --with-x-toolkit=3Dgtk3
 --with-toolkit-scroll-bars 'CFLAGS=3D-g -O2 -fstack-protector-strong
 -Wformat -Werror=3Dformat-security -Wall' 'CPPFLAGS=3D-Wdate-time
 -D_FORTIFY_SOURCE=3D2' 'LDFLAGS=3D-Wl,-Bsymbolic-functions -Wl,-z,relro''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LC_MONETARY: en_RU.UTF-8
  value of $LC_NUMERIC: en_RU.UTF-8
  value of $LC_TIME: en_RU.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
"git --no-pager grep -Hn -E -e "
Quit
M-g RET is undefined
user-error: End of history; no default available
Quit [2 times]

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mailabbrev gmm-utils mailheader sendmail mail-utils mail-parse
rfc2231 rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu
cl-loaddefs pcase cl-lib mail-prsvr mailcap shell pcomplete thingatpt
grep compile comint ansi-color ring time-date mule-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
dbusbind inotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 106114 9489)
 (symbols 48 20561 0)
 (miscs 40 49 171)
 (strings 32 22533 4220)
 (string-bytes 1 586703)
 (vectors 16 12930)
 (vector-slots 8 441229 4253)
 (floats 8 166 267)
 (intervals 56 264 0)
 (buffers 976 17)
 (heap 1024 43106 995))




Acknowledgement sent to Yuri Khan <yuri.v.khan@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#27239; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 12 Dec 2020 13:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.