emacs-devel
[Top][All Lists]
Advanced

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

Re: *Occur in buf*?


From: Sam Steingold
Subject: Re: *Occur in buf*?
Date: 25 Jul 2002 09:42:16 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> * In message <address@hidden>
> * On the subject of "*Occur in buf*?"
> * Sent on Thu, 25 Jul 2002 11:05:41 +0100
> * Honorable "Marshall, Simon" <address@hidden> writes:
>
> IWBNI M-x occur created an *Occur in buf* buffer so that I wouldn't have
> to do this, rather than *Occur*.

I like your idea.
unless there are objections, I will install the appended patch.

(the key bindings are slightly changed too).

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
A poet who reads his verse in public may have other nasty habits.


--- replace.el.~1.152.~ Fri Jul 19 04:11:46 2002
+++ replace.el  Thu Jul 25 09:40:06 2002
@@ -453,7 +453,8 @@
     (define-key map "\M-n" 'occur-next)
     (define-key map "\M-p" 'occur-prev)
     (define-key map "g" 'revert-buffer)
-    (define-key map "q" 'delete-window)
+    (define-key map "q" 'quit-window)
+    (define-key map "z" 'kill-this-buffer)
     map)
   "Keymap for `occur-mode'.")
 
@@ -633,14 +634,15 @@
 NLINES defaults to `list-matching-lines-default-context-lines'.
 Interactively it is the prefix arg.
 
-The lines are shown in a buffer named `*Occur*'.
+The lines are shown in a buffer named `*Occur:buf-name*'.
 It serves as a menu to find any of the occurrences in this buffer.
 \\<occur-mode-map>\\[describe-mode] in that buffer will explain how.
 
 If REGEXP contains upper case characters (excluding those preceded by `\\'),
 the matching is case-sensitive."
   (interactive (occur-read-primary-args))
-  (occur-1 regexp nlines (list (current-buffer))))
+  (occur-1 regexp nlines (list (current-buffer))
+           (concat "*Occur:" (buffer-name) "*")))
 
 (defun multi-occur (bufs regexp &optional nlines)
   "Show all lines in buffers BUFS containing a match for REGEXP.
@@ -658,7 +660,8 @@
        (push buf bufs))
       (nreverse (mapcar #'get-buffer bufs)))
     (occur-read-primary-args)))
-  (occur-1 regexp nlines bufs))
+  (occur-1 regexp nlines bufs
+           (concat "*Occur:" (mapconcat #'buffer-name bufs "/") "*")))
 
 (defun multi-occur-by-filename-regexp (bufregexp regexp &optional nlines)
   "Show all lines matching REGEXP in buffers named by BUFREGEXP.
@@ -685,7 +688,8 @@
                                        (string-match bufregexp
                                                      (buffer-file-name buf)))
                               buf))
-                          (buffer-list))))))
+                          (buffer-list)))
+             (concat "*Occur:" regexp "*"))))
 
 (defun occur-1 (regexp nlines bufs &optional buf-name)
   (unless buf-name




reply via email to

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