GNU bug report logs - #516
[PATCH] Minor Enhancement for grep.el: auto-input the symbol into minibuffer command line.

Previous Next

Package: emacs;

Reported by: Kazuo YAGI <kyagi <at> miraclelinux.com>

Date: Wed, 2 Jul 2008 03:55:04 UTC

Severity: wishlist

Tags: patch, wontfix

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

Bug is archived. No further changes may be made.

Full log


Message #34 received at 516 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: <516 <at> debbugs.gnu.org>
Subject: Re: bug#516: [PATCH] Minor Enhancement for grep.el: auto-input thesymbol into minibuffer command line.
Date: Sun, 06 Dec 2009 02:35:31 +0200
>> `grep-tag-default' already provides the active region. But it uses
>> `shell-quote-argument' instead of surrounding by quotes.  I don't know
>> what is better, since it's harder to edit the command when
>> `shell-quote-argument' puts a backslash before every space
>> and some other characters.
>
> Not only that, but:
>
> a. You must use M-n to put it in the minibuffer. Not a big deal, but you must
> know about this, to think to do that.

You can use `C-u grep' instead of `M-n' to put it in the minibuffer as
initial input.  However, `C-u grep' is worse than `M-n' because such use
of C-u is non-standard (unlike `M-n' that is the standard key to put the
default value in the minibuffer).

> b. A default file-name pattern (e.g. "*.el") is also included, as part of what's
> inserted.

That's what rgrep/lgrep do.  They provide a default file-name pattern
depending on the buffer's file name.

> All of that (especially the backslashing instead of quoting), makes it harder to
> edit the text to match and the file names to match.

I don't like backslashing too.

>> Another drawback of `grep-tag-default' is that it provides only
>> one alternative.  This is unlike `read-regexp' that proposes
>> a list of possible default values.  So `grep-tag-default' could be
>> improved to do the same.
>
> FWIW, the code I use inserts the (quoted) region or the symbol name nearest
> point (if no active region), and leaves out a file pattern. (You can still get
> the vanilla default using `M-n'.)

I agree it would be better to provide the active region, and the vanilla
default using `M-n'.

-- 
Juri Linkov
http://www.jurta.org/emacs/



This bug report was last modified 6 years and 22 days ago.

Previous Next


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