Christophe Weblog Wiki Code Publications Music
implement a default method for emacsInspect
authorChristophe Rhodes <csr21@cantab.net>
Sun, 12 Sep 2010 16:40:25 +0000 (17:40 +0100)
committerChristophe Rhodes <csr21@cantab.net>
Sun, 12 Sep 2010 16:40:25 +0000 (17:40 +0100)
Stands a chance of making the inspector not utterly annoying

swank.R

diff --git a/swank.R b/swank.R
index 3ab65ee..7ec3dea 100644 (file)
--- a/swank.R
+++ b/swank.R
@@ -533,6 +533,10 @@ emacsInspect <- function(object) {
   UseMethod("emacsInspect")
 }
 
+emacsInspect.default <- function(thing) {
+  c(list(paste("a ", class(thing)[[1]], sep=""), list(quote(`:newline`))))
+}
+
 emacsInspect.list <- function(list) {
   c(list("a list", list(quote(`:newline`))),
     mapply(function(name, value) { list(list(quote(`:line`), name, value)) },