unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#1863: Improved grep prompt
@ 2009-01-12  2:07 jidanni
  2009-01-14  1:18 ` Juri Linkov
  0 siblings, 1 reply; 13+ messages in thread
From: jidanni @ 2009-01-12  2:07 UTC (permalink / raw)
  To: bug-gnu-emacs

Regarding M-x grep, here are the current and improved prompts:
Run grep (like this): grep -nH -e
Run grep (like this): grep -nH -e [Cursor goes here] * <--and an asterisk here. I.e., @=cursor:
Run grep (like this): grep -nH -e @ *
If you use my improved prompt suggestion above, no longer will
everybody forget to add a filename, and leave thinking "no matches found".







^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#1863: Improved grep prompt
  2009-01-12  2:07 bug#1863: Improved grep prompt jidanni
@ 2009-01-14  1:18 ` Juri Linkov
  2009-01-14  1:33   ` jidanni
  2018-04-15 22:12   ` Lars Ingebrigtsen
  0 siblings, 2 replies; 13+ messages in thread
From: Juri Linkov @ 2009-01-14  1:18 UTC (permalink / raw)
  To: jidanni; +Cc: 1863

> Regarding M-x grep, here are the current and improved prompts:
> Run grep (like this): grep -nH -e
> Run grep (like this): grep -nH -e [Cursor goes here] * <--and an asterisk here. I.e., @=cursor:
> Run grep (like this): grep -nH -e @ *
> If you use my improved prompt suggestion above, no longer will
> everybody forget to add a filename, and leave thinking "no matches found".

Everybody's using rgrep and lgrep these days and never forget a filename ;-)

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






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#1863: Improved grep prompt
  2009-01-14  1:18 ` Juri Linkov
@ 2009-01-14  1:33   ` jidanni
  2009-01-14 23:52     ` Juri Linkov
  2018-04-15 22:12   ` Lars Ingebrigtsen
  1 sibling, 1 reply; 13+ messages in thread
From: jidanni @ 2009-01-14  1:33 UTC (permalink / raw)
  To: juri; +Cc: 1863

JL> Everybody's using rgrep and lgrep these days
Well I would make M-x grep say that then, with a an option available
for those who really want to use the old grep even after finally
learning this news.






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#1863: Improved grep prompt
  2009-01-14  1:33   ` jidanni
@ 2009-01-14 23:52     ` Juri Linkov
  2009-01-15  0:40       ` jidanni
  0 siblings, 1 reply; 13+ messages in thread
From: Juri Linkov @ 2009-01-14 23:52 UTC (permalink / raw)
  To: jidanni; +Cc: 1863

> JL> Everybody's using rgrep and lgrep these days
> Well I would make M-x grep say that then,

It already says that.
`C-h f grep RET':

    For doing a recursive `grep', see the `rgrep' command.
    For running `grep' in a specific directory, see `lgrep'.

> with a an option available for those who really want to use the old
> grep even after finally learning this news.

There is already a template option for the old `grep'.
`C-h v grep-command RET':

    grep-command is a variable defined in `grep.el'.
    Its value is "grep -nH -e *"

    Documentation:
    The default grep command for M-g r e.

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






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#1863: Improved grep prompt
  2009-01-14 23:52     ` Juri Linkov
@ 2009-01-15  0:40       ` jidanni
  2009-01-15  1:09         ` Lennart Borgman
  2009-01-15  2:54         ` Stefan Monnier
  0 siblings, 2 replies; 13+ messages in thread
From: jidanni @ 2009-01-15  0:40 UTC (permalink / raw)
  To: juri; +Cc: 1863

JL> It already says that.
JL> `C-h f grep RET':
But nobody would look there often. All I know is I took the Tutorial
in the 80's and would never know about the two new greps unless
alerted somehow.
JL> There is already a template option for the old `grep'.
JL>     grep-command is a variable defined in `grep.el'.
JL>     Its value is "grep -nH -e *"
Ah, newer than Debian sid. OK, doing
(setq grep-command "grep -nHe *"); until emacs 23
By the way, you can combine the nH and e options to save some minibuffer.






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#1863: Improved grep prompt
  2009-01-15  0:40       ` jidanni
@ 2009-01-15  1:09         ` Lennart Borgman
  2009-01-15  1:27           ` Juri Linkov
  2009-01-15  2:54         ` Stefan Monnier
  1 sibling, 1 reply; 13+ messages in thread
