[slime-devel] Patch for slime-load-file

Matthias Koeppe mkoeppe+slime at mail.math.uni-magdeburg.de
Fri Dec 2 15:42:16 UTC 2005


Any objections to this proposed change?  (BTW, what's the rationale of
stripping the filename extension here?)

2005-12-02  Matthias Koeppe  <mkoeppe at mail.math.uni-magdeburg.de>

	* slime.el (slime-load-file): Strip the extension from the file
	name of the current buffer only if it is ".lisp".  Much more
	convenient when you try to load the .asd file in the current
	buffer. 

--- slime.el.~1.566.~	2005-12-01 13:32:54.000000000 +0100
+++ slime.el	2005-12-02 16:37:38.678149000 +0100
@@ -6520,9 +6520,13 @@
   (interactive (list 
 		(read-file-name "Load file: " nil nil
 				nil (if (buffer-file-name)
-                                        (file-name-sans-extension
-                                         (file-name-nondirectory 
-                                          (buffer-file-name)))))))
+                                        (let ((file-name 
+                                               (file-name-nondirectory 
+                                                (buffer-file-name))))
+                                          (if (string= (file-name-extension file-name)
+                                                       "lisp")
+                                              (file-name-sans-extension file-name)
+                                            file-name))))))
   (let ((lisp-filename (slime-to-lisp-filename (expand-file-name filename))))
     (slime-eval-with-transcript `(swank:load-file ,lisp-filename))))
 
-- 
Matthias Koeppe -- http://www.math.uni-magdeburg.de/~mkoeppe



More information about the slime-devel mailing list