Jim Newton
12/2/2015 3:58:00 PM
>
> (defun call-lisp-function-with-temp-file (fname)
> (interactive "SCL function to call: ")
> (let ((temp-file (make-temp-file (format "/tmp/out-%d-%s-" (user-uid) fname)
> nil ".txt")))
> (slime-interactive-eval (format "(cl-user::call-with-file '%s %S)"
> fname temp-file))
> (find-file temp-file)))
>
>
> I'll leave it up to you to improve the user interface (take the default
> symbol from the point, complete with all the fbound symbols in the
> image, deal with packages, and integrate the whole as a slime-contrib.
>
Thanks, but not exactly what I need. But perhaps it contains the thins I need.
I don't want to call the function at the point. Rather I want to call a particular
function, passing the symbol named at the point to that function, along with a tmp file name.
Here is what I've tried so far.
(defun class-graph (class-name)
(interactive "P")
(let ((class-name (or class-name
(slime-symbol-at-point)))
(file-name "/tmp/graph.png"))
(when (slime-eval `(class-graph:class-graph-for-slime ',class-name ,file-name))
(find-file file-name))))
But this has a problem I don't understand:
Sometimes class-name is a string containing the printed rep of a fully qualified symbol such as "xyzzy::name", and sometimes it is simply the symbol-name, without the package. "name"
How can I get the name of the symbol, with the package prefix.
Perhaps your suggestion of using slime-interactive-eval is the key to solving this problem?