From: Lennart Borgman @ 2009-01-15  1:09 UTC (permalink / raw)
  To: jidanni, 1863

On Thu, Jan 15, 2009 at 1:40 AM,  <jidanni@jidanni.org> wrote:
> JL> It already says that.
> JL> `C-h f grep RET':
> But nobody would look there often. All I know is I took the Tutorial
> in the 80's and would never know about the two new greps unless
> alerted somehow.

In your case I myself see nothing that can help then ;-) but I think
newbees would benefit from having all the search and replace commands
under search and replace in the edit menu.

Otherwise the wheel will be invented over and over.






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#1863: Improved grep prompt
  2009-01-15  1:09         ` Lennart Borgman
@ 2009-01-15  1:27           ` Juri Linkov
  2009-01-15  1:55             ` Lennart Borgman
  0 siblings, 1 reply; 13+ messages in thread
From: Juri Linkov @ 2009-01-15  1:27 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: 1863, jidanni

>> JL> It already says that.
>> JL> `C-h f grep RET':
>> But nobody would look there often. All I know is I took the Tutorial
>> in the 80's and would never know about the two new greps unless
>> alerted somehow.
>
> In your case I myself see nothing that can help then ;-) but I think
> newbees would benefit from having all the search and replace commands
> under search and replace in the edit menu.

I can't believe we still don't have these useful commands in the menu.
But why do you think they should be placed in the Edit menu?

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






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#1863: Improved grep prompt
  2009-01-15  1:27           ` Juri Linkov
@ 2009-01-15  1:55             ` Lennart Borgman
  2009-01-16  0:31               ` Juri Linkov
  0 siblings, 1 reply; 13+ messages in thread
From: Lennart Borgman @ 2009-01-15  1:55 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 1863, jidanni

On Thu, Jan 15, 2009 at 2:27 AM, Juri Linkov <juri@jurta.org> wrote:
>>> JL> It already says that.
>>> JL> `C-h f grep RET':
>>> But nobody would look there often. All I know is I took the Tutorial
>>> in the 80's and would never know about the two new greps unless
>>> alerted somehow.
>>
>> In your case I myself see nothing that can help then ;-) but I think
>> newbees would benefit from having all the search and replace commands
>> under search and replace in the edit menu.
>
> I can't believe we still don't have these useful commands in the menu.
> But why do you think they should be placed in the Edit menu?

That is where the search and replace commands normally are. Why do you
doubt they should be there?






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#1863: Improved grep prompt
  2009-01-15  0:40       ` jidanni
  2009-01-15  1:09         ` Lennart Borgman
@ 2009-01-15  2:54         ` Stefan Monnier
  1 sibling, 0 replies; 13+ messages in thread
From: Stefan Monnier @ 2009-01-15  2:54 UTC (permalink / raw)
  To: jidanni; +Cc: 1863

You can also use C-u M-x grep.
That's what I use, personally.


        Stefan






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#1863: Improved grep prompt
  2009-01-15  1:55             ` Lennart Borgman
@ 2009-01-16  0:31               ` Juri Linkov
  2009-01-16  0:54                 ` Lennart Borgman
  2009-01-16  9:27                 ` richardeng
  0 siblings, 2 replies; 13+ messages in thread
From: Juri Linkov @ 2009-01-16  0:31 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: 1863, jidanni

>>> In your case I myself see nothing that can help then ;-) but I think
>>> newbees would benefit from having all the search and replace commands
>>> under search and replace in the edit menu.
>>
>> I can't believe we still don't have these useful commands in the menu.
>> But why do you think they should be placed in the Edit menu?
>
> That is where the search and replace commands normally are. Why do you
> doubt they should be there?

