diff options
author | Keisuke Nishida <kxn30@po.cwru.edu> | 2001-04-25 13:24:45 +0000 |
---|---|---|
committer | Keisuke Nishida <kxn30@po.cwru.edu> | 2001-04-25 13:24:45 +0000 |
commit | 37052e6073d02208d599079c001762c515c25c6d (patch) | |
tree | 3b86b60b1b83070d0c0be93a7ba85b6a5766b351 | |
parent | 2d857fb1accfef2948063cf16ecde13f8b7fcd37 (diff) | |
download | guile-37052e6073d02208d599079c001762c515c25c6d.tar.gz |
Bug fixes.
-rw-r--r-- | emacs/guile-emacs.scm | 8 | ||||
-rw-r--r-- | emacs/guile.el | 14 |
2 files changed, 15 insertions, 7 deletions
diff --git a/emacs/guile-emacs.scm b/emacs/guile-emacs.scm index 7bc0ee785..08e56500e 100644 --- a/emacs/guile-emacs.scm +++ b/emacs/guile-emacs.scm @@ -84,9 +84,13 @@ (define (procedure-call name args) (let ((restp (memq '&rest args)) - (args (delq '&rest (delq '&optional args)))) + (args (map (lambda (a) `(let ((_t ,a)) + (if (guile-tokenp _t) + (cadr _t) + (list 'quote _t)))) + (delq '&rest (delq '&optional args))))) (if restp - `(list* ',name ,@args) + `(list 'apply ',name ,@args) `(list ',name ,@args)))) (let ((name (procedure-name proc)) diff --git a/emacs/guile.el b/emacs/guile.el index f27bc4b7c..267613440 100644 --- a/emacs/guile.el +++ b/emacs/guile.el @@ -23,8 +23,6 @@ ;;; Low level interface ;;; -(defvar guile-token "<guile>") - (defvar gulie-emacs-file (catch 'return (mapc (lambda (dir) @@ -45,6 +43,10 @@ (put 'guile-error 'error-conditions '(guile-error error)) (put 'guile-error 'error-message "Guile error") +(defvar guile-token-tag "<guile>") + +(defun guile-tokenp (x) (and (consp x) (eq (car x) guile-token-tag))) + (defun guile:eval (string adapter) (let ((output (guile-process-require adapter (concat "eval " string "\n") "channel> "))) @@ -58,7 +60,7 @@ (car (read-from-string (substring output (match-end 0))))) ;; token ((match-beginning 3) - (cons guile-token + (cons guile-token-tag (car (read-from-string (substring output (match-end 0)))))) ;; exception ((match-beginning 4) @@ -88,10 +90,12 @@ (defun guile-lisp-convert (x) (cond ((or (eq x true) (eq x false)) x) + ((null x) "'()") ((stringp x) (prin1-to-string x)) + ((guile-tokenp x) (cadr x)) ((consp x) - (if (eq (car x) guile-token) - (cadr x) + (if (null (cdr x)) + (list (guile-lisp-convert (car x))) (cons (guile-lisp-convert (car x)) (guile-lisp-convert (cdr x))))) (t x))) |