[slime-cvs] CVS slime

mkoeppe mkoeppe at common-lisp.net
Sun Mar 26 03:51:56 UTC 2006


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

Modified Files:
	slime.el 
Log Message:
(slime-fontify-string): Fix for arguments spanning
multiple lines.
(slime-autodoc-message-dimensions): New.
(slime-autodoc-thing-at-point): Use it here to either ask for a
one-line or a nicely formatted multi-line arglist.
(slime-enclosing-operator-names): Handle linebreaks.


--- /project/slime/cvsroot/slime/slime.el	2006/03/23 23:27:41	1.604
+++ /project/slime/cvsroot/slime/slime.el	2006/03/26 03:51:56	1.605
@@ -5268,7 +5268,7 @@
     (let ((font-lock-verbose nil))
       (font-lock-fontify-buffer))
     (goto-char (point-min))
-    (when (re-search-forward "===> \\(.*\\) <===" nil t)
+    (when (re-search-forward "===> \\(\\(.\\|\n\\)*\\) <===" nil t)
       (let ((highlight (propertize (match-string 1) 'face 'highlight)))
         ;; Can't use (replace-match highlight) here -- broken in Emacs 21
         (delete-region (match-beginning 0) (match-end 0))
@@ -5407,6 +5407,24 @@
     (setq slime-autodoc-last-message doc)
     (message "%s" doc))))
 
+(defun slime-autodoc-message-dimensions ()
+  "Return the available width and height for pretty printing autodoc
+messages."
+  (cond
+   ((slime-typeout-active-p)
+    ;; Use the full width of the typeout window;
+    ;; we don't care about the height, as typeout window can be scrolled
+    (values (window-width slime-typeout-window)
+            nil))
+   (slime-autodoc-use-multiline-p 
+    ;; Use the full width of the minibuffer;
+    ;; minibuffer will grow vertically if necessary
+    (values (window-width (minibuffer-window))
+            nil))
+   (t
+    ;; Try to fit everything in one line; we cut off when displaying
+    (values 1000 1))))
+
 (defun slime-autodoc-pre-command-refresh-echo-area ()
   (unless (string= slime-autodoc-last-message "")
     (if (slime-autodoc-message-ok-p)
@@ -5428,12 +5446,12 @@
                               designator)
                             arg-index))
                          operators arg-indices)
-                `(swank:arglist-for-echo-area ',operators
-                                              :arg-indices
-                                              ',arg-indices
-                                              :print-right-margin 
-                                              ,(window-width
-                                                (minibuffer-window))))))))
+                (multiple-value-bind (width height)
+                    (slime-autodoc-message-dimensions)
+                  `(swank:arglist-for-echo-area ',operators
+                                                :arg-indices ',arg-indices
+                                                :print-right-margin ,width
+                                                :print-lines ,height)))))))
 
 (defun slime-autodoc-global-at-point ()
   "Return the global variable name at point, if any."
@@ -10029,7 +10047,7 @@
             (let ((arg-index 0))
               ;; Move to the beginning of the current sexp if not already there.
               (if (or (member (char-syntax (char-after)) '(?\( ?'))
-                      (= (char-syntax (char-before)) ?\ ))
+                      (member (char-syntax (char-before)) '(?\  ?>)))
                   (incf arg-index))
               (ignore-errors
                 (backward-sexp 1))




More information about the slime-cvs mailing list