[slime-devel] [PATCH] operator-arglist

Terje Norderhaug terje at in-progress.com
Tue Jun 30 21:15:01 UTC 2009


The operator-arglist slimefun uses #'pprint-fill to format an arglist  
without enclosing parentheses. Unfortunately, for longer arglists, a  
consequence is that the output might be pretty printed based on the  
output width on the server lisp, potentially leading to unwanted  
linebreaks and whitespace in the result.

For example, using Clozure, evaluate operator-arglist for  
#'cl:directory:

(swank::operator-arglist "DIRECTORY" "COMMON-LISP")
=>
"(DIRECTORY PATH &KEY DIRECTORIES FILES ALL DIRECTORY-PATHNAMES
            INCLUDE-EMACS-LOCKFILES TEST FOLLOW-LINKS)"

Such results may require a cleanup to be presented by the client on  
one line or with the preferred width. It would be preferable to have  
the result single spaced and without linebreaks, leaving the  
formatting to the swank client:

"(DIRECTORY PATH &KEY DIRECTORIES FILES ALL DIRECTORY-PATHNAMES  
INCLUDE-EMACS-LOCKFILES TEST FOLLOW-LINKS)"

Here is a patch that  writes the function name and arglist as a list  
on a single line:

diff -u slime-2009-06-30/swank.lisp patch/swank.lisp
--- slime-2009-06-30/swank.lisp 2009-06-29 00:15:06.000000000 -0700
+++ patch/swank.lisp    2009-06-30 14:04:48.000000000 -0700
@@ -3005,7 +3005,7 @@
      (let ((args (arglist (parse-symbol name (guess-buffer-package  
package))))
            (*print-escape* nil))
        (cond ((eq args :not-available) nil)
-           (t (format nil "(~a ~/pprint-fill/)" name args))))))
+           (t (princ-to-string (cons name args)))))))


-- Terje Norderhaug






More information about the slime-devel mailing list