[slime-cvs] CVS slime
trittweiler
trittweiler at common-lisp.net
Fri Aug 8 14:08:15 UTC 2008
Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv764
Modified Files:
slime.el ChangeLog
Log Message:
* slime.el: Make the threads browser use `slime-with-temp-buffer'.
(slime-temp-buffer-quit-function): New buffer-local
variable. Defaults to `slime-temp-buffer-quit'.
(slime-temp-buffer-mode): `q' invokes above variable now.
(slime-threads-buffer-name): New variable.
(slime-list-threads): Use slime-with-temp-buffer.
(slime-update-threads-buffer): New. Lifted from
slime-list-threads.
(slime-thread-quit): Renamed to slime-quit-threads-buffer.
--- /project/slime/cvsroot/slime/slime.el 2008/08/08 09:34:41 1.969
+++ /project/slime/cvsroot/slime/slime.el 2008/08/08 14:08:13 1.970
@@ -1015,10 +1015,19 @@
"Mode for displaying read only stuff"
nil
(" Slime-Tmp" slime-modeline-string)
- '(("q" . slime-temp-buffer-quit)
+ '(("q" . slime-temp-buffer-quit-function)
("\C-c\C-z" . slime-switch-to-output-buffer)
("\M-." . slime-edit-definition)))
+(make-variable-buffer-local
+ (defvar slime-temp-buffer-quit-function 'slime-temp-buffer-quit
+ "The function that is used to quit a temporary popup buffer."))
+
+(defun slime-temp-buffer-quit-function (&optional kill-buffer-p)
+ "Wrapper to invoke the value of `slime-temp-buffer-quit-function'."
+ (interactive)
+ (funcall slime-temp-buffer-quit-function kill-buffer-p))
+
;; Interface
(defun slime-temp-buffer-quit (&optional kill-buffer-p)
"Get rid of the current (temp) buffer without asking.
@@ -7377,20 +7386,31 @@
;;;; Thread control panel
+(defvar slime-threads-buffer-name "*SLIME Threads*")
+
(defun slime-list-threads ()
"Display a list of threads."
(interactive)
- (let ((threads (slime-eval '(swank:list-threads))))
- (with-current-buffer (get-buffer-create "*slime-threads*")
+ (let ((name slime-threads-buffer-name))
+ (slime-with-temp-buffer (name nil t)
(slime-thread-control-mode)
+ (setq slime-temp-buffer-quit-function 'slime-quit-threads-buffer)
+ (slime-update-threads-buffer))))
+
+(defun slime-quit-threads-buffer (&optional _)
+ (slime-eval-async `(swank:quit-thread-browser))
+ (slime-temp-buffer-quit t))
+
+(defun slime-update-threads-buffer ()
+ (interactive)
+ (let ((threads (slime-eval '(swank:list-threads))))
+ (with-current-buffer slime-threads-buffer-name
(let ((inhibit-read-only t))
(erase-buffer)
(loop for idx from 0
for (id name status desc) in threads
do (slime-thread-insert idx name status desc id))
- (goto-char (point-min))
- (setq buffer-read-only t)
- (pop-to-buffer (current-buffer))))))
+ (goto-char (point-min))))))
(defun slime-thread-insert (idx name status summary id)
(slime-propertize-region `(thread-id ,idx)
@@ -7407,24 +7427,20 @@
;;;;; Major mode
(define-derived-mode slime-thread-control-mode fundamental-mode
- "Slime-Threads"
+ "Threads"
"SLIME Thread Control Panel Mode.
-\\{slime-thread-control-mode-map}"
+\\{slime-thread-control-mode-map}
+\\{slime-temp-buffer-mode-map}"
(when slime-truncate-lines
(set (make-local-variable 'truncate-lines) t)))
(slime-define-keys slime-thread-control-mode-map
("a" 'slime-thread-attach)
("d" 'slime-thread-debug)
- ("g" 'slime-list-threads)
- ("k" 'slime-thread-kill)
- ("q" 'slime-thread-quit))
+ ("g" 'slime-update-threads-buffer)
+ ("k" 'slime-thread-kill))
-(defun slime-thread-quit ()
- (interactive)
- (slime-eval-async `(swank:quit-thread-browser))
- (kill-buffer (current-buffer)))
(defun slime-thread-kill ()
(interactive)
@@ -7988,7 +8004,7 @@
(def-slime-selector-method ?t
"SLIME threads buffer."
(slime-list-threads)
- "*slime-threads*")
+ slime-threads-buffer-name)
(defun slime-recently-visited-buffer (mode)
"Return the most recently visited buffer whose major-mode is MODE.
--- /project/slime/cvsroot/slime/ChangeLog 2008/08/08 13:43:33 1.1411
+++ /project/slime/cvsroot/slime/ChangeLog 2008/08/08 14:08:14 1.1412
@@ -1,3 +1,17 @@
+2008-08-08 Tobias C. Rittweiler <tcr at freebits.de>
+
+ * slime.el: Make the threads browser use `slime-with-temp-buffer'.
+
+ (slime-temp-buffer-quit-function): New buffer-local
+ variable. Defaults to `slime-temp-buffer-quit'.
+ (slime-temp-buffer-mode): `q' invokes above variable now.
+
+ (slime-threads-buffer-name): New variable.
+ (slime-list-threads): Use slime-with-temp-buffer.
+ (slime-update-threads-buffer): New. Lifted from
+ slime-list-threads.
+ (slime-thread-quit): Renamed to slime-quit-threads-buffer.
+
2008-08-08 Helmut Eller <heller at common-lisp.net>
Spawn the auto-flush thread in the front end.
More information about the slime-cvs
mailing list