unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stuart D. Herring" <herring@lanl.gov>
Cc: emacs-devel@gnu.org
Subject: Re: [billl@neurosim.downstate.edu: finding clone]
Date: Mon, 1 May 2006 14:28:45 -0700 (PDT)	[thread overview]
Message-ID: <33179.128.165.123.132.1146518925.squirrel@webmail.lanl.gov> (raw)
In-Reply-To: <E1FZuos-0000vI-5f@fencepost.gnu.org>

> 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.

      reply	other threads:[~2006-05-01 21:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-29 19:09 [billl@neurosim.downstate.edu: finding clone] Richard Stallman
2006-05-01 21:28 ` Stuart D. Herring [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=33179.128.165.123.132.1146518925.squirrel@webmail.lanl.gov \
    --to=herring@lanl.gov \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).