From xemacs-m  Mon May 12 01:59:47 1997
Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1])
	by xemacs.org (8.8.5/8.8.5) with SMTP id BAA29226
	for <xemacs-beta@xemacs.org>; Mon, 12 May 1997 01:59:46 -0500 (CDT)
Received: from Eng.Sun.COM ([129.146.1.25]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id AAA01450 for <xemacs-beta@xemacs.org>; Mon, 12 May 1997 00:12:19 -0700
Received: from kindra.eng.sun.com by Eng.Sun.COM (SMI-8.6/SMI-5.3)
	id XAA02933; Sun, 11 May 1997 23:59:11 -0700
Received: from xemacs.eng.sun.com by kindra.eng.sun.com (SMI-8.6/SMI-SVR4)
	id XAA24927; Sun, 11 May 1997 23:59:10 -0700
Received: by xemacs.eng.sun.com (SMI-8.6/SMI-SVR4)
	id XAA14950; Sun, 11 May 1997 23:59:07 -0700
Date: Sun, 11 May 1997 23:59:07 -0700
Message-Id: <199705120659.XAA14950@xemacs.eng.sun.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Martin Buchholz <mrb@Eng.Sun.COM>
To: xemacs-beta@xemacs.org
Subject: (with-current-buffer) and optional buffer arguments
In-Reply-To: <m2pvuxu3za.fsf@altair.xemacs.org>
References: <199705021924.OAA22675@xemacs.org>
	<m2pvuxu3za.fsf@altair.xemacs.org>
X-Mailer: VM 6.24 under 20.1 XEmacs Lucid (beta15)
Reply-To: Martin Buchholz <mrb@Eng.Sun.COM>

Ben sez:

- The additional buffer args were originally added by Chuck to the C
  code for redisplay speedup. set_buffer_internal was too
  expensive.  Ben continued this work in other C code and the
  low-level lisp code.
- The low-level functions accessing buffer properties (such as
  (point)) can be regarded as buffer methods, and so should take
  buffer arguments (i.e. the "hidden" object argument in OO
  methods). Since (point buf) will likely always be more efficient
  than (with-current-buffer buf (point)), there are software
  engineering and efficiency reasons to keep things the way they are.
- If Emacs has (with-current-buffer), we should too.
- In general, we should reduce the amount of global state in XEmacs,
  and adding additional arguments is one way of achieving that.

Martin sez:

- Ben mostly convinced me. 
- Let's add (with-current-buffer) if and when Emacs does, compatibly.
- Let's keep the current elisp function signature as it is.
- Let's pray that rms doesn't add new optional arguments to (point)
  and friends, that conflict with the optional buffer args.

