commit c282a12e0fa704ffa396ffeef44fdca5c1a17c61
parent 2ba2874f114fc0137233634c8b56b9a0b045d0f8
Author: Tomas Hlavaty <tom@logand.com>
Date: Sat, 30 Apr 2011 14:26:36 +0200
better swank:connection-info
Diffstat:
M | swank-picolisp.l | | | 59 | ++++++++++++++++++++++++++++++++++++++++------------------- |
1 file changed, 40 insertions(+), 19 deletions(-)
diff --git a/swank-picolisp.l b/swank-picolisp.l
@@ -90,28 +90,49 @@
(de swank-emacs-rex (Sock Form Pkg Thread Id)
(swank-send-to-emacs Sock (list ':return (list ':ok (eval Form)) Id)) )
+(de lisp-implementation-type ()
+ (pack "PicoLisp" (if (== 64 64) 64 32)) )
+
+(de lisp-implementation-version ()
+ (in (path "@CHANGES")
+ (use (@X)
+ (when (match '("*" " " @D "p" "i" "c" "o" "L" "i" "s" "p" "-" @V)
+ (line) )
+ (pack @V) ) ) ) )
+
+(de lisp-implementation-program ()
+ (path "@p") ) ## TODO compute properly e.g. p|dbg|bin/picolisp
+
+(de machine-instance ()
+ (in '("uname" "-n")
+ (line T) ) )
+
+(de machine-type ()
+ (in '("uname" "-m")
+ (line T) ) )
+
+(de machine-version ()
+ (in "/proc/cpuinfo"
+ (pack (tail -13 (do 5 (line)))) ) )
+
(de swank:connection-info ()
(list
':pid *Pid
- ':style 'nil #NIL #"TODO style" #,(connection.communication-style c)
- ':encoding '(:coding-system "utf-8" #,(connection.coding-system c)
- :external-format "utf-8" #,(princ-to-string (connection.external-format c)) )
- )
- ':lisp-implementation '(:type "PicoLisp type" #,(lisp-implementation-type)
- :name "PicoLisp name" #,(lisp-implementation-type-name)
- :version "PicoLisp version" #,(lisp-implementation-version)
- :program "PicoLisp program" #,(lisp-implementation-program) )
- )
- ':machine '(:instance "X(machine-instance)"
- :type "X(machine-type)"
- :version "X(machine-version)" )
- ':features '(:hi :hello) #NIL #'(features-for-emacs)
- ':modules '("module1" "module2") #NIL #,*modules*
- ':package '(:name "PIL1" #,(package-name *package*)
- :prompt "pil1" #,(package-string-for-prompt *package*) )
- )
- ':version 'nil #NIL #,*swank-wire-protocol-version*
- ) )
+ ':style 'nil
+ ':encoding '(:coding-system "utf-8" :external-format "utf-8")
+ ':lisp-implementation (list
+ ':type (lisp-implementation-type)
+ ':name (lisp-implementation-type)
+ ':version (lisp-implementation-version)
+ ':program (lisp-implementation-program) )
+ ':machine (list
+ ':instance (machine-instance)
+ ':type (machine-type)
+ ':version (machine-version) )
+ ':features '(:dummy)
+ ':modules '("module1" "module2")
+ ':package '(:name "PIL1" :prompt "pil1")
+ ':version 'nil ) )
(de *Swank:autodoc-built-in . NIL)