Christophe Weblog Wiki Code Publications Music
swankr.git
9 years agoupdate protocol version to 2014-09-13
Christophe Rhodes [Sat, 20 Sep 2014 12:52:16 +0000 (13:52 +0100)]
update protocol version to 2014-09-13

9 years agosupport new `swank-repl:...` protocol (as well as old protocol)
Christophe Rhodes [Sat, 20 Sep 2014 12:52:00 +0000 (13:52 +0100)]
support new `swank-repl:...` protocol (as well as old protocol)

9 years agonew function `swank:init-presentations`
Christophe Rhodes [Sat, 20 Sep 2014 12:51:35 +0000 (13:51 +0100)]
new function `swank:init-presentations`

Set up the REPL reporting function in it, not at toplevel

9 years agoadd `swank:apropos-list-for-emacs`
Christophe Rhodes [Tue, 15 Jul 2014 18:42:33 +0000 (19:42 +0100)]
add `swank:apropos-list-for-emacs`

and also `swank:describe-definition-for-emacs`, helping to make it
useful.  It's still a bit weird with the confusion between name of
thing, name of help file, and so on (and also because
describe-definition-for-emacs must return a definition kind from a
restricted set defined in base slime) but it's basically working.

9 years agoadd `swank:clear-repl-variables`
Christophe Rhodes [Tue, 15 Jul 2014 18:40:57 +0000 (19:40 +0100)]
add `swank:clear-repl-variables`

