all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Subject: make-indirect-buffer
Date: Sat, 13 Mar 2004 17:23:22 -0600 (CST)	[thread overview]
Message-ID: <200403132323.i2DNNMa01190@raven.dms.auburn.edu> (raw)

I am currently checking buffers.texi.  The CLONE argument to
`make-indirect-buffer' is currently not documented in the Elisp
manual.  No problem there, I will document it.  However, I do not want
to document bugs and I believe the behavior illustrated in the ielm
run below is a bug.  I believe that the intent of the CLONE argument
to `make-indirect-buffer' is to _initialize_ the "state" of the
indirect buffer from the base buffer, but nevertheless return a "true"
indirect buffer, with its own buffer-local-variables.  That would be a
useful thing to do.  What happens instead is that we wind up with shared
local variables, whose value when set in either buffer also affects
the value in the other.  (On the other hand, newly created local
variables are _not_ shared in this way.)  I believe this is a bug and
that no local variables should be "shared" in that fashion.
Ielm run illustrating this:

===File ~/indi-ielm=========================================
*** Welcome to IELM ***  Type (describe-mode) for help.
ELISP> (set-buffer "*scratch*")
#<buffer *scratch*>
ELISP> (make-local-variable 'aa)
aa
ELISP> (setq aa 1)
1
ELISP> (make-indirect-buffer "*scratch*" "clone" t)
#<buffer clone>
ELISP> (set-buffer "clone")
#<buffer clone>
ELISP> (make-local-variable 'bb)
bb
ELISP> (setq aa 2)
2
ELISP> (setq bb 2)
2
ELISP> (set-buffer "*scratch*")
#<buffer *scratch*>
ELISP> aa
2  ;;  This is what I believe is a bug.  I expected `1'.
ELISP> bb
*** Eval error ***  Symbol's value as variable is void: bb
ELISP> (default-value 'aa)
*** Eval error ***  Symbol's value as variable is void: aa
ELISP> ============================================================

Doc string of `make-indirect-buffer':

make-indirect-buffer is an interactive built-in function.
(make-indirect-buffer BASE-BUFFER NAME &optional CLONE)

Create and return an indirect buffer for buffer BASE-BUFFER, named NAME.
BASE-BUFFER should be an existing buffer (or buffer name).
NAME should be a string which is not the name of an existing buffer.
Optional argument CLONE non-nil means preserve BASE-BUFFER's state,
such as major and minor modes, in the indirect buffer.
CLONE nil means the indirect buffer's state is reset to default values.

             reply	other threads:[~2004-03-13 23:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-13 23:23 Luc Teirlinck [this message]
2004-03-15  4:56 ` make-indirect-buffer Richard Stallman
2004-03-15 22:37   ` make-indirect-buffer Luc Teirlinck
  -- strict thread matches above, loose matches on Subject: below --
2004-04-12  4:58 make-indirect-buffer Luc Teirlinck
2004-04-13 17:45 ` make-indirect-buffer Richard Stallman
2004-04-12  5:19 make-indirect-buffer Luc Teirlinck
2004-04-12 21:01 ` make-indirect-buffer Stefan Monnier
2004-04-12 21:04   ` make-indirect-buffer Miles Bader
2004-04-12 21:12     ` make-indirect-buffer Luc Teirlinck
2004-04-12 21:22     ` make-indirect-buffer Luc Teirlinck
2004-04-12 21:35       ` make-indirect-buffer Luc Teirlinck
2004-04-12 21:37         ` make-indirect-buffer Luc Teirlinck
2004-04-12 22:53       ` make-indirect-buffer Stefan Monnier
2004-04-12 23:36         ` make-indirect-buffer Luc Teirlinck
2004-04-12 21:27   ` make-indirect-buffer Luc Teirlinck
2004-04-12 21:49 ` make-indirect-buffer Kim F. Storm
2004-04-13 17:45 ` make-indirect-buffer Richard Stallman

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

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

  git send-email \
    --in-reply-to=200403132323.i2DNNMa01190@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.