From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: [ottomaddox@fastmail.fm: emacsclient won't open new frame on remote display] Date: Tue, 04 Jul 2006 16:16:04 -0400 Message-ID: <873bdhdt2z.fsf@stupidchicken.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1152044162 27763 80.91.229.2 (4 Jul 2006 20:16:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 4 Jul 2006 20:16:02 +0000 (UTC) Cc: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 04 22:16:01 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 1FxrJK-0004zt-N6 for ged-emacs-devel@m.gmane.org; Tue, 04 Jul 2006 22:15:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FxrJK-00030I-5z for ged-emacs-devel@m.gmane.org; Tue, 04 Jul 2006 16:15:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FxrJ7-0002xP-6s for emacs-devel@gnu.org; Tue, 04 Jul 2006 16:15:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FxrJ2-0002wD-NH for emacs-devel@gnu.org; Tue, 04 Jul 2006 16:15:39 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FxrJ2-0002wA-Gk for emacs-devel@gnu.org; Tue, 04 Jul 2006 16:15:36 -0400 Original-Received: from [18.19.1.138] (helo=cyd) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FxrWm-0008II-Q0 for emacs-devel@gnu.org; Tue, 04 Jul 2006 16:29:48 -0400 Original-Received: by cyd (Postfix, from userid 1000) id 176B44E2A8; Tue, 4 Jul 2006 16:16:04 -0400 (EDT) Original-To: emacs-devel@gnu.org In-Reply-To: (Richard Stallman's message of "Wed, 28 Jun 2006 13:25:43 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:56522 Archived-At: > $ /usr/local/emacs/bin/emacs -Q & > M-x server-start > > Go to a new xterm window and do this: > $ ssh -X localhost > $ emacsclient --display=$DISPLAY some-file > > The buffer for some-file is opened, but not in a new frame and is not > displayed in any existing window. > > There is a connection to the display: > > (x-display-list) > => (":0.0" "localhost:11.0") > > But even though no apparent frame was opened, I cannot close the X > connection: > > (x-close-connection "localhost:11.0") > => (error "Display still has frames on it") I'm not sure what the relevant code in server.el, which activates when there is no current frame on the required display, is trying to do. What I'd naively expect should happen is to try to open a new frame on the display, like in the patch below. Probably there's some reason it doesn't do this? Since Stefan wrote this code, he probably knows what's going on here. *** emacs/lisp/server.el.~1.112.~ 2006-07-04 13:35:40.000000000 -0400 --- emacs/lisp/server.el 2006-07-04 16:11:17.000000000 -0400 *************** *** 207,220 **** ;; and select it. (unless (equal (frame-parameter (selected-frame) 'display) display) (select-frame ! (make-frame-on-display ! display ! ;; This frame is only there in place of an actual "current display" ! ;; setting, so we want it to be as unobtrusive as possible. That's ! ;; what the invisibility is for. The minibuffer setting is so that ! ;; we don't end up displaying a buffer in it (which noone would ! ;; notice). ! '((visibility . nil) (minibuffer . only))))))) (defun server-unquote-arg (arg) (replace-regexp-in-string --- 207,213 ---- ;; and select it. (unless (equal (frame-parameter (selected-frame) 'display) display) (select-frame ! (make-frame-on-display display))))) (defun server-unquote-arg (arg) (replace-regexp-in-string *************** *** 382,390 **** (run-hooks 'server-switch-hook) (unless nowait (message "%s" (substitute-command-keys ! "When done with a buffer, type \\[server-edit]"))))) ! ;; Avoid preserving the connection after the last real frame is deleted. ! (if tmp-frame (delete-frame tmp-frame)))) ;; Save for later any partial line that remains. (when (> (length string) 0) (process-put proc 'previous-string string))) --- 375,381 ---- (run-hooks 'server-switch-hook) (unless nowait (message "%s" (substitute-command-keys ! "When done with a buffer, type \\[server-edit]"))))))) ;; Save for later any partial line that remains. (when (> (length string) 0) (process-put proc 'previous-string string)))