emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Add M-x occur to the menu-bar


From: Kevin Rodgers
Subject: Re: Add M-x occur to the menu-bar
Date: Thu, 18 Sep 2003 11:10:23 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Marshall, Simon wrote:

I think M-x grep and M-x occur should have as similar a UI as possible.


I'm not sure I agree: grep is for searching many files (external to
Emacs) and occur is for searching a single buffer (internal to Emacs).

I've always found it baffling that if you are in a *grep* buffer you get
a Compile menu with entries like "Next Error" to go to the next match.
I've always found it annoying that C-x ` works for *grep* but not for
*Occur*.  (I guess M-x grep is closer to M-x compile for historical
implementation reasons.)


Not that C-x ` works in all buffers, not just the *grep* buffer.  Making
*Occur* buffers just like *grep* and *compilation* buffers would be a
lot of work, but if you just want C-x ` to "do the right thing" in
*Occur* buffers, try this patch:

*** emacs-21.3/lisp/replace.el.orig     Fri Oct 18 19:21:09 2002
--- emacs-21.3/lisp/replace.el  Thu Sep 18 10:51:12 2003
***************
*** 421,426 ****
--- 421,427 ----
      (define-key map "\C-c\C-c" 'occur-mode-goto-occurrence)
      (define-key map "\C-m" 'occur-mode-goto-occurrence)
      (define-key map "\M-n" 'occur-next)
+     (define-key map "\C-x`" 'occur-next) ; override global binding
      (define-key map "\M-p" 'occur-prev)
      (define-key map "g" 'revert-buffer)
      map)

--
Kevin Rodgers






reply via email to

[Prev in Thread] Current Thread [Next in Thread]