[slime-cvs] CVS slime
CVS User heller
heller at common-lisp.net
Wed Dec 31 11:25:20 UTC 2008
Update of /project/slime/cvsroot/slime
In directory cl-net:/tmp/cvs-serv19358
Modified Files:
ChangeLog slime.el
Log Message:
* slime.el (slime-cd, slime-pwd): New commands.
(slime-change-directory): New function.
(slime-change-directory-hooks): New hook.
* inferior-slime.el (inferior-slime-change-directory): New
function.
(inferior-slime-init): Hook it in.
--- /project/slime/cvsroot/slime/ChangeLog 2008/12/31 11:25:02 1.1611
+++ /project/slime/cvsroot/slime/ChangeLog 2008/12/31 11:25:19 1.1612
@@ -25,6 +25,12 @@
2008-12-31 Helmut Eller <heller at common-lisp.net>
+ * slime.el (slime-cd, slime-pwd): New commands.
+ (slime-change-directory): New function.
+ (slime-change-directory-hooks): New hook.
+
+2008-12-31 Helmut Eller <heller at common-lisp.net>
+
* slime.el ([test] find-definition.2): Also fails for Lispworks.
([test] interrupt-at-toplevel, [test] interrupt-in-debugger): Those
don't work well if there's no REPL thread.
--- /project/slime/cvsroot/slime/slime.el 2008/12/31 11:25:03 1.1085
+++ /project/slime/cvsroot/slime/slime.el 2008/12/31 11:25:19 1.1086
@@ -4477,6 +4477,29 @@
(let ((lisp-filename (slime-to-lisp-filename (expand-file-name filename))))
(slime-eval-with-transcript `(swank:load-file ,lisp-filename))))
+(defvar slime-change-directory-hooks nil
+ "Hook run by `slime-change-directory'.
+The functions are called with the new (absolute) directory.")
+
+(defun slime-change-directory (directory)
+ "Make DIRECTORY become Lisp's current directory.
+Return whatever swank:set-default-directory returns."
+ (let ((dir (expand-file-name directory)))
+ (prog1 (slime-eval `(swank:set-default-directory
+ ,(slime-to-lisp-filename dir)))
+ (run-hook-with-args 'slime-change-directory-hooks dir))))
+
+(defun slime-cd (directory)
+ "Make DIRECTORY become Lisp's current directory.
+Return whatever swank:set-default-directory returns."
+ (interactive (list (read-directory-name "Directory: " nil nil t)))
+ (message "default-directory: %s" (slime-change-directory directory)))
+
+(defun slime-pwd ()
+ "Show Lisp's default directory."
+ (interactive)
+ (message "Directory %s" (slime-eval `(swank:default-directory))))
+
;;;; Profiling
More information about the slime-cvs
mailing list