From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Sam Steingold Newsgroups: gmane.emacs.devel Subject: Re: *Occur in buf*? Date: 25 Jul 2002 09:42:16 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: References: Reply-To: sds@gnu.org NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1027604596 18114 127.0.0.1 (25 Jul 2002 13:43:16 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 25 Jul 2002 13:43:16 +0000 (UTC) Cc: "'Emacs Developers'" Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17Xitf-0004i3-00 for ; Thu, 25 Jul 2002 15:43:15 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17Xj8z-0005Ln-00 for ; Thu, 25 Jul 2002 15:59:05 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17Xitt-0003ZN-00; Thu, 25 Jul 2002 09:43:29 -0400 Original-Received: from h013.c001.snv.cp.net ([209.228.32.127] helo=c001.snv.cp.net) by fencepost.gnu.org with smtp (Exim 3.35 #1 (Debian)) id 17Xisk-0003Yc-00 for ; Thu, 25 Jul 2002 09:42:18 -0400 Original-Received: (cpmta 8390 invoked from network); 25 Jul 2002 06:42:17 -0700 Original-Received: from 65.114.186.226 (HELO glip.premonitia.com) by smtp.premonitia.com (209.228.32.127) with SMTP; 25 Jul 2002 06:42:17 -0700 X-Sent: 25 Jul 2002 13:42:17 GMT Original-To: "Marshall, Simon" X-Attribution: Sam X-Disclaimer: You should not expect anyone to agree with me. Mail-Copies-To: never In-Reply-To: Original-Lines: 70 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:6033 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6033 > * In message > * On the subject of "*Occur in buf*?" > * Sent on Thu, 25 Jul 2002 11:05:41 +0100 > * Honorable "Marshall, Simon" 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 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. \\\\[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