<div dir="ltr"><br><div><div dir="ltr">I hope someone can help me with a few things I'm confused on.<div>I've trying to write a slime contrib (for the first time).</div><div><br></div><div>I have already written the common-lisp function which works fine.</div><div>But I want to write the elisp front-end to this function.</div><div>The elisp function should get the symbol at the point create a temporary file name,</div><div>then it should call the common lisp function passing those two arguments.</div><div>After the CL function returns, emacs should open the file named by the tmp file name.</div><div><br></div><div>There are several issues I'm not sure how to answer.</div><div><br></div><div>1. the symbol at the point has an implicit package name,  I want the CL function to receive the correct symbol.  E.g.  suppose the symbol is xyzzy which is CL parses as abc::xyzzy (because if an in-package earlier in the file),  I want the CL function called with 'abc::xyzzy not with 'CL::xyzzy.</div><div><br></div><div>2.  If I try to call the CL function using slime-eval with a string, then CL understand the correct symbol, but slime-eval returns t before the CL function returns, and when I call find-file, the file is not ready to open yet.</div><div><br></div><div>3.  If I try to call the CL function with slime-eval-async, then the CL function receives the wrong symbol: CL::xyzzy rather than abc::xyzzy.</div><div><br></div><div>4. I would like to put the .lisp file also in the contrib directory, but the CL code depends on c2mop. Does this pose a problem?  What do I need to assure that if a user loads the file that c2mop has</div><div>already been loaded?  I.e., is there an asd file I need to create or modify?</div><div><br></div><div>If someone could point me in the right direction, it would be great.</div><div><br></div><div>BTW here is the elisp function as I currently have it.</div><div><br></div><div><div><br></div><div><font face="monospace, monospace" size="1">(defun class-graph (class-name)</font></div><div><font face="monospace, monospace" size="1">  (interactive "P")</font></div><div><font face="monospace, monospace" size="1">  (let* ((class-name (or class-name</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">                 </span> (slime-symbol-at-point)))</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">    </span> (tmp-file (make-temp-file (format "%s-" class-name) nil ".png")))</font></div><div><font face="monospace, monospace" size="1">    (cond</font></div><div><font face="monospace, monospace" size="1">       ((slime-eval</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">    </span> (format "(class-graph:class-graph-for-slime '%s %S)" </font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">         </span> class-name</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">           </span> tmp-file))</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">   </span>;; this does not work, becasue tmp-file is not ready as class-graph-for-slime has not yet finished.</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">    </span>(find-file tmp-file)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">   </span>(image-mode-fit-frame))</font></div><div><font face="monospace, monospace" size="1">       (t</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">  </span>(error "failed to create graph in %s" tmp-file)))))</font></div><div><br></div></div></div><br></div></div>