null implementation (we don't have any repl variables)

10 years agoimplement new slimefun swank:lookup-and-save-presented-object-or-lose
Christophe Rhodes [Sun, 20 Apr 2014 19:43:31 +0000 (20:43 +0100)]
implement new slimefun swank:lookup-and-save-presented-object-or-lose

For better presentations

10 years agowe did slime-c-p-c completion a while ago
Christophe Rhodes [Sun, 20 Apr 2014 19:42:53 +0000 (20:42 +0100)]
we did slime-c-p-c completion a while ago

10 years agoimplement swank-c-p-c
Christophe Rhodes [Fri, 14 Mar 2014 16:26:35 +0000 (16:26 +0000)]
implement swank-c-p-c

now users with c-p-c completion style can rejoice!  Matching is a little
hacky, but not too surprising.

10 years agomake it work with org-mode 8
Christophe Rhodes [Sat, 11 Jan 2014 19:55:09 +0000 (19:55 +0000)]
make it work with org-mode 8

(no, don't preserve workingness with org-mode 7.  I bet this comes
back to bite me.)

10 years agorecord resolutions of things in BUGS and TODO
Christophe Rhodes [Sat, 11 Jan 2014 16:47:26 +0000 (16:47 +0000)]
record resolutions of things in BUGS and TODO

Adjust the README instructions to have --interactive in the R
startup invocation, so base graphics display automatically.

10 years agoupdate README for new slime location
Christophe Rhodes [Sat, 11 Jan 2014 16:34:17 +0000 (16:34 +0000)]
update README for new slime location

10 years ago`swank:describe-function` and `swank:describe-symbol` implementations
Christophe Rhodes [Sat, 11 Jan 2014 14:40:45 +0000 (14:40 +0000)]
`swank:describe-function` and `swank:describe-symbol` implementations

from Philipp Marek, about an eternity ago.

11 years agomore srcref frobbing
Christophe Rhodes [Thu, 29 Nov 2012 14:50:08 +0000 (14:50 +0000)]
more srcref frobbing

I do not pretend to understand whether this is new, but in 2.14
parsing an expression, in addition to adding srcref attributes to the
results of the parse, can result in actual srcref elements being in
the results.  Those srcrefs also need to be frobbed so that display of
functions at the repl works properly.  (I do think this worked in 2.12
without this extra frobbing, but I am totally prepared to admit that I
can't really remember).

Since we're on the case, also frob things that look like srcrefs but
aren't under "srcref" attributes, such as "wholeSrcref"s

11 years agofix compilation of x[y,]
Christophe Rhodes [Tue, 20 Nov 2012 22:36:39 +0000 (22:36 +0000)]
fix compilation of x[y,]

Oh boy.  I do not pretend to totally understand what is going on, but
what seemed to be happening is that somehow when walking the parse
tree to adjust srcrefs to the real file position rather than the
string position, the `empty' space in x[y,] was turning from a
zero-element name to a missing object, and then subsequent attempts to
evaluate the missing object (or even return it) were failing.

The workaround is to short-circuit the process for name objects, which
are atomic and (empirically) do not have srcrefs attached anyway and
so can be returned without modification.

11 years agofix null implementation of operator-arglist
Christophe Rhodes [Mon, 17 Sep 2012 11:54:06 +0000 (12:54 +0100)]
fix null implementation of operator-arglist

actually return a list of two elements, not a bare string

11 years agosome elisp code that slime/swankr users probably want
Christophe Rhodes [Tue, 1 May 2012 14:20:55 +0000 (15:20 +0100)]
some elisp code that slime/swankr users probably want

Should try to find out how to have it loaded automatically

11 years agomake inspector printing more reasonable
Christophe Rhodes [Tue, 1 May 2012 14:20:25 +0000 (15:20 +0100)]
make inspector printing more reasonable

I don't yet know what's right, but it's fairly nonsensical to have
"[1] " prepending every label and value, so use prin1ToString

11 years agorework `swank:simple-completions`
Christophe Rhodes [Sun, 29 Apr 2012 13:15:22 +0000 (14:15 +0100)]
rework `swank:simple-completions`

In the process, implement looking up foo$bar$baz, and passing those
completions back.  It's not completely robust to somewhat exotic
syntax, as it assumes that the text being completed can be used
directly as character vectors naming objects or fields; it is good
enough to get started, and now a lot less annoying to
use (particularly when lots of fields have underscores in them...)

11 years agolog wishlist completion bug
Christophe Rhodes [Sun, 29 Apr 2012 13:11:48 +0000 (14:11 +0100)]
log wishlist completion bug

Also note some other bugs as fixed.

11 years agodeclare a version in `swank:connection-info`
Christophe Rhodes [Tue, 24 Apr 2012 12:39:47 +0000 (13:39 +0100)]
declare a version in `swank:connection-info`

Useful both for me, to track what slime version is most likely to be
maximally compatible, and for SLIMV users, which dispatch on the
version to know whether the protocol is byte-count-based or
character-count-based.

11 years agoimplement `swank:operator-arglist` properly
Christophe Rhodes [Tue, 24 Apr 2012 12:38:09 +0000 (13:38 +0100)]
implement `swank:operator-arglist` properly

Now that slime-operator-at-point is overrideable, I can even test this
from within Emacs -- but thanks to Philipp Marek for implementing this
in his SLIMV-based environment first.

11 years agofix bug #21
Christophe Rhodes [Mon, 23 Apr 2012 10:33:44 +0000 (11:33 +0100)]
fix bug #21

%in% needs a `vector' first argument, so make it so, listifying
anything that isn't already a vector.  (Note: there seem to be plenty
of non-vector first arguments that work, such as
as.Date("2012-01-01"), which returns FALSE to is.vector() -- but the new
code seems to get that right anyway, based on very limited testing.

11 years agolog bug #21, regarding inspection of environments
Christophe Rhodes [Mon, 23 Apr 2012 10:17:55 +0000 (11:17 +0100)]
log bug #21, regarding inspection of environments

Reported by Philipp Marek

12 years agolog and fix bug #20: infinite errors on disconnect.
Christophe Rhodes [Thu, 15 Dec 2011 21:13:57 +0000 (21:13 +0000)]
log and fix bug #20: infinite errors on disconnect.

Check for a zero-element character vector return from readChar.  (This
is not documented as the EOF return value, no, but it makes sense).

Also commit bug reports #18 and #19, and some README rearrangement.

12 years agogive us a chance with utf-8
Christophe Rhodes [Fri, 9 Dec 2011 18:20:04 +0000 (18:20 +0000)]
give us a chance with utf-8

Calculate the length of the output to emacs using nchar(type="bytes")

This makes help files sort-of work again

12 years agolog the external-format / encoding bug
Christophe Rhodes [Fri, 9 Dec 2011 10:49:13 +0000 (10:49 +0000)]
log the external-format / encoding bug

12 years agopass an :encoding stanza in the connection information
Christophe Rhodes [Fri, 9 Dec 2011 10:44:36 +0000 (10:44 +0000)]
pass an :encoding stanza in the connection information

Allows slime-repl to start again.  I've said "utf-8-unix" but that is
almost certainly a lie; I have no real idea how R handles encodings of
text.  Simply passing in "ë" to the R slime repl breaks things without
too much effort.

12 years agodon't print out "locals" from the global environment
Christophe Rhodes [Sun, 23 Oct 2011 09:54:19 +0000 (10:54 +0100)]
don't print out "locals" from the global environment

This is important because e.g. the repl evaluation happens in the
global environment, so errors on code called from the repl will pull
up a backtrace with that evaluation frame, which can be inspected for
locals.  But printing out all the locals is a hugely expensive and not
helpful thing to do.

12 years agofix for visible values from region and interactive eval
Christophe Rhodes [Sun, 23 Oct 2011 09:51:33 +0000 (10:51 +0100)]
fix for visible values from region and interactive eval

editing thinko: need tmp$value (not just value)

12 years agofix swank-media repl-result-maker for complex
Christophe Rhodes [Sun, 23 Oct 2011 09:50:16 +0000 (10:50 +0100)]
fix swank-media repl-result-maker for complex

There ought to be some way of catching this mistake, which is passing
a non-length-1 vector to the swank functions, which then vectorise and
confuse the event stream.

12 years agolog a couple more bugs
Christophe Rhodes [Sun, 23 Oct 2011 09:48:55 +0000 (10:48 +0100)]
log a couple more bugs

12 years agocatch errors during printing of frame locals
Christophe Rhodes [Mon, 19 Sep 2011 13:06:23 +0000 (14:06 +0100)]
catch errors during printing of frame locals

tryCatch is R's handler-case.  (Spent some time wondering why
withCallingHandlers wasn't working, but that's handler-bind.)

12 years agolog some more bugs
Christophe Rhodes [Mon, 19 Sep 2011 13:05:43 +0000 (14:05 +0100)]
log some more bugs

12 years agoescape names when searching for completions
Christophe Rhodes [Tue, 13 Sep 2011 21:26:12 +0000 (22:26 +0100)]
escape names when searching for completions

otherwise extended regexp metacharacters, particularly ".", get
interpreted as those metacharacters rather than literals.  (bug #12)

12 years agosupport ?help buffers
Christophe Rhodes [Tue, 13 Sep 2011 11:40:20 +0000 (12:40 +0100)]
support ?help buffers

use new fancy :popup-buffer event in slime-media.

12 years agolog some more bugs
Christophe Rhodes [Tue, 13 Sep 2011 11:39:05 +0000 (12:39 +0100)]
log some more bugs

12 years agodeal with 0 or multiple expressions at the repl
Christophe Rhodes [Sat, 10 Sep 2011 22:58:36 +0000 (23:58 +0100)]
deal with 0 or multiple expressions at the repl

It's easy really; just iterate over expressions.  Resolves bug #10.

12 years agoupdate BUGS file
Christophe Rhodes [Sat, 10 Sep 2011 22:46:59 +0000 (23:46 +0100)]
update BUGS file

We've resolved and :FIXED: several.  Log a bug related to repl handling
of multiple expressions.

12 years agouse withVisible() in appropriate places
Christophe Rhodes [Sat, 10 Sep 2011 08:23:25 +0000 (09:23 +0100)]
use withVisible() in appropriate places

Makes C-c C-r substantially less painful, and also produces slightly
fewer surprises at the REPL.  (resolves #5)

12 years agouse a similar repl result method in swank-media.R for ggplot objects
Christophe Rhodes [Fri, 9 Sep 2011 20:46:01 +0000 (21:46 +0100)]
use a similar repl result method in swank-media.R for ggplot objects

Should refactor (and provide width/height options)

12 years agolog wishlist bug #9 (wanting help() and ? to work)
Christophe Rhodes [Fri, 9 Sep 2011 20:44:53 +0000 (21:44 +0100)]
log wishlist bug #9 (wanting help() and ? to work)

12 years agoprevious commit sorted out #8 (filesystem-location-independence)
Christophe Rhodes [Fri, 9 Sep 2011 20:44:34 +0000 (21:44 +0100)]
previous commit sorted out #8 (filesystem-location-independence)

12 years agomake contribs load when the working directory isn't swankr's
Christophe Rhodes [Sat, 20 Aug 2011 08:57:50 +0000 (09:57 +0100)]
make contribs load when the working directory isn't swankr's

depends on swank.R itself being source()d with chdir=TRUE, but doesn't
break any previously-working use case.

13 years agoupdate BUGS and TODO
Christophe Rhodes [Wed, 6 Apr 2011 08:14:46 +0000 (09:14 +0100)]
update BUGS and TODO

13 years agoenough support for emacs/slim to start swank for itself
Christophe Rhodes [Wed, 6 Apr 2011 08:13:30 +0000 (09:13 +0100)]
enough support for emacs/slim to start swank for itself

There's a race condition, I think, in between writing the socket port
and running the socket server; it might be as simple as reordering the
writing and the socket opening, but strange things happened once when
I did that.

13 years agoimplement swank:interactive-eval-region
Christophe Rhodes [Wed, 6 Apr 2011 08:11:08 +0000 (09:11 +0100)]
implement swank:interactive-eval-region

Because of our vaguely dodgy heuristic for finding the "defun" to
evaluate, C-c C-c is not terribly useful.  This allows at least C-c
C-r to be used without thinking.

13 years agofix swank:compile-file-for-emacs when loadp is true
Christophe Rhodes [Wed, 6 Apr 2011 07:59:05 +0000 (08:59 +0100)]
fix swank:compile-file-for-emacs when loadp is true

also retain source information in swank:load-file for maximum emacs
goodness.

13 years agosupport translation of t and nil
Christophe Rhodes [Wed, 6 Apr 2011 07:57:45 +0000 (08:57 +0100)]
support translation of t and nil

Parse them into TRUE and FALSE in the lisp->R translator

13 years agoimplement swank:quit-lisp
Christophe Rhodes [Wed, 6 Apr 2011 07:55:46 +0000 (08:55 +0100)]
implement swank:quit-lisp

13 years agoabsolutify some more source file finding
Christophe Rhodes [Wed, 6 Apr 2011 07:49:34 +0000 (08:49 +0100)]
absolutify some more source file finding

13 years agoexperiment with different printing methods (using swank-media)
Christophe Rhodes [Wed, 6 Apr 2011 07:48:33 +0000 (08:48 +0100)]
experiment with different printing methods (using swank-media)

13 years agoremove debugging code from swank-presentations
Christophe Rhodes [Wed, 6 Apr 2011 07:47:23 +0000 (08:47 +0100)]
remove debugging code from swank-presentations

13 years agoadd .htaccess for utf-8 html encoding
Christophe Rhodes [Fri, 8 Oct 2010 11:12:02 +0000 (12:12 +0100)]
add .htaccess for utf-8 html encoding

13 years agocapture output from evaluating swank requests
Christophe Rhodes [Fri, 8 Oct 2010 11:05:49 +0000 (12:05 +0100)]
capture output from evaluating swank requests

This fixes bug #1.  It is somewhat on the risky side given that there
are current known protocol problems in the presence of non-ASCII
encodings, but it does make working in the slime repl much more
pleasant.

13 years agolog another wishlist bug
Christophe Rhodes [Fri, 8 Oct 2010 11:03:05 +0000 (12:03 +0100)]
log another wishlist bug

This time about visibility of evaluation results.

13 years agoimprove html export of org files
Christophe Rhodes [Fri, 8 Oct 2010 11:01:30 +0000 (12:01 +0100)]
improve html export of org files

Allow ="foo"= to be exported as code.

13 years agowebup Makefile target
Christophe Rhodes [Fri, 8 Oct 2010 09:14:15 +0000 (10:14 +0100)]
webup Makefile target

for no better reason than my convenience

13 years agosrcrefs in swank:compile-string-for-emacs
Christophe Rhodes [Fri, 8 Oct 2010 09:12:38 +0000 (10:12 +0100)]
srcrefs in swank:compile-string-for-emacs

Wow, this was hard.  parse() constructs a vector with mode
"expression", consisting of multiple, possibly nested calls.
Scattered throughout this structure are srcrefs with absolute
locations.  This means that we need to walk the parsed data structure
and adjust every srcref that we can find, giving it an offset based on
the location information passed to compile-string-for-emacs (which
requires bleeding-edge 2010-10-08 slime, because earlier versions
don't pass line/column information in the position argument).

But we can't simply adjust the "srcref" attribute on our parsed data
structure, because R tries very hard to be pure.  Instead we need to
return a copy with the right modifications (but preserving everything
else of importance).  It's straightforward once you know how, but
there were many painful missteps to get to this point.  Still, now
M-. works on function names assigned with C-c C-c in source buffers.

13 years agoadd tags to bugs
Christophe Rhodes [Thu, 7 Oct 2010 22:16:01 +0000 (23:16 +0100)]
add tags to bugs

13 years agolog a bug in multibyte character handling
Christophe Rhodes [Thu, 7 Oct 2010 22:12:08 +0000 (23:12 +0100)]
log a bug in multibyte character handling

1:£ crashes the swank connection (and is fairly easy to mistype when
demoing)

13 years agobetter swank:find-definitions-for-emacs
Christophe Rhodes [Thu, 7 Oct 2010 22:11:16 +0000 (23:11 +0100)]
better swank:find-definitions-for-emacs

In particular, include enough of a kludge to be able to handle both
relative and absolute paths.

13 years agoless debugging output cruft in `swank:frame-locals-and-catch-tags`
Christophe Rhodes [Thu, 7 Oct 2010 22:09:59 +0000 (23:09 +0100)]
less debugging output cruft in `swank:frame-locals-and-catch-tags`

13 years agomore working `swank:compile-file-for-emacs`
Christophe Rhodes [Thu, 7 Oct 2010 22:09:09 +0000 (23:09 +0100)]
more working `swank:compile-file-for-emacs`

Firstly, only parse, don't source, as that seems to be the
protocol (the emacs side is responsible for requesting a load if
desired).  Secondly, the protocol is also to return a
compilation-result structure rather than just TRUE, so do that too.

13 years agolog issue with srcref in swank:compile-string-for-emacs
Christophe Rhodes [Fri, 1 Oct 2010 19:21:20 +0000 (20:21 +0100)]
log issue with srcref in swank:compile-string-for-emacs

13 years agoimplement swank:load-file and swank:compile-file-for-emacs
Christophe Rhodes [Fri, 1 Oct 2010 18:58:33 +0000 (19:58 +0100)]
implement swank:load-file and swank:compile-file-for-emacs

Easy, peasy.  The only trick here is to use parse() in the case that
compile-file-for-emacs is not being asked to load the `compiled' file.

13 years agoimplement swank:default-directory and swank:set-default-directory
Christophe Rhodes [Fri, 1 Oct 2010 18:56:26 +0000 (19:56 +0100)]
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.

13 years agoconvenience Makefile for generating html from org files
Christophe Rhodes [Fri, 1 Oct 2010 18:20:07 +0000 (19:20 +0100)]
convenience Makefile for generating html from org files

13 years agocreate BUGS and TODO files
Christophe Rhodes [Fri, 1 Oct 2010 16:54:36 +0000 (17:54 +0100)]
create BUGS and TODO files

Link to them from README for webby goodness.  (Actually for webby
goodness I have to call them BUGS.org and TODO.org, *sigh*).

13 years agoupdate README for swank-media information
Christophe Rhodes [Fri, 1 Oct 2010 16:34:05 +0000 (17:34 +0100)]
update README for swank-media information

13 years agosort out printing functions
Christophe Rhodes [Fri, 1 Oct 2010 15:18:24 +0000 (16:18 +0100)]
sort out printing functions

R has capture.output as equivalent to with-output-to-string, so use it.

printToString, used by the slime-repl, now reverts back to calling
print.  New function prin1ToString, used by swank:interactive-eval and
swank:eval-and-grab-output, uses deparse.

13 years agoR implementation of the swank side of the (brand-new) slime-media contrib
Christophe Rhodes [Thu, 16 Sep 2010 20:01:25 +0000 (21:01 +0100)]
R implementation of the swank side of the (brand-new) slime-media contrib

Define a generic function to be used with the new
makeReplResultFunction hook, with an implementation using png files
for trellis objects.

13 years agonew makeReplResultFunction hook
Christophe Rhodes [Thu, 16 Sep 2010 19:59:46 +0000 (20:59 +0100)]
new makeReplResultFunction hook

default makeReplResult function doing the standard
(:write-string value :repl-result) thing for the REPL.

13 years agoimplement swank:eval-string-in-frame
Christophe Rhodes [Sun, 12 Sep 2010 17:06:26 +0000 (18:06 +0100)]
implement swank:eval-string-in-frame

Reified environments make quite a lot of this fairly easy...

13 years agoimplement swank:inspect-current-condition and swank:inspect-frame-var
Christophe Rhodes [Sun, 12 Sep 2010 16:40:48 +0000 (17:40 +0100)]
implement swank:inspect-current-condition and swank:inspect-frame-var

13 years agoimplement a default method for emacsInspect
Christophe Rhodes [Sun, 12 Sep 2010 16:40:25 +0000 (17:40 +0100)]
implement a default method for emacsInspect

Stands a chance of making the inspector not utterly annoying

13 years agoimplement swank:inspector-eval
Christophe Rhodes [Sat, 11 Sep 2010 09:58:10 +0000 (10:58 +0100)]
implement swank:inspector-eval

It took me quite some time to remember that parse returns a list of
expressions rather than just a single expression...

13 years agoimplement swank:inspector-pop and swank:inspector-next
Christophe Rhodes [Fri, 10 Sep 2010 21:53:44 +0000 (22:53 +0100)]
implement swank:inspector-pop and swank:inspector-next

Wow, nearly working.  There's some way of causing R to get into the
proper debugger; not sure how to reproduce it yet.

13 years agofix one multiple-string bug in the inspector
Christophe Rhodes [Thu, 9 Sep 2010 23:12:52 +0000 (00:12 +0100)]
fix one multiple-string bug in the inspector

13 years agoslightly more working inspector
Christophe Rhodes [Thu, 9 Sep 2010 22:28:11 +0000 (23:28 +0100)]
slightly more working inspector

Use an environment for istate rather than a list

implement swank:inspector-nth-part and swank:inspect-nth-part

13 years agoimplement `swank:quit-inspector`
Christophe Rhodes [Thu, 9 Sep 2010 15:31:17 +0000 (16:31 +0100)]
implement `swank:quit-inspector`

13 years agothe beginnings of an inspector
Christophe Rhodes [Thu, 9 Sep 2010 09:38:53 +0000 (10:38 +0100)]
the beginnings of an inspector

Implement enough that C-c I begins to work, at least for values like
list(1,2,3).  The resulting inspector on the emacs side apparently has
no features, and an error message results on quitting the inspector
because I've only implemented `swank:init-inspector`, and not
`swank:quit-inspector`.  Still, good enough to checkpoint.

13 years agoimplement withRetryRestart
Christophe Rhodes [Tue, 7 Sep 2010 07:38:19 +0000 (08:38 +0100)]
implement withRetryRestart

Use it in swank:interactive-eval and swank:eval-and-grab-output

13 years agoimplement withOutputToString
Christophe Rhodes [Tue, 7 Sep 2010 07:27:59 +0000 (08:27 +0100)]
implement withOutputToString

Possibly, anyway.  I think the semantics are right.  Use it in
printToString and in swank:eval-and-grab-output.

13 years agoswank:value-for-editing and swank:commit-edited-value
Christophe Rhodes [Fri, 3 Sep 2010 16:03:08 +0000 (17:03 +0100)]
swank:value-for-editing and swank:commit-edited-value

These are (in principle, at least) really, really easy.

13 years agoalternative printing for the REPL
Christophe Rhodes [Fri, 3 Sep 2010 07:10:09 +0000 (08:10 +0100)]
alternative printing for the REPL

instead of using print(), use str().  Also, be even more cautious
about cleaning up in printToString; previously, errors in printing
would lead to a sink to a closed fifo...

Printing is still not really right, and I forsee that we will end up
writing our own printer to get something more lispy.  But at least
this approach tends not to dump huge tables into the REPL.

13 years agointegrate into R's event loop, possibly
Christophe Rhodes [Fri, 3 Sep 2010 07:07:43 +0000 (08:07 +0100)]
integrate into R's event loop, possibly

in readPacket, call socketSelect() before actually trying to read on
the connection.  This seems to allow R to update graphics windows and
other such niceties.

It would be nice to be able to preserve the (inferior) R REPL as well,
but I haven't yet discovered whether that's possible.

13 years agoimplement swank:find-definitions-for-emacs
Christophe Rhodes [Wed, 1 Sep 2010 10:11:52 +0000 (11:11 +0100)]
implement swank:find-definitions-for-emacs

A simple implementation, only looking for a single function
definition (no methods, whether S3 or S4, or indeed anything else).
Enough to support M-., though.

13 years agouse srcfile$wd when going to source for an sldb frame
Christophe Rhodes [Wed, 1 Sep 2010 10:11:06 +0000 (11:11 +0100)]
use srcfile$wd when going to source for an sldb frame

it worked before while emacs and R were started with the same working
directory; this is not always going to be the case.

13 years agosupport swank:clear-repl-results in swank-presentations
Christophe Rhodes [Tue, 31 Aug 2010 08:02:14 +0000 (09:02 +0100)]
support swank:clear-repl-results in swank-presentations

This makes my worry about lacking weak hash tables a bit less
pressing.

13 years agoinitial implementation of support for REPL presentations
Christophe Rhodes [Tue, 31 Aug 2010 07:54:54 +0000 (08:54 +0100)]
initial implementation of support for REPL presentations

There's a lot here that's ugly, unfinished or just downright horrible.
Most notably, presentation support depends on swank-side read-time
evaluation (indicated with Common Lisp syntax, which hilariously is a
comment in R).  We can't support that in general, but we can
special-case the presentation-specific operator.

But then the next difficulty comes along; actually performing that
read-time evaluation needs to happen in a different environment than
the evaluation of the REPL form.  In order to achieve this, we abuse
bquote() the equivalent of Lisp's backquote facility, by calling what
in CL terms would be its macro-function on the parsed, preprocessed
expression; only after doing that (and hence resolving the `read-time'
evaluations) do we evaluate the call itself.

The implementation of presentation protocol messages is also slightly
ugly; having to implement cl:nth-value is particulraly horrible, but
the lack of weak references / weak tables in R (at least as far as I
can tell at the moment) is a cause of niggling concern.

13 years agoA proper implementation of swank:swank-require
Christophe Rhodes [Mon, 30 Aug 2010 20:45:48 +0000 (21:45 +0100)]
A proper implementation of swank:swank-require

We can do this nicely now that we have an evaluator of :emacs-rex
forms that can cope with quote.

13 years agoimplement a mini code-walker to support nested function calls in :emacs-rex
Christophe Rhodes [Mon, 30 Aug 2010 20:42:59 +0000 (21:42 +0100)]
implement a mini code-walker to support nested function calls in :emacs-rex

This is all a bit horrible, but probably limited in maintenance headaches.

13 years agomake swank:listener-eval be a bit more like the CL version
Christophe Rhodes [Mon, 30 Aug 2010 18:55:59 +0000 (19:55 +0100)]
make swank:listener-eval be a bit more like the CL version

don't return (:ok (:values "string")); instead, send a separate
(:write-string "string" :repl-result) and return (:ok ())

13 years agouse an environment holding the Slime I/O connection
Christophe Rhodes [Mon, 30 Aug 2010 09:03:42 +0000 (10:03 +0100)]
use an environment holding the Slime I/O connection

Rather than having a bare io argument everywhere, encapsulate it in an
environment.  (An environment is just about the only thing I can find
in R that isn't copy-on-write; this isn't helpful for the i/o
connection, but will be once we start implementing inspectors and
presentations...)

13 years agoslightly clarified the relationship to ESS
Christophe Rhodes [Sat, 28 Aug 2010 19:18:14 +0000 (20:18 +0100)]
slightly clarified the relationship to ESS

In particular, be careful not to overclaim.  Motivated by preparing to
announce to the ESS mailing list.

13 years agoadd README
Christophe Rhodes [Thu, 26 Aug 2010 10:39:18 +0000 (11:39 +0100)]
add README

13 years agoAdd licence information to swank.R
Christophe Rhodes [Thu, 26 Aug 2010 10:36:30 +0000 (11:36 +0100)]
Add licence information to swank.R

Same terms as R itself: GNU GPLv2 or later version

13 years agoimplement swank:frame-source-location
Christophe Rhodes [Wed, 25 Aug 2010 17:14:38 +0000 (18:14 +0100)]
implement swank:frame-source-location

Now v in the debugger mostly works.

13 years agofactor out backtraceForEmacs() into `swank:backtrace`
Christophe Rhodes [Wed, 25 Aug 2010 17:14:19 +0000 (18:14 +0100)]
factor out backtraceForEmacs() into `swank:backtrace`

write `swank:debugger-info-for-emacs` out, and hence delete
debuggerInfoForEmacs().

Now wandering past the --more-- prompt in sldb gives an infinite
sequence of NULLs, but at least it's not a cascade of errors any more.

13 years agoimplement swank:interactive-eval and swank:eval-and-grab-output
Christophe Rhodes [Wed, 25 Aug 2010 14:57:56 +0000 (15:57 +0100)]
implement swank:interactive-eval and swank:eval-and-grab-output

This allows C-c : and C-u C-c : to work, modulo the printing of an
unnecessary [1].  The evaluation semantics of R are not what a Lisper might
expect; printToString(eval(parse(...))) does not necessarily perform the
evaluation before altering the output stream with sink() -- so capturing
all sorts of incidental output if something goes wrong.

This commit brought to you using C-c C-c.