bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Lars Ingebrigtsen
Subject: bug#27239: 25.1; grep: current symbol substitutes part of grep-command
Date: Sat, 12 Dec 2020 13:54:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Yuri Khan <yuri.v.khan@gmail.com> 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 --no-index -Hn -E -e
>
> <down>
>
> ⇒ Run grep (like this): git --no-pager '' --no-index -Hn -E -e
>
> Observed behavior: ‘grep’ 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 ‘grep-command’ and the current symbol, without
> any heuristics to remove the search pattern from the previous command.

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

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]