Luke Gorrie luke@bluetail.com writes:
Helmut Eller e9626484@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