[slime-cvs] CVS slime/contrib

trittweiler trittweiler at common-lisp.net
Mon Oct 1 11:50:06 UTC 2007


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

Modified Files:
	slime-typeout-frame.el 
Log Message:

* slime-typeout-frame.el: Messages in the typeout frame were too
  easily overwritten by `slime-autodoc'. Fix that.
  Reported by Geoff Wozniak.
	
  (slime-typeout-message-aux): Split out from `slime-typeout-message'.
  (slime-typeout-message): Wrapper around it. Additionally disable
  the autodoc timer temporarily.


--- /project/slime/cvsroot/slime/contrib/slime-typeout-frame.el	2007/09/30 22:41:44	1.4
+++ /project/slime/cvsroot/slime/contrib/slime-typeout-frame.el	2007/10/01 11:50:06	1.5
@@ -28,11 +28,21 @@
   (and slime-typeout-window
        (window-live-p slime-typeout-window)))
 
-(defun slime-typeout-message (format-string &rest format-args)
+(defun slime-typeout-message-aux (format-string &rest format-args)
   (slime-ensure-typeout-frame)
   (with-current-buffer (window-buffer slime-typeout-window)
-    (erase-buffer)
-    (insert (apply #'format format-string format-args))))
+    (let ((msg (apply #'format format-string format-args)))
+      (unless (string= msg "")
+	(erase-buffer)
+	(insert msg)))))
+
+(defun slime-typeout-message (format-string &rest format-args)
+  (apply #'slime-typeout-message-aux format-string format-args)
+  ;; Disable the timer for autodoc temporarily, as it would overwrite
+  ;; the current typeout message otherwise.
+  (when (and (featurep 'slime-autodoc) slime-autodoc-mode)
+    (slime-autodoc-stop-timer)
+    (add-hook 'pre-command-hook #'slime-autodoc-start-timer)))
 
 (defun slime-make-typeout-frame ()
   "Create a frame for displaying messages (e.g. arglists)."
@@ -50,8 +60,9 @@
     (slime-make-typeout-frame)))
 
 (defun slime-typeout-autodoc-message (doc)
-  (setq slime-autodoc-last-message "") ; no need for refreshing
-  (slime-typeout-message "%s" doc))
+  ;; No need for refreshing per `slime-autodoc-pre-command-refresh-echo-area'.
+  (setq slime-autodoc-last-message "")
+  (slime-typeout-message-aux "%s" doc))
 
 
 ;;; Initialization




More information about the slime-cvs mailing list