From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stuart D. Herring" Newsgroups: gmane.emacs.devel Subject: Re: [billl@neurosim.downstate.edu: finding clone] Date: Mon, 1 May 2006 14:28:45 -0700 (PDT) Message-ID: <33179.128.165.123.132.1146518925.squirrel@webmail.lanl.gov> References: Reply-To: herring@lanl.gov NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1146518955 19220 80.91.229.2 (1 May 2006 21:29:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 1 May 2006 21:29:15 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 01 23:29:12 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fafx5-0002id-4N for ged-emacs-devel@m.gmane.org; Mon, 01 May 2006 23:29:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fafx4-0005RK-Cx for ged-emacs-devel@m.gmane.org; Mon, 01 May 2006 17:29:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fafwt-0005Qw-MN for emacs-devel@gnu.org; Mon, 01 May 2006 17:28:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fafwr-0005Qb-2O for emacs-devel@gnu.org; Mon, 01 May 2006 17:28:54 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fafwq-0005QY-Ta for emacs-devel@gnu.org; Mon, 01 May 2006 17:28:52 -0400 Original-Received: from [192.65.95.54] (helo=mailwasher-b.lanl.gov) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Fafwo-0005e3-WD; Mon, 01 May 2006 17:28:51 -0400 Original-Received: from mailrelay3.lanl.gov (mailrelay3.lanl.gov [128.165.4.104]) by mailwasher-b.lanl.gov (8.12.11.20060308/8.12.11/(ccn-5)) with ESMTP id k41LSkQi018858; Mon, 1 May 2006 15:28:46 -0600 Original-Received: from webmail1.lanl.gov (webmail1.lanl.gov [128.165.4.106]) by mailrelay3.lanl.gov (8.12.11.20060308/8.12.11/(ccn-5)) with ESMTP id k41LSjFj012724; Mon, 1 May 2006 15:28:45 -0600 Original-Received: from webmail1.lanl.gov (localhost.localdomain [127.0.0.1]) by webmail1.lanl.gov (8.12.11.20060308/8.12.11) with ESMTP id k41LSj1V004866; Mon, 1 May 2006 15:28:45 -0600 Original-Received: (from apache@localhost) by webmail1.lanl.gov (8.12.11.20060308/8.12.11/Submit) id k41LSjhV004863; Mon, 1 May 2006 14:28:45 -0700 X-Authentication-Warning: webmail1.lanl.gov: apache set sender to herring@lanl.gov using -f Original-Received: from 128.165.123.132 (SquirrelMail authenticated user 196434); by webmail.lanl.gov with HTTP; Mon, 1 May 2006 14:28:45 -0700 (PDT) In-Reply-To: Original-To: rms@gnu.org User-Agent: SquirrelMail/1.4.3a-11.EL3 X-Mailer: SquirrelMail/1.4.3a-11.EL3 X-Priority: 3 (Normal) Importance: Normal X-PMX-Version: 4.7.1.128075 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:53748 Archived-At: > What code does "the buffer clone package" refer to? The builtin function `make-indirect-buffer' and the functions `clone-indirect-buffer' and `clone-indirect-buffer-other-window' in simple.el. > I would suggest having a routine such as the following that will allow you > to find > an existing clone once it's been lost in a pile of buffers His routine is not entirely without merit, but would be better implemented with `buffer-base-buffer' as follows: defun switch-to-clone (&optional buffer) "Select another buffer with the same base buffer as BUFFER. BUFFER defaults to the current buffer. Non-indirect buffers are considered to be their own bases. If BUFFER is indirect, the buffer selected may be its base buffer or another indirect buffer with the same base buffer. If BUFFER is not indirect, the buffer selected will be an indirect buffer with it as base." (interactive) (setq buffer (get-buffer (or buffer (current-buffer)))) (let ((l (buffer-list)) (b (or (buffer-base-buffer buffer) buffer)) found) (while (and l (not found)) (and (not (eq (car l) buffer)) (eq (or (buffer-base-buffer (car l)) (car l)) b) (setq found (car l))) (setq l (cdr l))) (if found (switch-to-buffer found) (error "No indirect buffers for that buffer")))) I'm not really sure it's useful enough to warrant inclusion; a very similar effect can be achieved by naming indirect buffers CLONE_originalname or originalname_CLONE or so and using completion. Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.