unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Add lgrep/rgrep commands to Edit > Search submenu
@ 2009-01-24 20:45 Kim F. Storm
  2009-01-24 21:09 ` Dan Nicolaescu
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Kim F. Storm @ 2009-01-24 20:45 UTC (permalink / raw)
  To: emacs-devel


I know about Tools > Grep - but that is for advanced users and not
really suited for a "novice user" menu command.

IMO, lgrep and rgrep are much better suited as menu commands,
and they would logically fit very well on
 Edit > Search > Search Files... 
 Edit > Search > Search Files Recurse...

We may remove the standard grep from Tools - or keep it as
a more advanced/low-level interface.

WDYT ?

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk





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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-24 20:45 Add lgrep/rgrep commands to Edit > Search submenu Kim F. Storm
@ 2009-01-24 21:09 ` Dan Nicolaescu
  2009-01-25  0:57   ` Juri Linkov
  2009-01-25  0:55 ` Juri Linkov
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 25+ messages in thread
From: Dan Nicolaescu @ 2009-01-24 21:09 UTC (permalink / raw)
  To: Kim F. Storm; +Cc: emacs-devel

storm@cua.dk (Kim F. Storm) writes:

  > I know about Tools > Grep - but that is for advanced users and not
  > really suited for a "novice user" menu command.
  > 
  > IMO, lgrep and rgrep are much better suited as menu commands,
  > and they would logically fit very well on
  >  Edit > Search > Search Files... 
  >  Edit > Search > Search Files Recurse...
  > 
  > We may remove the standard grep from Tools - or keep it as
  > a more advanced/low-level interface.
  > 
  > WDYT ?

IMHO doing that would be extremely useful.

And the Grep mode menu should also have lgrep and rgrep entries.




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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-24 20:45 Add lgrep/rgrep commands to Edit > Search submenu Kim F. Storm
  2009-01-24 21:09 ` Dan Nicolaescu
@ 2009-01-25  0:55 ` Juri Linkov
  2009-01-25  1:04   ` Lennart Borgman
  2009-01-25 18:14   ` Richard M Stallman
  2009-01-25 18:30 ` Chong Yidong
  2009-01-25 19:04 ` Gilaras Drakeson
  3 siblings, 2 replies; 25+ messages in thread
From: Juri Linkov @ 2009-01-25  0:55 UTC (permalink / raw)
  To: Kim F. Storm; +Cc: emacs-devel

> I know about Tools > Grep - but that is for advanced users and not
> really suited for a "novice user" menu command.
>
> IMO, lgrep and rgrep are much better suited as menu commands,
> and they would logically fit very well on
>  Edit > Search > Search Files...
>  Edit > Search > Search Files Recurse...
>
> We may remove the standard grep from Tools - or keep it as
> a more advanced/low-level interface.
>
> WDYT ?

Maybe a menu structure like this?

Edit > Search > Search Files > Grep...
Edit > Search > Search Files > Grep via Find...
Edit > Search > Search Files > Local grep...
Edit > Search > Search Files > Recursive grep...

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




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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-24 21:09 ` Dan Nicolaescu
@ 2009-01-25  0:57   ` Juri Linkov
  0 siblings, 0 replies; 25+ messages in thread
From: Juri Linkov @ 2009-01-25  0:57 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: emacs-devel, Kim F. Storm

>   > I know about Tools > Grep - but that is for advanced users and not
>   > really suited for a "novice user" menu command.
>   >
>   > IMO, lgrep and rgrep are much better suited as menu commands,
>   > and they would logically fit very well on
>   >  Edit > Search > Search Files...
>   >  Edit > Search > Search Files Recurse...
>   >
>   > We may remove the standard grep from Tools - or keep it as
>   > a more advanced/low-level interface.
>   >
>   > WDYT ?
>
> IMHO doing that would be extremely useful.
>
> And the Grep mode menu should also have lgrep and rgrep entries.

