[slime-cvs] CVS slime

trittweiler trittweiler at common-lisp.net
Fri Aug 8 22:46:54 UTC 2008


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

Modified Files:
	slime.el ChangeLog 
Log Message:

* slime.el: Fixing `q' in Xref buffers.

  (slime-popup-buffer-snapshot-unchanged-p): New.
  (slime-popup-buffer-restore-snapshot): New.
  (slime-xref-quit): Can't use slime-popup-buffer directly. Instead
  implement its own quit behaviour using the above functions.


--- /project/slime/cvsroot/slime/slime.el	2008/08/08 21:13:43	1.976
+++ /project/slime/cvsroot/slime/slime.el	2008/08/08 22:46:54	1.977
@@ -1035,16 +1035,23 @@
 Restore the window configuration unless it was changed since we
 last activated the buffer."
   (interactive)
-  (let ((snapshot slime-popup-buffer-saved-emacs-snapshot)
-        (popup-buffer (current-buffer)))
-    (setq slime-popup-buffer-saved-emacs-snapshot nil)
-    (if (and snapshot (equalp (slime-current-emacs-snapshot-fingerprint)
-                              slime-popup-buffer-saved-fingerprint))
-        (slime-set-emacs-snapshot snapshot)
+  (let ((popup-buffer (current-buffer)))
+    (if (slime-popup-buffer-snapshot-unchanged-p)
+        (slime-popup-buffer-restore-snapshot)
         (bury-buffer))
+    (setq slime-popup-buffer-saved-emacs-snapshot nil)
     (when kill-buffer-p
       (kill-buffer popup-buffer))))
 
+(defun slime-popup-buffer-snapshot-unchanged-p ()
+  (let ((snapshot slime-popup-buffer-saved-emacs-snapshot))
+    (and snapshot (equalp (slime-current-emacs-snapshot-fingerprint)
+                          slime-popup-buffer-saved-fingerprint))))
+
+(defun slime-popup-buffer-restore-snapshot ()
+  (slime-set-emacs-snapshot slime-popup-buffer-saved-emacs-snapshot))
+
+
 ;;;;; Filename translation
 ;;;
 ;;; Filenames passed between Emacs and Lisp should be translated using
@@ -6077,14 +6084,17 @@
   "Kill the current xref buffer and restore the window configuration."
   (interactive)
   (slime-xref-cleanup)
-  (slime-popup-buffer-quit))
+  ;; We can't simply use `slime-popup-buffer-quit' because we also
+  ;; want the Xref window be deleted.
+  (if (slime-popup-buffer-snapshot-unchanged-p)
+      (slime-popup-buffer-restore-snapshot)
+    (let ((buffer (current-buffer)))
+      (delete-windows-on buffer)
+      (kill-buffer buffer))))
 
 (defun slime-xref-cleanup ()
   "Delete overlays created by xref mode and kill the xref buffer."
-  (sldb-delete-overlays)
-  (let ((buffer (current-buffer)))
-    (delete-windows-on buffer)
-    (kill-buffer buffer)))
+  (sldb-delete-overlays))
 
 (defun slime-insert-xrefs (xref-alist)
   "Insert XREF-ALIST in the current-buffer.
@@ -6208,7 +6218,7 @@
   "Goto the cross-referenced location at point."
   (interactive)
   (let ((location (slime-xref-location-at-point)))
-    (slime-xref-cleanup)
+    (slime-xref-quit)
     (slime-pop-to-location location)))
 
 (defun slime-show-xref ()
--- /project/slime/cvsroot/slime/ChangeLog	2008/08/08 21:34:17	1.1418
+++ /project/slime/cvsroot/slime/ChangeLog	2008/08/08 22:46:54	1.1419
@@ -1,3 +1,12 @@
+2008-08-08  Tobias C. Rittweiler  <tcr at freebits.de>
+
+	* slime.el: Fixing `q' in Xref buffers.
+
+	(slime-popup-buffer-snapshot-unchanged-p): New.
+	(slime-popup-buffer-restore-snapshot): New.
+	(slime-xref-quit): Can't use slime-popup-buffer directly. Instead
+	implement its own quit behaviour using the above functions.
+
 2008-08-08  Helmut Eller  <heller at common-lisp.net>
 
 	Use wait-for-event instead of catch/throw where needed.




More information about the slime-cvs mailing list