[slime-cvs] CVS slime

CVS User heller heller at common-lisp.net
Thu Jan 8 06:45:10 UTC 2009


Update of /project/slime/cvsroot/slime
In directory cl-net:/tmp/cvs-serv26662

Modified Files:
	ChangeLog slime.el 
Log Message:
* slime.el (slime-with-xref-buffer): Don't set
slime-popup-buffer-quit-function. Use the default.  Don't shrink
the window because it may have existed before creating the buffer
and we need to restore it.
(slime-goto-xref): Just use slime-popup-buffer-quit.
(slime-edit-definition-cont): Push definition stack here so that
we don't need to do anything special in slime-goto-xref.
(slime-display-popup-buffer): Also save the buffer that the popup
window was displaying before (if the window is not new).
(slime-close-popup-window): Restore the old buffer (if any) of the
popup window.

--- /project/slime/cvsroot/slime/ChangeLog	2009/01/07 09:21:54	1.1642
+++ /project/slime/cvsroot/slime/ChangeLog	2009/01/08 06:45:09	1.1643
@@ -1,5 +1,19 @@
 2009-01-07  Helmut Eller  <heller at common-lisp.net>
 
+	* slime.el (slime-with-xref-buffer): Don't set
+	slime-popup-buffer-quit-function. Use the default.  Don't shrink
+	the window because it may have existed before creating the buffer
+	and we need to restore it.
+	(slime-goto-xref): Just use slime-popup-buffer-quit.
+	(slime-edit-definition-cont): Push definition stack here so that
+	we don't need to do anything special in slime-goto-xref.
+	(slime-display-popup-buffer): Also save the buffer that the popup
+	window was displaying before (if the window is not new).
+	(slime-close-popup-window): Restore the old buffer (if any) of the
+	popup window.
+
+2009-01-07  Helmut Eller  <heller at common-lisp.net>
+
 	* slime.el (slime-show-buffer-position): Use reposition-window.
 
 2009-01-07  Helmut Eller  <heller at common-lisp.net>
--- /project/slime/cvsroot/slime/slime.el	2009/01/07 09:21:54	1.1105
+++ /project/slime/cvsroot/slime/slime.el	2009/01/08 06:45:09	1.1106
@@ -1005,26 +1005,29 @@
 Save the selected-window in a buffer-local variable, so that we
 can restore it later."
   (let ((selected-window (selected-window))
-        (windows))
-    (walk-windows (lambda (w) (push w windows)) nil t)
+        (old-windows))
+    (walk-windows (lambda (w) (push (cons w (window-buffer w)) old-windows))
+                  nil t)
     (let ((new-window (display-buffer (current-buffer))))
       (unless (slime-local-variable-p 'slime-popup-buffer-restore-info)
         (set (make-local-variable 'slime-popup-buffer-restore-info)
-             (list (unless (memq new-window windows)
-                     new-window)
-                   selected-window)))
+             (list new-window
+                   selected-window
+                   (cdr (find new-window old-windows :key #'car)))))
       (when select
         (select-window new-window))
       (current-buffer))))
 
 (defun slime-close-popup-window ()
   (cond ((slime-local-variable-p 'slime-popup-buffer-restore-info)
-         (destructuring-bind (created-window selected-window)
+         (destructuring-bind (popup-window selected-window old-buffer)
              slime-popup-buffer-restore-info
            (bury-buffer)
-           (when (and (eq created-window (selected-window))
-                      (not (eq (next-window created-window) created-window)))
-             (delete-window created-window))
+           (when (eq popup-window (selected-window))
+             (cond ((and (not old-buffer) (not (one-window-p)))
+                    (delete-window popup-window))
+                   ((and old-buffer (buffer-live-p old-buffer))
+                    (set-window-buffer popup-window old-buffer))))
            (when (window-live-p selected-window)
              (select-window selected-window)))
          (kill-local-variable 'slime-popup-buffer-restore-info))
@@ -4006,7 +4009,7 @@
           ((slime-length= xrefs 1)      ; ((:error "..."))
            (error "%s" (cadr (slime-xref.location (car xrefs)))))
           (t
-           ;; Xref buffers will themselves push onto the find-definition stack.
+           (slime-push-definition-stack)
            (slime-show-xrefs file-alist 'definition name
                              (slime-current-package))))))
 
@@ -4884,11 +4887,8 @@
      (slime-with-popup-buffer (xref-buffer-name% ,package t t ,emacs-snapshot)
        (slime-xref-mode)
        (slime-set-truncate-lines)
-       (setq slime-popup-buffer-quit-function 'slime-xref-quit)
        (erase-buffer)
-       (prog1 (progn , at body)
-         (assert (equal (buffer-name) xref-buffer-name%))
-         (shrink-window-if-larger-than-buffer)))))
+       , at body)))
 
 (put 'slime-with-xref-buffer 'lisp-indent-function 1)
 
@@ -5042,11 +5042,8 @@
 (defun slime-goto-xref ()
   "Goto the cross-referenced location at point."
   (interactive)
-  ;; Notice: We implement it this way so `slime-show-xref' changes the
-  ;; the window snapshot such that `slime-xref-quit' will push onto
-  ;; the find-definition-stack.
   (slime-show-xref)
-  (slime-xref-quit))
+  (slime-popup-buffer-quit))
 
 (defun slime-show-xref ()
   "Display the xref at point in the other window."





More information about the slime-cvs mailing list