I installed a patch from bug#1863 for the Grep mode menu.

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




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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-25  0:55 ` Juri Linkov
@ 2009-01-25  1:04   ` Lennart Borgman
  2009-01-25 18:14   ` Richard M Stallman
  1 sibling, 0 replies; 25+ messages in thread
From: Lennart Borgman @ 2009-01-25  1:04 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel, Kim F. Storm

On Sun, Jan 25, 2009 at 1:55 AM, Juri Linkov <juri@jurta.org> wrote:
> Maybe a menu structure like this?
>
> Edit > Search > Search Files > Grep...
> Edit > Search > Search Files > Grep via Find...
> Edit > Search > Search Files > Local grep...
> Edit > Search > Search Files > Recursive grep...

Why not just rgrep and lgrep? You can edit those later with just
`grep' if you want to.




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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-25  0:55 ` Juri Linkov
  2009-01-25  1:04   ` Lennart Borgman
@ 2009-01-25 18:14   ` Richard M Stallman
  2009-01-25 21:30     ` Lennart Borgman
  2009-01-25 21:33     ` Juri Linkov
  1 sibling, 2 replies; 25+ messages in thread
From: Richard M Stallman @ 2009-01-25 18:14 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel, storm

    Maybe a menu structure like this?

    Edit > Search > Search Files > Grep...
    Edit > Search > Search Files > Grep via Find...
    Edit > Search > Search Files > Local grep...
    Edit > Search > Search Files > Recursive grep...

Menus three levels deep are a pain to invoke.




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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-24 20:45 Add lgrep/rgrep commands to Edit > Search submenu Kim F. Storm
  2009-01-24 21:09 ` Dan Nicolaescu
  2009-01-25  0:55 ` Juri Linkov
@ 2009-01-25 18:30 ` Chong Yidong
  2009-01-25 19:22   ` Kim F. Storm
                     ` (2 more replies)
  2009-01-25 19:04 ` Gilaras Drakeson
  3 siblings, 3 replies; 25+ messages in thread
From: Chong Yidong @ 2009-01-25 18:30 UTC (permalink / raw)
  To: Kim F. Storm; +Cc: emacs-devel

storm@cua.dk (Kim F. Storm) writes:

> IMO, lgrep and rgrep are much better suited as menu commands,
> and they would logically fit very well on
>  Edit > Search > Search Files... 
>  Edit > Search > Search Files Recurse...
>
> We may remove the standard grep from Tools - or keep it as
> a more advanced/low-level interface.

Conceptually, the grep commands are not a good fit for the Edit menu.
The Edit menu contains commands that act on the current buffer; the
Tools menu contains commands that do fancier stuff like operating on
multiple files.  So, even though Isearch and Grep are both "search
commands", I don't think it's good to consolidate them on the menu bar.




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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-24 20:45 Add lgrep/rgrep commands to Edit > Search submenu Kim F. Storm
                   ` (2 preceding siblings ...)
  2009-01-25 18:30 ` Chong Yidong
@ 2009-01-25 19:04 ` Gilaras Drakeson
  2009-01-25 21:47   ` Juri Linkov
  3 siblings, 1 reply; 25+ messages in thread
From: Gilaras Drakeson @ 2009-01-25 19:04 UTC (permalink / raw)
  To: emacs-devel

storm@cua.dk (Kim F. Storm) writes:

> I know about Tools > Grep - but that is for advanced users and not
> really suited for a "novice user" menu command.
>
> IMO, lgrep and rgrep are much better suited as menu commands,
> and they would logically fit very well on
>  Edit > Search > Search Files... 
>  Edit > Search > Search Files Recurse...
>
> We may remove the standard grep from Tools - or keep it as
> a more advanced/low-level interface.
>
> WDYT ?

Additionally, how about having a key for rgrep (and lgrep, too)?  For
instance, how about C-x d for rgrep? (Assuming C-x C-f effectively
obsoletes M-x dired)

--
Gilaras

P.S.: Also, how about binding "C-x C-d" to find-dired.





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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-25 18:30 ` Chong Yidong
@ 2009-01-25 19:22   ` Kim F. Storm
  2009-01-25 21:37     ` Juri Linkov
  2009-01-26  1:54     ` Stefan Monnier
  2009-01-25 20:00   ` Drew Adams
  2009-01-25 21:33   ` Lennart Borgman
  2 siblings, 2 replies; 25+ messages in thread
From: Kim F. Storm @ 2009-01-25 19:22 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

> storm@cua.dk (Kim F. Storm) writes:
>
>> IMO, lgrep and rgrep are much better suited as menu commands,
>> and they would logically fit very well on
>>  Edit > Search > Search Files... 
>>  Edit > Search > Search Files Recurse...
>>
>> We may remove the standard grep from Tools - or keep it as
>> a more advanced/low-level interface.
>
> Conceptually, the grep commands are not a good fit for the Edit menu.
> The Edit menu contains commands that act on the current buffer; the
> Tools menu contains commands that do fancier stuff like operating on
> multiple files.  So, even though Isearch and Grep are both "search
> commands", I don't think it's good to consolidate them on the menu bar.

Then, why is "search tagged files" on Edit > Search ?

I want to search for abc - starting in the current buffer, so I use
Edit > Search > ...  - and then realize that I would like to search
through other buffer or files - so I again use Edit > Search > ...
and find nothing useful.

I find lgrep / rgrep rather useful as an editing tool -- but parhaps
that is because I have the "replace grep match" add-on which I find is
one of the most efficient extensions to emacs (it was rejected last time
I proposed this - so I'm not going to propose it again).


;;; grep-x.el -- search and replace interface using grep output.

(defun grep-goto-error-no-select ()
  "Display currently grep match in other window."
  (interactive)
  (save-selected-window
    (compile-goto-error)))

(defvar grep-last-replace-string nil)

(defun grep-replace-match-internal ()
  (when compilation-highlight-overlay
    (let ((start (overlay-start compilation-highlight-overlay)))
      (goto-char start)
      (undo-boundary)
      (save-match-data
	(search-forward (buffer-substring-no-properties start (overlay-end compilation-highlight-overlay)))
	(replace-match grep-last-replace-string))
      (move-overlay compilation-highlight-overlay start (point)))))

(defun grep-replace-match (string)
  "Replace current grep match with string STRING."
  (interactive "sReplace with: ")
  (save-selected-window
    (setq grep-last-replace-string string)
    (let ((next-error-highlight
	   (if (numberp next-error-highlight) next-error-highlight 0.01))
	  (next-error-hook '(grep-replace-match-internal)))
      (compile-goto-error))))

(defun grep-repeat-replace-match ()
  "Replace current grep match with last match replace string."
  (interactive)
  (if (not grep-last-replace-string)
      (call-interactively 'grep-replace-match)
    (grep-replace-match grep-last-replace-string)))



(define-key grep-mode-map "o" 'grep-goto-error-no-select)
(define-key grep-mode-map "/" 'grep-replace-match)
(define-key grep-mode-map "." 'grep-repeat-replace-match)

(provide 'grep-x)

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk





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

* RE: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-25 18:30 ` Chong Yidong
  2009-01-25 19:22   ` Kim F. Storm
@ 2009-01-25 20:00   ` Drew Adams
  2009-01-25 21:45     ` Juri Linkov
  2009-01-25 21:33   ` Lennart Borgman
  2 siblings, 1 reply; 25+ messages in thread
