[slime-cvs] CVS slime

trittweiler trittweiler at common-lisp.net
Thu Sep 27 12:56:42 UTC 2007


Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv22043

Modified Files:
	slime.el 
Log Message:

* slime.el (slime-filesystem-toplevel-directory): New function.
  Windows doesn't have a filesystem that is as hierarchical as the
  Unix' one. Reported by Carsten Blaauw and Stefan Kluehspies.
  (slime-file-name-merge-source-root): Use it.
  (slime-highlight-differences-in-dirname): Use it.


--- /project/slime/cvsroot/slime/slime.el	2007/09/20 23:45:10	1.874
+++ /project/slime/cvsroot/slime/slime.el	2007/09/27 12:56:40	1.875
@@ -4415,6 +4415,13 @@
           (beginning-of-sexp))
       (error (goto-char origin)))))
 
+(defun slime-filesystem-toplevel-directory ()
+  ;; Windows doesn't have a true toplevel root directory, and all
+  ;; filenames look like "c:/foo/bar/quux.baz" from an Emacs
+  ;; perspective anyway.
+  (if (memq system-type '(ms-dos windows-nt))
+      ""
+      (file-name-as-directory "/")))
 
 (defun slime-file-name-merge-source-root (target-filename buffer-filename)
   "Returns a filename where the source root directory of TARGET-FILENAME
@@ -4444,7 +4451,7 @@
                      (push target-dir target-suffix-dirs)
                      (let* ((target-suffix (concat-dirs target-suffix-dirs)) ; PUSH reversed for us!
                             (buffer-root   (concat-dirs (reverse (nthcdr pos buffer-dirs*)))))
-                       (return (concat (file-name-as-directory "/")
+                       (return (concat (slime-filesystem-toplevel-directory)
                                        buffer-root
                                        target-suffix
                                        (file-name-nondirectory target-filename))))))))))
@@ -4463,7 +4470,7 @@
     (let ((base-dirs (slime-split-string base-dirname "/" t))
           (contrast-dirs (slime-split-string contrast-dirname "/" t)))
       (with-temp-buffer
-        (loop initially (insert (file-name-as-directory "/"))
+        (loop initially (insert (slime-filesystem-toplevel-directory))
               for base-dir in base-dirs do
               (let ((pos (position base-dir contrast-dirs :test #'equal)))
                 (if (not pos)




More information about the slime-cvs mailing list