The `Grep' menu entry is traditionally in the Tools menu because it reads
an external command like `Compile' and `Shell Command' do.  So perhaps we
should add `rgrep' and `lgrep' to the Tools menu.

A less controversial change is to add `rgrep' and `lgrep' to the
grep mode menu:

Index: lisp/progmodes/grep.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/grep.el,v
retrieving revision 1.98
diff -u -r1.98 grep.el
--- lisp/progmodes/grep.el	5 Jan 2009 03:23:37 -0000	1.98
+++ lisp/progmodes/grep.el	16 Jan 2009 00:27:48 -0000
@@ -204,12 +204,18 @@
     (define-key map [menu-bar grep compilation-compile]
       '(menu-item "Compile..." compile
 		  :help "Compile the program including the current buffer.  Default: run `make'"))
+    (define-key map [menu-bar grep compilation-lgrep]
+      '(menu-item "Local grep..." lgrep
+		  :help "User-friendly grep"))
+    (define-key map [menu-bar grep compilation-rgrep]
+      '(menu-item "Recursive grep..." rgrep
+		  :help "User-friendly recursive grep in directory tree"))
+    (define-key map [menu-bar grep compilation-grep-find]
+      '(menu-item "Grep via Find..." grep-find
+		  :help "Run grep via find, with user-specified args"))
     (define-key map [menu-bar grep compilation-grep]
       '(menu-item "Another grep..." grep
 		  :help "Run grep, with user-specified args, and collect output in a buffer."))
-    (define-key map [menu-bar grep compilation-grep-find]
-      '(menu-item "Recursive grep..." grep-find
-		  :help "Run grep via find, with user-specified args"))
     (define-key map [menu-bar grep compilation-recompile]
       '(menu-item "Repeat grep" recompile
 		  :help "Run grep again"))

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






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#1863: Improved grep prompt
  2009-01-16  0:31               ` Juri Linkov
@ 2009-01-16  0:54                 ` Lennart Borgman
  2009-01-16  9:27                 ` richardeng
  1 sibling, 0 replies; 13+ messages in thread
From: Lennart Borgman @ 2009-01-16  0:54 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 1863, jidanni

On Fri, Jan 16, 2009 at 1:31 AM, Juri Linkov <juri@jurta.org> wrote:
>>>> In your case I myself see nothing that can help then ;-) but I think
>>>> newbees would benefit from having all the search and replace commands
>>>> under search and replace in the edit menu.
>>>
>>> I can't believe we still don't have these useful commands in the menu.
>>> But why do you think they should be placed in the Edit menu?
>>
>> That is where the search and replace commands normally are. Why do you
>> doubt they should be there?
>
> The `Grep' menu entry is traditionally in the Tools menu because it reads
> an external command like `Compile' and `Shell Command' do.  So perhaps we
> should add `rgrep' and `lgrep' to the Tools menu.

I think menus should see things from the users view, not from an
internal view. Emacs itself does not really care how the menus look
...

I would expect nearly all users to look for these commands in the Edit menu.






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#1863: Improved grep prompt
  2009-01-16  0:31               ` Juri Linkov
  2009-01-16  0:54                 ` Lennart Borgman
