with a reference to the corresponding source. Unfortunately, emacs
only passes the buffer position in bytes (or maybe characters),
whereas R's srcrefs work with lines and columns.
-* OPEN #4 multibyte characters corrupt slime connection :NORMAL:
+* RESOLVED #4 multibyte characters corrupt slime connection :NORMAL:
Not in all circumstances (e.g. ="£"= is OK) but =1:£= fails in
slime-net-read-or-lose.
* RESOLVED #5 respect visibility of evaluated results :WISHLIST:FIXED:
* OPEN #16 ESS configuration :MINOR:
sorting out the function regexp at least, but generally reducing
dependence might be good.
-* OPEN #17 encoding / external-format confusion :NORMAL:
+* RESOLVED #17 encoding / external-format confusion :NORMAL:
We declare ourselves capable of handling utf-8-unix encoding, but
whether we actually do anything close to being correct is unclear.
(Almost certainly not; I suspect we naïvely use nchar() in places).
header <- readChunk(io, 6)
len <- strtoi(header, base=16)
payload <- readChunk(io, len)
- readSexpFromString(payload)
+ sexp <- readSexpFromString(payload)
+ sexp
}
readChunk <- function(io, len) {
- buffer <- readChar(io, len)
+ buffer <- readChar(io, len, useBytes=TRUE)
if(length(buffer) == 0) {
condition <- simpleCondition("End of file on io")
class(condition) <- c("endOfFile", class(condition))
signalCondition(condition)
}
- if(nchar(buffer) != len) {
- stop("short read in readChunk")
- }
+ ## FIXME: with the useBytes argument to readChar, it is normal for
+ ## the buffer returned to be fewer character than bytes were read,
+ ## given the possibility of multibyte characters. However, that
+ ## means we can’t detect at all the case where there is actually a
+ ## short read (though empirically the readChar call blocks rather
+ ## than returning early).
+ ##
+ ## if(nchar(buffer) != len) {
+ ## stop("short read in readChunk")
+ ## }
buffer
}