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: 30 Jul 2002 10:20:25 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: References: <200207261536.g6QFa4U08962@aztec.santafe.edu> <5xd6t83dyy.fsf@kfs2.cua.dk> <20020728011001.GA3415@gnu.org> <5xeldn7x5s.fsf@kfs2.cua.dk> 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 1028038858 6054 127.0.0.1 (30 Jul 2002 14:20:58 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 30 Jul 2002 14:20:58 +0000 (UTC) Cc: Miles Bader , rms@gnu.org, simon.marshall@misys.com, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17ZXro-0001ZX-00 for ; Tue, 30 Jul 2002 16:20:52 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17ZY9Y-00073m-00 for ; Tue, 30 Jul 2002 16:39:12 +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 17ZXsD-0004XY-00; Tue, 30 Jul 2002 10:21:17 -0400 Original-Received: from h008.c001.snv.cp.net ([209.228.32.122] helo=c001.snv.cp.net) by fencepost.gnu.org with smtp (Exim 3.35 #1 (Debian)) id 17ZXrT-0004SU-00 for ; Tue, 30 Jul 2002 10:20:31 -0400 Original-Received: (cpmta 11904 invoked from network); 30 Jul 2002 07:20:29 -0700 Original-Received: from 65.114.186.226 (HELO glip.premonitia.com) by smtp.premonitia.com (209.228.32.122) with SMTP; 30 Jul 2002 07:20:29 -0700 X-Sent: 30 Jul 2002 14:20:29 GMT Original-To: storm@cua.dk (Kim F. Storm) X-Attribution: Sam X-Disclaimer: You should not expect anyone to agree with me. Mail-Copies-To: never In-Reply-To: <5xeldn7x5s.fsf@kfs2.cua.dk> Original-Lines: 53 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:6177 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6177 > * In message <5xeldn7x5s.fsf@kfs2.cua.dk> > * On the subject of "Re: *Occur in buf*?" > * Sent on 29 Jul 2002 10:31:27 +0200 > * Honorable storm@cua.dk (Kim F. Storm) writes: > > Miles Bader writes: > > > On Sun, Jul 28, 2002 at 02:15:01AM +0200, Kim F. Storm wrote: > > > Alternatively, always name the buffer *Occur*, but provide a > > > occur-save-buffer command (bound to `s') which renames the buffer > > > to *Occur: buffer*; then the user can easily save precious occur > > > buffers on a needed basis. > > > > As I noted, there already is such a command -- it's called `clone-buffer'. > > I know, but the idea was to rename the occur buffer automatically to > include the name of the original buffer. E.g. *Occur: xdisp.c* . TRT, IMO, is to make `generate-new-buffer-name' mode-specific. E.g., have a buffer-local variable 'uniquify-buffer-name' or a similar property of the major-mode name, which would hold a mode-specific function which is to be run in the buffer being renamed. E.g., for occur-mode: (defun occur-mode-uniquify () (concat "*Occur: " (mapconcat #'buffer-name (car (cddr occur-revert-arguments)) "/") "*")) for help-mode: (defun help-mode-uniquify () (concat "*Help: " (case (car help-xref-stack-item) ((describe-function describe-variable) (symbol-name (cadr help-xref-stack-item))) ((describe-bindings) (concat "keybindings in buffer " (buffer-name (window-buffer (car help-return-method))))) (t "???")) "*")) etc. Then `rename-buffer', `clone-buffer' &c will DTRT automatically. -- Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux When you are arguing with an idiot, your opponent is doing the same.