From: Christophe Rhodes Date: Fri, 1 Oct 2010 18:56:26 +0000 (+0100) Subject: implement swank:default-directory and swank:set-default-directory X-Git-Url: http://christophe.rhodes.io/gitweb/?p=swankr.git;a=commitdiff_plain;h=843d2b6fcbc794e06e2fb5e9b2842175ffcb7ec5 implement swank:default-directory and swank:set-default-directory It was surprisingly hard to intuit getwd() and setwd(), what with apropos("dir") and apropos("cwd") failing. Nevertheless, they exist and function, so use them for the interface (but not slimefun) functions. --- diff --git a/TODO.org b/TODO.org index 3dd5db2..4dc1cde 100644 --- a/TODO.org +++ b/TODO.org @@ -3,7 +3,7 @@ #+EMAIL: csr21@cantab.net #+OPTIONS: H:2 * Protocol requests -** core slimefuns [29/93] +** core slimefuns [31/95] - [ ] ping - [X] create-repl - [ ] create-listener @@ -97,6 +97,8 @@ - [ ] update-indentation-information - [X] frame-source-location (NB: not currently a slimefun) - [X] buffer-first-change (NB: not currently a slimefun) + - [X] default-directory (NB: not currently a slimefun) + - [X] set-default-directory (NB: not currently a slimefun) ** swank-presentations [4/5] - [X] lookup-presented-object - [X] lookup-presented-object-or-lose diff --git a/swank.R b/swank.R index 4af51d1..5fe20bb 100644 --- a/swank.R +++ b/swank.R @@ -613,3 +613,12 @@ emacsInspect.numeric <- function(numeric) { object <- get(name, envir=frame) inspectObject(slimeConnection, object) } + +`swank:default-directory` <- function(slimeConnection, sldbState) { + getwd() +} + +`swank:set-default-directory` <- function(slimeConnection, sldbState, directory) { + setwd(directory) + `swank:default-directory`(slimeConnection, sldbState) +}