From xemacs-m  Fri Aug 29 05:16:16 1997
Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id FAA23905
	for <xemacs-beta@xemacs.org>; Fri, 29 Aug 1997 05:16:12 -0500 (CDT)
Received: from orion.kurims.kyoto-u.ac.jp (orion.kurims.kyoto-u.ac.jp [130.54.16.5]) by kurims.kurims.kyoto-u.ac.jp (8.8.5/3.4W2) with SMTP id TAA18134 for <xemacs-beta@xemacs.org>; Fri, 29 Aug 1997 19:15:36 +0900 (JST)
Received: (from petersen@localhost) by orion.kurims.kyoto-u.ac.jp (SMI-8.6/3.5Wbeta) id TAA23302; Fri, 29 Aug 1997 19:15:36 +0900
To: XEmacs Beta List <xemacs-beta@xemacs.org>
Subject: behaviour of `switch-to-buffer-other-frame'
X-Emacs: 20.3 "Bratislava" XEmacs  Lucid (beta18) with mule
Mime-Version: 1.0 (generated by SEMI MIME-Edit 0.86 "Naka-Tsurugi")
Content-Type: text/plain; charset=US-ASCII
From: Jens-Ulrik Holger Petersen <petersen@kurims.kyoto-u.ac.jp>
Date: 29 Aug 1997 19:15:36 +0900
Message-ID: <lb90xll2gn.fsf@orion.kurims.kyoto-u.ac.jp>
Lines: 54

I am having trouble with the behaviour of
`switch-to-buffer-other-frame' (in `find-function-other-frame'
actually but this seems to be a general problem, if I'm not
overlooking something obvious).

I start a fresh plain vanilla xemacs in X and insert:

(defun silly-copy ()
  (interactive)
  (switch-to-buffer-other-frame (current-buffer))
  (beginning-of-line))

I leave point after the final ")", eval with C-x C-e and then do:
M-x silly-copy RET

Now have two frames: the original with point at the beginning of the
line and a new frame with point at the end of the line, whereas I was
expecting the same behaviour as under Emacs, where point is moved in
the new frame not the original one.

The following function for XEmacs seems to perform as I want:

(defun silly-copy2 ()
  (interactive)
  (let ((frame (make-frame)))
    (pop-to-buffer (current-buffer) t frame)
    (select-frame frame)
    (beginning-of-line)))


Is it this a feature, or a bug in `switch-to-buffer-other-frame'?
If the latter, then I think the patch below should fix it.

(Does it make any difference whether `(select-frame frame)' comes
before or after the `(make-frame-visible frame)'?)

Jens


1997-08-29  Jens-Ulrik Holger Petersen  <petersen@kurims.kyoto-u.ac.jp>

	* prim/files.el (switch-to-buffer-other-frame): make it select-frame

diff -u lisp/prim/files.el~ lisp/prim/files.el
--- lisp/prim/files.el~	Fri Aug 29 19:02:57 1997
+++ lisp/prim/files.el	Fri Aug 29 19:02:57 1997
@@ -635,6 +635,7 @@
 	 (frame (make-frame (if name
 				  (list (cons 'name (symbol-name name)))))))
     (pop-to-buffer buffer t frame)
+    (select-frame frame)
     (make-frame-visible frame)
     buffer))
 