@ 2009-01-16  9:27                 ` richardeng
  1 sibling, 0 replies; 13+ messages in thread
From: richardeng @ 2009-01-16  9:27 UTC (permalink / raw)
  To: Juri Linkov, 1863; +Cc: jidanni

[-- Attachment #1: Type: text/plain, Size: 2465 bytes --]

Juri Linkov wrote:
>>>> In your case I myself see nothing that can help then ;-) but I think
>>>> newbees would benefit from having all the search and replace commands
>>>> under search and replace in the edit menu.
>>>>         
>>> I can't believe we still don't have these useful commands in the menu.
>>> But why do you think they should be placed in the Edit menu?
>>>       
>> That is where the search and replace commands normally are. Why do you
>> doubt they should be there?
>>     
>
> The `Grep' menu entry is traditionally in the Tools menu because it reads
> an external command like `Compile' and `Shell Command' do.  So perhaps we
> should add `rgrep' and `lgrep' to the Tools menu.
>
> A less controversial change is to add `rgrep' and `lgrep' to the
> grep mode menu:
>
> Index: lisp/progmodes/grep.el
> ===================================================================
> RCS file: /sources/emacs/emacs/lisp/progmodes/grep.el,v
> retrieving revision 1.98
> diff -u -r1.98 grep.el
> --- lisp/progmodes/grep.el	5 Jan 2009 03:23:37 -0000	1.98
> +++ lisp/progmodes/grep.el	16 Jan 2009 00:27:48 -0000
> @@ -204,12 +204,18 @@
>      (define-key map [menu-bar grep compilation-compile]
>        '(menu-item "Compile..." compile
>  		  :help "Compile the program including the current buffer.  Default: run `make'"))
> +    (define-key map [menu-bar grep compilation-lgrep]
> +      '(menu-item "Local grep..." lgrep
> +		  :help "User-friendly grep"))
> +    (define-key map [menu-bar grep compilation-rgrep]
> +      '(menu-item "Recursive grep..." rgrep
> +		  :help "User-friendly recursive grep in directory tree"))
> +    (define-key map [menu-bar grep compilation-grep-find]
> +      '(menu-item "Grep via Find..." grep-find
> +		  :help "Run grep via find, with user-specified args"))
>      (define-key map [menu-bar grep compilation-grep]
>        '(menu-item "Another grep..." grep
>  		  :help "Run grep, with user-specified args, and collect output in a buffer."))
> -    (define-key map [menu-bar grep compilation-grep-find]
> -      '(menu-item "Recursive grep..." grep-find
> -		  :help "Run grep via find, with user-specified args"))
>      (define-key map [menu-bar grep compilation-recompile]
>        '(menu-item "Repeat grep" recompile
>  		  :help "Run grep again"))
>
>   
I think many emacs users discovery useful command from the menu instead 
of  searching the release notes.
I suggest to add rgrep,lgrep,grep-find to menu.



[-- Attachment #2: Type: text/html, Size: 2923 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#1863: Improved grep prompt
  2009-01-14  1:18 ` Juri Linkov
  2009-01-14  1:33   ` jidanni
@ 2018-04-15 22:12   ` Lars Ingebrigtsen
  1 sibling, 0 replies; 13+ messages in thread
From: Lars Ingebrigtsen @ 2018-04-15 22:12 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 1863, jidanni

Juri Linkov <juri@jurta.org> writes:

>> Regarding M-x grep, here are the current and improved prompts:
>> Run grep (like this): grep -nH -e
>> Run grep (like this): grep -nH -e [Cursor goes here] * <--and an asterisk here. I.e., @=cursor:
>> Run grep (like this): grep -nH -e @ *
>> If you use my improved prompt suggestion above, no longer will
>> everybody forget to add a filename, and leave thinking "no matches found".
>
> Everybody's using rgrep and lgrep these days and never forget a filename ;-)

It seemed like nobody were enthusiastic about adding such a fix, so I'm
closing this as a "wontfix".

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





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-04-15 22:12 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-12  2:07 bug#1863: Improved grep prompt jidanni
2009-01-14  1:18 ` Juri Linkov
2009-01-14  1:33   ` jidanni
2009-01-14 23:52     ` Juri Linkov
2009-01-15  0:40       ` jidanni
2009-01-15  1:09         ` Lennart Borgman
2009-01-15  1:27           ` Juri Linkov
2009-01-15  1:55             ` Lennart Borgman
2009-01-16  0:31               ` Juri Linkov
2009-01-16  0:54                 ` Lennart Borgman
2009-01-16  9:27                 ` richardeng
2009-01-15  2:54         ` Stefan Monnier
2018-04-15 22:12   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).