From: Drew Adams @ 2009-01-25 20:00 UTC (permalink / raw)
  To: 'Chong Yidong', 'Kim F. Storm'; +Cc: emacs-devel

> > IMO, lgrep and rgrep are much better suited as menu commands,
> > and they would logically fit very well on
> >  Edit > Search > Search Files... 
> >  Edit > Search > Search Files Recurse...
> >
> > We may remove the standard grep from Tools - or keep it as
> > a more advanced/low-level interface.
> 
> Conceptually, the grep commands are not a good fit for the Edit menu.
> The Edit menu contains commands that act on the current buffer; the
> Tools menu contains commands that do fancier stuff like operating on
> multiple files.  So, even though Isearch and Grep are both "search
> commands", I don't think it's good to consolidate them on the 
> menu bar.

All search stuff should be together, in a Search menu. That includes things like
grep and occur.

It doesn't matter much whether Search is a submenu of the Edit menu or the Tools
menu. However, one reason to not put Search under Edit could be that some modes
might want to remove Edit but keep search stuff.

Personally, I put the Search menu at the top level. And I include as submenus of
Search things like replace, tags, bookmarks, and goto. Those are all
search-like, IMO.
 
FWIW, I also agree with Kim's suggestion (on the bug list) to move Options from
the top level. I'd sooner see Options under Edit, and Search at the top level.
Or both under Edit. Or Options under Edit and Search under Tools.

