[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs server without emacsserver.
From: |
Stefan Monnier |
Subject: |
Re: Emacs server without emacsserver. |
Date: |
Mon, 21 Oct 2002 08:55:03 -0400 |
> 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)))))))))