From 843d2b6fcbc794e06e2fb5e9b2842175ffcb7ec5 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Fri, 1 Oct 2010 19:56:26 +0100 Subject: [PATCH] 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. --- TODO.org | 4 +++- swank.R | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) 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) +} -- 2.30.2