From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#516: [PATCH] Minor Enhancement for grep.el: auto-input thesymbol into minibuffer command line. Date: Sun, 06 Dec 2009 02:35:31 +0200 Organization: JURTA Message-ID: <87ocmc51x0.fsf@mail.jurta.org> References: <486AFA3E.9050400@miraclelinux.com> <87einaqjxu.fsf@mail.jurta.org> <87y6lh8bga.fsf@mail.jurta.org> Reply-To: Juri Linkov , 516@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1260064067 12032 80.91.229.12 (6 Dec 2009 01:47:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Dec 2009 01:47:47 +0000 (UTC) Cc: 516@emacsbugs.donarmstrong.com To: "Drew Adams" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 06 02:47:40 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NH6Dr-00046O-J6 for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Dec 2009 02:47:39 +0100 Original-Received: from localhost ([127.0.0.1]:47675 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NH6Dr-0006dK-5f for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Dec 2009 20:47:39 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NH6Dm-0006cF-Lb for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2009 20:47:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NH6Dh-0006ac-97 for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2009 20:47:33 -0500 Original-Received: from [199.232.76.173] (port=49229 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NH6Dh-0006aY-5Z for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2009 20:47:29 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:51339) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NH6Dh-0002K8-3S for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2009 20:47:29 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB61lPvD032633; Sat, 5 Dec 2009 17:47:26 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nB61U3nN030857; Sat, 5 Dec 2009 17:30:03 -0800 Resent-Date: Sat, 5 Dec 2009 17:30:03 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Juri Linkov Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Sun, 06 Dec 2009 01:30:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 516 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: patch Original-Received: via spool by 516-submit@emacsbugs.donarmstrong.com id=B516.126006286830753 (code B ref 516); Sun, 06 Dec 2009 01:30:03 +0000 Original-Received: (at 516) by emacsbugs.donarmstrong.com; 6 Dec 2009 01:27:48 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mx1.starman.ee (smtp-out3.starman.ee [85.253.0.5]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB61Rk1J030741 for <516@emacsbugs.donarmstrong.com>; Sat, 5 Dec 2009 17:27:48 -0800 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Original-Received: from mail.starman.ee (82.131.97.127.cable.starman.ee [82.131.97.127]) by mx1.starman.ee (Postfix) with ESMTP id 40C913F4273; Sun, 6 Dec 2009 03:27:41 +0200 (EET) In-Reply-To: (Drew Adams's message of "Sat, 5 Dec 2009 12:28:03 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Sat, 05 Dec 2009 20:47:33 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:33302 Archived-At: >> `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/