diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2006-11-10 09:46:51 +0000 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2006-11-10 09:46:51 +0000 |
commit | 90caccca7bf7f10b30e06c2cb0ac689f06f132f1 (patch) | |
tree | 7add295a83696e14bc24c64bd2808493c661d542 /lisp/server.el | |
parent | ae4c58a755c319d92d9b884a2cb71ec0efa76382 (diff) | |
download | emacs-90caccca7bf7f10b30e06c2cb0ac689f06f132f1.tar.gz |
(server-raise-frame): New option.
(server-switch-buffer): Use it.
Diffstat (limited to 'lisp/server.el')
-rw-r--r-- | lisp/server.el | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lisp/server.el b/lisp/server.el index 9214391d861..c6a70dedaea 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -112,6 +112,12 @@ If set, the server accepts remote connections; otherwise it is local." :version "22.1") (put 'server-auth-dir 'risky-local-variable t) +(defcustom server-raise-frame t + "*If non-nil, raise frame when switching to a buffer." + :group 'server + :type 'boolean + :version "22.1") + (defcustom server-visit-hook nil "*Hook run when visiting a file for the Emacs server." :group 'server @@ -702,11 +708,9 @@ Arg NEXT-BUFFER is a suggestion; if it is a live buffer, use it." (let ((win (get-buffer-window next-buffer 0))) (if (and win (not server-window)) ;; The buffer is already displayed: just reuse the window. - (let ((frame (window-frame win))) - (when (eq (frame-visible-p frame) 'icon) - (raise-frame frame)) - (select-window win) - (set-buffer next-buffer)) + (progn + (select-window win) + (set-buffer next-buffer)) ;; Otherwise, let's find an appropriate window. (cond ((and (windowp server-window) (window-live-p server-window)) @@ -730,7 +734,9 @@ Arg NEXT-BUFFER is a suggestion; if it is a live buffer, use it." (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))))))) + (when server-raise-frame + (select-frame-set-input-focus (window-frame (selected-window)))))) (define-key ctl-x-map "#" 'server-edit) |