[slime-cvs] CVS slime

heller heller at common-lisp.net
Fri Aug 22 21:15:35 UTC 2008


Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv23033

Modified Files:
	ChangeLog slime.el 
Log Message:
Some focus handling in multiframe setups.

* slime.el (slime-pop-to-buffer): New function.
(slime-switch-to-output-buffer): Use it.

--- /project/slime/cvsroot/slime/ChangeLog	2008/08/22 21:15:24	1.1471
+++ /project/slime/cvsroot/slime/ChangeLog	2008/08/22 21:15:32	1.1472
@@ -1,5 +1,12 @@
 2008-08-22  Helmut Eller  <heller at common-lisp.net>
 
+	Some focus handling in multiframe setups.
+
+	* slime.el (slime-pop-to-buffer): New function.
+	(slime-switch-to-output-buffer): Use it.
+
+2008-08-22  Helmut Eller  <heller at common-lisp.net>
+
 	Use lazy lists in the inspector.
 
 	* swank.lisp (lcons): New data type.
--- /project/slime/cvsroot/slime/slime.el	2008/08/17 23:01:13	1.1003
+++ /project/slime/cvsroot/slime/slime.el	2008/08/22 21:15:35	1.1004
@@ -2703,7 +2703,7 @@
 `special-display-buffer-names' to customize the frame in which
 the buffer should appear."
   (interactive)
-  (pop-to-buffer (slime-output-buffer))
+  (slime-pop-to-buffer (slime-output-buffer))
   (goto-char (point-max)))
 
 
@@ -9644,6 +9644,18 @@
                                 ;; Emacs 21 uses microsecs; Emacs 22 millisecs
                                 (if timeout (truncate (* timeout 1000000)))))))
 
+(defun slime-pop-to-buffer (buffer &optional other-window norecord)
+  "Select buffer BUFFER in some window.
+This is like `pop-to-buffer' but also sets the input focus
+for (somewhat) better multiframe support."
+  (set-buffer buffer)
+  (let ((window (display-buffer buffer other-window)))
+    (select-window window norecord)
+    ;; select-window doesn't set the input focus
+    (when (and (not (featurep 'xemacs)) (>= emacs-major-version 22))
+      (select-frame-set-input-focus (window-frame window))))
+  buffer)
+
 (defun slime-add-local-hook (hook function &optional append)
   (cond ((featurep 'xemacs) (add-local-hook hook function append))
         ((< emacs-major-version 21)




More information about the slime-cvs mailing list