[slime-devel] Re: Good and bad things about SLIME

Christophe Rhodes csr21 at cam.ac.uk
Fri Dec 19 09:47:26 UTC 2003


Luke Gorrie <luke at bluetail.com> writes:

> Helmut Eller <e9626484 at stud3.tuwien.ac.at> writes:
>
>> How about:
>> 
>> (defun user-init-file ()
>>   "Return the name of the user init file or nil."
>>   (let ((home (user-homedir-pathname)))
>>     (and (probe-file home)
>>          (probe-file (format nil 
>>                              #-mswindows "~A/.swank.lisp"
>>                              #+mswindows "~A\_swank.lsp"
>>                              (namestring (truename home)))))))
>
> But surely the pathname of a directory can be extended to refer to a
> file in a portable way. Anyone know the right way? (Hi Christophe! :-)

Bah.

This might not work, because sadly the #\. character is generally
considered to be a separator between name and type.  That is a whole
nother rant, which I won't go into here.

The most likely to work is
  (let ((home (user-homedir-pathname)))
    (probe-file (merge-pathnames 
                 (make-pathname :name #+win "_swank" #-win ".swank"
                                :type #+win "lsp" #-win "lisp")
                 home)))
but we're into dangerous territory here.  I'm afraid the only thing I
can suggest is try the above, and if it doesn't work on a Windows
implementation someone cares about, complain bitterly.

Cheers,

Christophe
-- 
http://www-jcsu.jesus.cam.ac.uk/~csr21/       +44 1223 510 299/+44 7729 383 757
(set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
(defvar b "~&Just another Lisp hacker~%")    (pprint #36rJesusCollegeCambridge)





More information about the slime-devel mailing list