[slime-cvs] CVS slime

CVS User heller heller at common-lisp.net
Tue Jan 5 09:00:15 UTC 2010


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

Modified Files:
	ChangeLog slime.el 
Log Message:
Add "quit" and "other window prefix" buffer selectors.

* slime.el (slime-selector-other-window): New variable.
(slime-selector): Bind it as need.
(def-slime-selector-method): Use the other window if so indicated.
([selector] 4): New key binding.
([selector] q): New key binding. just abort.

--- /project/slime/cvsroot/slime/ChangeLog	2010/01/05 09:00:04	1.1953
+++ /project/slime/cvsroot/slime/ChangeLog	2010/01/05 09:00:15	1.1954
@@ -1,5 +1,15 @@
 2010-01-05  Helmut Eller  <heller at common-lisp.net>
 
+	Add "quit" and "other window prefix" buffer selectors.
+
+	* slime.el (slime-selector-other-window): New variable.
+	(slime-selector): Bind it as need.
+	(def-slime-selector-method): Use the other window if so indicated.
+	([selector] 4): New key binding.
+	([selector] q): New key binding. just abort.
+
+2010-01-05  Helmut Eller  <heller at common-lisp.net>
+
 	Stop the beeping on restart.
 
 	* slime.el (slime-quit-lisp-internal): Don't kill already dead
--- /project/slime/cvsroot/slime/slime.el	2010/01/05 09:00:05	1.1262
+++ /project/slime/cvsroot/slime/slime.el	2010/01/05 09:00:15	1.1263
@@ -6689,7 +6689,10 @@
 Each element is a list (KEY DESCRIPTION FUNCTION).
 DESCRIPTION is a one-line description of what the key selects.")
 
-(defun slime-selector ()
+(defvar slime-selector-other-window nil
+  "If non-nil use switch-to-buffer-other-window.")
+
+(defun slime-selector (&optional other-window)
   "Select a new buffer by type, indicated by a single character.
 The user is prompted for a single character indicating the method by
 which to choose a new buffer. The `?' character describes the
@@ -6699,18 +6702,19 @@
   (interactive)
   (message "Select [%s]: " 
            (apply #'string (mapcar #'car slime-selector-methods)))
-  (let* ((ch (save-window-excursion
+  (let* ((slime-selector-other-window other-window)
+         (ch (save-window-excursion
                (select-window (minibuffer-window))
                (read-char)))
          (method (find ch slime-selector-methods :key #'car)))
-    (cond ((null method)
+    (cond (method 
+           (funcall (third method)))
+          (t
            (message "No method for character: ?\\%c" ch)
            (ding)
            (sleep-for 1)
            (discard-input)
-           (slime-selector))
-          (t
-           (funcall (third method))))))
+           (slime-selector)))))
 
 (defmacro def-slime-selector-method (key description &rest body)
   "Define a new `slime-select' buffer selection method.
@@ -6730,6 +6734,8 @@
                             (ding))
                            ((get-buffer-window buffer)
                             (select-window (get-buffer-window buffer)))
+                           (slime-selector-other-window
+                            (switch-to-buffer-other-window buffer))
                            (t
                             (switch-to-buffer buffer)))))))
     `(setq slime-selector-methods
@@ -6743,13 +6749,18 @@
     (insert "Select Methods:\n\n")
     (loop for (key line function) in slime-selector-methods
           do (insert (format "%c:\t%s\n" key line)))
+    (goto-char (point-min))
     (help-mode)
-    (display-buffer (current-buffer) t)
-    (shrink-window-if-larger-than-buffer 
-     (get-buffer-window (current-buffer))))
+    (display-buffer (current-buffer) t))
   (slime-selector)
   (current-buffer))
 
+(pushnew (list ?4 "Select in other window" (lambda () (slime-selector t)))
+         slime-selector-methods :key #'car)
+
+(def-slime-selector-method ?q "Abort."
+  (top-level))
+
 (def-slime-selector-method ?i
   "*inferior-lisp* buffer."
   (cond ((and (slime-connected-p) (slime-process))





More information about the slime-cvs mailing list