Typical places for setting preferences are under Edit or File. Moving Options
from the top level to Edit or File would obviate some of the problems (e.g.
currently, for GNUS, in the bug list) for menu-bar space. And users would still
have no problem finding Options - they do so for other apps (Options typically
being called something like Preferences, Settings, or Configure Settings).






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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-25 18:14   ` Richard M Stallman
@ 2009-01-25 21:30     ` Lennart Borgman
  2009-01-25 21:33     ` Juri Linkov
  1 sibling, 0 replies; 25+ messages in thread
From: Lennart Borgman @ 2009-01-25 21:30 UTC (permalink / raw)
  To: rms; +Cc: Juri Linkov, storm, emacs-devel

On Sun, Jan 25, 2009 at 7:14 PM, Richard M Stallman <rms@gnu.org> wrote:
>    Maybe a menu structure like this?
>
>    Edit > Search > Search Files > Grep...
>    Edit > Search > Search Files > Grep via Find...
>    Edit > Search > Search Files > Local grep...
>    Edit > Search > Search Files > Recursive grep...
>
> Menus three levels deep are a pain to invoke.

But in this case it is more an announcement of these commands.




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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-25 18:30 ` Chong Yidong
  2009-01-25 19:22   ` Kim F. Storm
  2009-01-25 20:00   ` Drew Adams
@ 2009-01-25 21:33   ` Lennart Borgman
  2 siblings, 0 replies; 25+ messages in thread
From: Lennart Borgman @ 2009-01-25 21:33 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel, Kim F. Storm

On Sun, Jan 25, 2009 at 7:30 PM, Chong Yidong <cyd@stupidchicken.com> wrote:
> Conceptually, the grep commands are not a good fit for the Edit menu.
> The Edit menu contains commands that act on the current buffer; the
> Tools menu contains commands that do fancier stuff like operating on
> multiple files.  So, even though Isearch and Grep are both "search
> commands", I don't think it's good to consolidate them on the menu bar.

I think most users thinks "search" as the main conception.




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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-25 18:14   ` Richard M Stallman
  2009-01-25 21:30     ` Lennart Borgman
@ 2009-01-25 21:33     ` Juri Linkov
  1 sibling, 0 replies; 25+ messages in thread
From: Juri Linkov @ 2009-01-25 21:33 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel, storm

>     Maybe a menu structure like this?
>
>     Edit > Search > Search Files > Grep...
>     Edit > Search > Search Files > Grep via Find...
>     Edit > Search > Search Files > Local grep...
>     Edit > Search > Search Files > Recursive grep...
>
> Menus three levels deep are a pain to invoke.

Incremental Search menu items are on the same depth,
but I guess there is no problem with them because
no one runs them from the menu since they have
more convenient key bindings, and menu items only
serve as tips for novices.  If grep commands had
own key bindings more convenient for running than
menu items then maybe there will be no problem with
deep menu levels.

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




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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-25 19:22   ` Kim F. Storm
@ 2009-01-25 21:37     ` Juri Linkov
  2009-01-25 22:43       ` Kim F. Storm
  2009-01-26  1:54     ` Stefan Monnier
  1 sibling, 1 reply; 25+ messages in thread
