From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: *Occur in buf*? Date: Fri, 09 Aug 2002 03:32:24 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <200208090732.g797WQh11673@rum.cs.yale.edu> References: <200207261536.g6QFa4U08962@aztec.santafe.edu> <5xd6t83dyy.fsf@kfs2.cua.dk> <20020728011001.GA3415@gnu.org> <5xeldn7x5s.fsf@kfs2.cua.dk> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1028878348 18016 127.0.0.1 (9 Aug 2002 07:32:28 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 9 Aug 2002 07:32:28 +0000 (UTC) Cc: storm@cua.dk (Kim F. Storm), 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.35 #1 (Debian)) id 17d4G3-0004gT-00 for ; Fri, 09 Aug 2002 09:32:27 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17d4cV-0006Xl-00 for ; Fri, 09 Aug 2002 09:55:40 +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 17d4Gf-000779-00; Fri, 09 Aug 2002 03:33:05 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17d4G5-00075N-00; Fri, 09 Aug 2002 03:32:29 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g797WQh11673; Fri, 9 Aug 2002 03:32:26 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Sam Steingold 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:6383 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6383 > > > > 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. I think this is a good idea. I'm not sure if a generic function is necessary or if we can get away with a standard `buffer-topic' variable (would contain the source buffer name for *Occur* buffers, or the command name for *Help* buffers, ...) which rename-uniquely and friends would use to generate pretty names. I like the idea of `buffer-topic' (better name welcome) since we could display it in ibuffer as well. This issue of "*Help*" vs "*Help fun*" and friends is old. There are two issues: - how to generate pretty names when calling rename-uniquely (or clone-buffer since Miles seems to shy away from r-u ;-) and I think your proposal above is a good solution to this problem (although not as easy as it seems because the current foo stuff is hardcoded at a few places). - whether to use a single buffer or several. This one is more difficult and will probably require customization. Ideally (add-hook 'occur-mode-hook 'give-unique-name) is all that's needed, but `give-unique-name' is still to be written. Also ideally, there should be some way to set this hook "globally". Of course this is also related to `uniquify', of course. E.g. in PCL-CVS I use "several buffers" by default so you don't need to M-x r-u but then you may need to kill old *cvs* buffers after a while. By default the first buffer is called *cvs* but is renamed by uniquify (just like dired buffers) as soon as a second *cvs* buffer is created. Maybe `buffer-topic' could be somewhat merged with list-buffers-directory (used by dired and PCL-CVS to tell ibuffer and uniquify which directory this is related to). Stefan