From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: Emacs server without emacsserver. Date: Mon, 21 Oct 2002 08:55:03 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <200210211255.g9LCt3P15521@rum.cs.yale.edu> References: <200209172010.g8HKAG312061@rum.cs.yale.edu> <200210201957.g9KJvTd12809@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035205061 18899 80.91.224.249 (21 Oct 2002 12:57:41 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 12:57:41 +0000 (UTC) Cc: "Stefan Monnier" , emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 183c7n-0004uR-00 for ; Mon, 21 Oct 2002 14:57:39 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 183d1f-0000Hl-00 for ; Mon, 21 Oct 2002 15:55:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 183c6R-0007zX-00; Mon, 21 Oct 2002 08:56:15 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 183c5P-0005DK-00 for emacs-devel@gnu.org; Mon, 21 Oct 2002 08:55:11 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 183c5L-000564-00 for emacs-devel@gnu.org; Mon, 21 Oct 2002 08:55:09 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10) id 183c5K-00055Z-00; Mon, 21 Oct 2002 08:55:06 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g9LCt3P15521; Mon, 21 Oct 2002 08:55:03 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Sam Steingold Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:8612 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:8612 > the "offending code" (after ";; Ok, ...") should be abstracted to the > function `server-switch-buffer-default' of one argument (the buffer to > be displayed), and `server-switch-buffer' should call the function > which is the value of the variable `server-display-function', which is > by default set to `server-switch-buffer-default'. > > You and I will set `server-display-function' to `pop-to-buffer' and > people who like the default will keep the default. I was thinking instead of allowing server-window to be set to such a function, so you can just (setq server-window 'pop-to-buffer). Stefan --- server.el.~1.84.~ Fri Sep 27 17:55:20 2002 +++ server.el Mon Oct 21 08:54:01 2002 @@ -117,7 +117,9 @@ (defvar server-window nil "*The window to use for selecting Emacs server buffers. If nil, use the selected window. -If it is a frame, use the frame's selected window.") +If it is a frame, use the frame's selected window. +If it is a function, it should take one argument (a buffer) +and display and select it.") (defcustom server-temp-file-regexp "^/tmp/Re\\|/draft$" "*Regexp which should match filenames of temporary files @@ -540,6 +544,8 @@ ;; and try the next surviving server buffer. (apply 'server-switch-buffer (server-buffer-done next-buffer)) ;; OK, we know next-buffer is live, let's display and select it. + (if (functionp server-window) + (funcall server-window next-buffer) (let ((win (get-buffer-window next-buffer 0))) (if (and win (not server-window)) ;; The buffer is already displayed: just reuse the window. @@ -571,7 +577,7 @@ (switch-to-buffer next-buffer) ;; After all the above, we might still have ended up with ;; a minibuffer/dedicated-window (if there's no other). - (error (pop-to-buffer next-buffer)))))))) + (error (pop-to-buffer next-buffer)))))))))