From: Juri Linkov @ 2009-01-25 21:37 UTC (permalink / raw)
  To: Kim F. Storm; +Cc: Chong Yidong, emacs-devel

> I find lgrep / rgrep rather useful as an editing tool -- but parhaps
> that is because I have the "replace grep match" add-on which I find is
> one of the most efficient extensions to emacs (it was rejected last time
> I proposed this - so I'm not going to propose it again).
>
> ;;; grep-x.el -- search and replace interface using grep output.

I guess the problem with grep-x.el is that it doesn't provide a familiar
user interface like in query-replace.  Maybe a better interface would be
using tags-query-replace with a list of files grep matched?

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




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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-25 20:00   ` Drew Adams
@ 2009-01-25 21:45     ` Juri Linkov
  2009-01-26  4:09       ` Eli Zaretskii
  0 siblings, 1 reply; 25+ messages in thread
From: Juri Linkov @ 2009-01-25 21:45 UTC (permalink / raw)
  To: Drew Adams; +Cc: 'Chong Yidong', emacs-devel, 'Kim F. Storm'

> All search stuff should be together, in a Search menu. That includes things like
> grep and occur.
>
> It doesn't matter much whether Search is a submenu of the Edit menu or the Tools
> menu. However, one reason to not put Search under Edit could be that some modes
> might want to remove Edit but keep search stuff.
>
> Personally, I put the Search menu at the top level. And I include as submenus of
> Search things like replace, tags, bookmarks, and goto. Those are all
> search-like, IMO.

I think this is a good idea because currently even "Go To" submenu
contains search commands like "Find Tag", "Tags Apropos".

> FWIW, I also agree with Kim's suggestion (on the bug list) to move Options from
> the top level. I'd sooner see Options under Edit, and Search at the top level.
> Or both under Edit. Or Options under Edit and Search under Tools.
>
> Typical places for setting preferences are under Edit or File. Moving Options
> from the top level to Edit or File would obviate some of the problems (e.g.
> currently, for GNUS, in the bug list) for menu-bar space. And users would still
> have no problem finding Options - they do so for other apps (Options typically
> being called something like Preferences, Settings, or Configure Settings).

What is interesting is that Firefox has the Preferences item
under Edit on GNU/Linux, but under Tools on Windows.

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




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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-25 19:04 ` Gilaras Drakeson
@ 2009-01-25 21:47   ` Juri Linkov
  2009-01-25 22:49     ` Kim F. Storm
  0 siblings, 1 reply; 25+ messages in thread
From: Juri Linkov @ 2009-01-25 21:47 UTC (permalink / raw)
  To: Gilaras Drakeson; +Cc: emacs-devel

> Additionally, how about having a key for rgrep (and lgrep, too)?  For
> instance, how about C-x d for rgrep? (Assuming C-x C-f effectively
> obsoletes M-x dired)

Of course, removing old bindings is no-no, but fortunately we have
a spare key prefix map M-g for grep commands.

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




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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-25 21:37     ` Juri Linkov
@ 2009-01-25 22:43       ` Kim F. Storm
  0 siblings, 0 replies; 25+ messages in thread
From: Kim F. Storm @ 2009-01-25 22:43 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Chong Yidong, emacs-devel

Juri Linkov <juri@jurta.org> writes:

>> I find lgrep / rgrep rather useful as an editing tool -- but parhaps
>> that is because I have the "replace grep match" add-on which I find is
>> one of the most efficient extensions to emacs (it was rejected last time
>> I proposed this - so I'm not going to propose it again).
>>
>> ;;; grep-x.el -- search and replace interface using grep output.
>
> I guess the problem with grep-x.el is that it doesn't provide a familiar
> user interface like in query-replace.  Maybe a better interface would be
> using tags-query-replace with a list of files grep matched?

That's a nice idea - I'll take a look at it.

But if you ever used "vi", the n="next match", .="repeat last change" is a 
very familiar interface .... one that I really miss in Emacs :-)

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk





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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-25 21:47   ` Juri Linkov
@ 2009-01-25 22:49     ` Kim F. Storm
  2009-01-26  0:42       ` Dan Nicolaescu
  2009-01-26 23:48       ` Juri Linkov
  0 siblings, 2 replies; 25+ messages in thread
From: Kim F. Storm @ 2009-01-25 22:49 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel, Gilaras Drakeson

Juri Linkov <juri@jurta.org> writes:

>> Additionally, how about having a key for rgrep (and lgrep, too)?  For
>> instance, how about C-x d for rgrep? (Assuming C-x C-f effectively
>> obsoletes M-x dired)
>
> Of course, removing old bindings is no-no, but fortunately we have
> a spare key prefix map M-g for grep commands.

Nice idea:

M-g l => lgrep
M-g r => rgrep
M-g f -> grep-find
M-g e -> grep


Only _really_ annoying issue is that gnus has rebound M-g, 
taking away this useful prefix.  I'm hit by that very frequently.

Alternatively, C-x g is also unbound - so we could use that 
as a general grep/search prefix instead of M-g.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk





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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-25 22:49     ` Kim F. Storm
@ 2009-01-26  0:42       ` Dan Nicolaescu
  2009-01-26 23:52         ` Juri Linkov
  2009-01-26 23:48       ` Juri Linkov
  1 sibling, 1 reply; 25+ messages in thread
From: Dan Nicolaescu @ 2009-01-26  0:42 UTC (permalink / raw)
  To: Kim F. Storm; +Cc: Juri Linkov, Gilaras Drakeson, emacs-devel

storm@cua.dk (Kim F. Storm) writes:

  > Juri Linkov <juri@jurta.org> writes:
  > 
  > >> Additionally, how about having a key for rgrep (and lgrep, too)?  For
  > >> instance, how about C-x d for rgrep? (Assuming C-x C-f effectively
  > >> obsoletes M-x dired)
  > >
  > > Of course, removing old bindings is no-no, but fortunately we have
  > > a spare key prefix map M-g for grep commands.
  > 
  > Nice idea:
  > 
  > M-g l => lgrep
  > M-g r => rgrep

These are nice

  > M-g f -> grep-find
  > M-g e -> grep

But these don't seem very useful for most users given the 2 above, if
the user really really knows he wants to use these, they know how to do
their own bindings.  And we don't want to spend to use too many key
bindings for "grep" related things, there might be other useful things
to bind.

Just my 2 cents.




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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-25 19:22   ` Kim F. Storm
  2009-01-25 21:37     ` Juri Linkov
@ 2009-01-26  1:54     ` Stefan Monnier
  1 sibling, 0 replies; 25+ messages in thread
From: Stefan Monnier @ 2009-01-26  1:54 UTC (permalink / raw)
  To: Kim F. Storm; +Cc: Chong Yidong, emacs-devel

> I find lgrep / rgrep rather useful as an editing tool -- but perhaps
> that is because I have the "replace grep match" add-on which I find is
> one of the most efficient extensions to Emacs (it was rejected last time
> I proposed this - so I'm not going to propose it again).

I can't remember seeing it discussed, but it looks pretty neat.  I don't
use lgrep/rgrep myself, but it looks like it'll work with `grep' just
fine, which I do use regularly.

Being in feature freeze, we're not going to integrate it now, and we may
want to tweak the UI a bit, but I like the idea.
It's a bit inconvenient that it relies on GNU grep's match-highlight,
and I wonder what happens with other grep implementations.


        Stefan


PS: a related functionality would be all.el's ability to edit the *grep*
buffer and have the modifications be immediately reflected in the
corresponding buffers.




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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-25 21:45     ` Juri Linkov
@ 2009-01-26  4:09       ` Eli Zaretskii
  0 siblings, 0 replies; 25+ messages in thread
From: Eli Zaretskii @ 2009-01-26  4:09 UTC (permalink / raw)
  To: Juri Linkov; +Cc: cyd, storm, drew.adams, emacs-devel

> From: Juri Linkov <juri@jurta.org>
> Date: Sun, 25 Jan 2009 23:45:03 +0200
> Cc: 'Chong Yidong' <cyd@stupidchicken.com>, emacs-devel@gnu.org,
> 	"'Kim F. Storm'" <storm@cua.dk>
> 
> > All search stuff should be together, in a Search menu. That includes things like
> > grep and occur.
> >
> > It doesn't matter much whether Search is a submenu of the Edit menu or the Tools
> > menu. However, one reason to not put Search under Edit could be that some modes
> > might want to remove Edit but keep search stuff.
> >
> > Personally, I put the Search menu at the top level. And I include as submenus of
> > Search things like replace, tags, bookmarks, and goto. Those are all
> > search-like, IMO.
> 
> I think this is a good idea because currently even "Go To" submenu
> contains search commands like "Find Tag", "Tags Apropos".

Please, let's not discuss menu bar changes before Emacs 23.1 is
released.




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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-25 22:49     ` Kim F. Storm
  2009-01-26  0:42       ` Dan Nicolaescu
@ 2009-01-26 23:48       ` Juri Linkov
  1 sibling, 0 replies; 25+ messages in thread
From: Juri Linkov @ 2009-01-26 23:48 UTC (permalink / raw)
  To: Kim F. Storm; +Cc: emacs-devel, Gilaras Drakeson

> Only _really_ annoying issue is that gnus has rebound M-g,
> taking away this useful prefix.  I'm hit by that very frequently.

`M-g' is bound to `gnus-summary-rescan-group' in Gnus,
but usually rescanning is bound to `g' in other modes.

> Alternatively, C-x g is also unbound - so we could use that
> as a general grep/search prefix instead of M-g.

Or vice versa - to bind gnus commands to `C-x g'.

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




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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-26  0:42       ` Dan Nicolaescu
@ 2009-01-26 23:52         ` Juri Linkov
  2009-01-27  0:48           ` Drew Adams
  2009-01-27 17:40           ` Kim F. Storm
  0 siblings, 2 replies; 25+ messages in thread
From: Juri Linkov @ 2009-01-26 23:52 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: Gilaras Drakeson, emacs-devel, Kim F. Storm

>   > Nice idea:
>   >
>   > M-g l => lgrep
>   > M-g r => rgrep
>
> These are nice
>
>   > M-g f -> grep-find
>   > M-g e -> grep
>
> But these don't seem very useful for most users given the 2 above, if
> the user really really knows he wants to use these, they know how to do
> their own bindings.  And we don't want to spend to use too many key
> bindings for "grep" related things, there might be other useful things
> to bind.

I agree, we should keep more key prefixes for other useful things.
So we can use only one prefix `M-g r' for all grep commands:

M-g r e         grep
M-g r l         lgrep
M-g r r         rgrep
M-g r f         grep-find

M-g M-r M-e     grep
M-g M-r M-l     lgrep
M-g M-r M-r     rgrep
M-g M-r M-f     grep-find

All these key sequences are easy to type.

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




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

* RE: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-26 23:52         ` Juri Linkov
@ 2009-01-27  0:48           ` Drew Adams
  2009-01-27 17:40           ` Kim F. Storm
  1 sibling, 0 replies; 25+ messages in thread
From: Drew Adams @ 2009-01-27  0:48 UTC (permalink / raw)
  To: 'Juri Linkov', 'Dan Nicolaescu'
  Cc: emacs-devel, 'Kim F. Storm', 'Gilaras Drakeson'

> I agree, we should keep more key prefixes for other useful things.
> So we can use only one prefix `M-g r' for all grep commands:
> 
> M-g r e         grep
> M-g r l         lgrep
> M-g r r         rgrep
> M-g r f         grep-find
> 
> M-g M-r M-e     grep
> M-g M-r M-l     lgrep
> M-g M-r M-r     rgrep
> M-g M-r M-f     grep-find
> 
> All these key sequences are easy to type.

I don't really care one way or the other, but my reaction is this:

What's wrong with `M-x grep' and so on? Seems easier to remember and nearly as
easy to type. Especially with TAB completion: `M-x lg TAB' (4 chars) vs `M-g r
l' (3 chars). Is the keystroke savings really worth it?

On the other hand (as I've suggested before), it makes sense to have a binding
such as `g' in the *grep* buffer that calls up the last `grep' etc. command
again. Currently, `g' runs `recompile' in *grep*. (Or you could have bindings
`g', `l', `r', and `f' for the various grep flavors, and remember the previous
command of each grep flavor.)

Ignore this, if you feel strongly about it.





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

* Re: Add lgrep/rgrep commands to Edit > Search submenu
  2009-01-26 23:52         ` Juri Linkov
  2009-01-27  0:48           ` Drew Adams
@ 2009-01-27 17:40           ` Kim F. Storm
  1 sibling, 0 replies; 25+ messages in thread
From: Kim F. Storm @ 2009-01-27 17:40 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Gilaras Drakeson, Dan Nicolaescu, emacs-devel

Juri Linkov <juri@jurta.org> writes:

>>   > Nice idea:
>>   >
>>   > M-g l => lgrep
>>   > M-g r => rgrep
>>
>> These are nice
>>
>>   > M-g f -> grep-find
>>   > M-g e -> grep
>>
>> But these don't seem very useful for most users given the 2 above, if
>> the user really really knows he wants to use these, they know how to do
>> their own bindings.  And we don't want to spend to use too many key
>> bindings for "grep" related things, there might be other useful things
>> to bind.
>
> I agree, we should keep more key prefixes for other useful things.
> So we can use only one prefix `M-g r' for all grep commands:
>
> M-g r e         grep
> M-g r l         lgrep
> M-g r r         rgrep
> M-g r f         grep-find

Those are only marginally shorter than M-x gr RET, M-x lg RET, M-x rg RET

I think we should leave this alone ....  Users can bind them as they like.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk





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

end of thread, other threads:[~2009-01-27 17:40 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-24 20:45 Add lgrep/rgrep commands to Edit > Search submenu Kim F. Storm
2009-01-24 21:09 ` Dan Nicolaescu
2009-01-25  0:57   ` Juri Linkov
2009-01-25  0:55 ` Juri Linkov
2009-01-25  1:04   ` Lennart Borgman
2009-01-25 18:14   ` Richard M Stallman
2009-01-25 21:30     ` Lennart Borgman
2009-01-25 21:33     ` Juri Linkov
2009-01-25 18:30 ` Chong Yidong
2009-01-25 19:22   ` Kim F. Storm
2009-01-25 21:37     ` Juri Linkov
2009-01-25 22:43       ` Kim F. Storm
2009-01-26  1:54     ` Stefan Monnier
2009-01-25 20:00   ` Drew Adams
2009-01-25 21:45     ` Juri Linkov
2009-01-26  4:09       ` Eli Zaretskii
2009-01-25 21:33   ` Lennart Borgman
2009-01-25 19:04 ` Gilaras Drakeson
2009-01-25 21:47   ` Juri Linkov
2009-01-25 22:49     ` Kim F. Storm
2009-01-26  0:42       ` Dan Nicolaescu
2009-01-26 23:52         ` Juri Linkov
2009-01-27  0:48           ` Drew Adams
2009-01-27 17:40           ` Kim F. Storm
2009-01-26 23:48       ` Juri Linkov

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).