GNU bug report logs - #50502
grep-command cannot be set as a cons of the command and the point position

Previous Next

Package: emacs;

Reported by: Yuchen Pei <hi <at> ypei.me>

Date: Fri, 10 Sep 2021 10:31:02 UTC

Severity: normal

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Yuchen Pei <hi <at> ypei.me>
To: 50502 <at> debbugs.gnu.org
Subject: bug#50502: grep-command cannot be set as a cons of the command and the point position
Date: Fri, 10 Sep 2021 20:29:58 +1000
[Message part 1 (text/plain, inline)]
Hello,

The following works:

(setq grep-find-command
     '("find . -type f -exec grep -inRH --color -A1 -B1 -E 
     \\{\\} +" . 52))

which places the point nicely after -E in the minibuffer when 
invoking grep-find.

But not the following:

(setq grep-command '("grep -inRH --color -A1 -B1 -E  ." . 31))

as emacs would complain that grep-command is not a string, even 
though both use read-shell-command for the command reading.

Two similarly named functions grep-default-command[1] and 
grep-compute-defaults[2] are used by grep and grep-find 
respectively at the beginning, with the grep-default-command 
requiring a regexp match on the grep-command (hence the error).

[1] 
https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/grep.el#n821
[2] 
https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/grep.el#n615

The code is a bit involved and I haven't read it through yet, but 
I wonder if anyone has come across this problem?

-- 
Best,
Yuchen

PGP Key: 47F9 D050 1E11 8879 9040  4941 2126 7E93 EF86 DFD0
          <https://ypei.me/assets/ypei-pubkey.txt>
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 2 years and 327 days ago.

Previous Next


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