X-Git-Url: https://git.hcoop.net/bpt/guile.git/blobdiff_plain/ef0d04e5c33654d70e66236746f9bcbb770bfde7..4adc302894d806d90a684cf099de1f28379ca8f6:/ice-9/emacs.scm diff --git a/ice-9/emacs.scm b/ice-9/emacs.scm index d814711e0..850571d42 100644 --- a/ice-9/emacs.scm +++ b/ice-9/emacs.scm @@ -1,4 +1,4 @@ -;;;; Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. +;;;; Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. ;;;; ;;;; This program is free software; you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by @@ -32,7 +32,8 @@ (define-module (ice-9 emacs) :use-module (ice-9 debug) :use-module (ice-9 threads) - :use-module (ice-9 session)) + :use-module (ice-9 session) + :no-backtrace) (define emacs-escape-character #\sub) @@ -144,9 +145,10 @@ (result-to-emacs result))))) (loop (flush-whitespace %%load-port))) (begin - (load-acknowledge)))) - ) + (load-acknowledge))) + (set-port-filename! %%load-port #f))) ;reset port filename (lambda (key . args) + (set-port-filename! %%load-port #f) (cond ((eq? key 'end-of-chunk) (fluid-set! the-last-stack #f) (set! stack-saved? #t) @@ -168,7 +170,7 @@ (apply throw key args)))))) (define (emacs-eval-request form) - (result-to-emacs (eval form))) + (result-to-emacs (eval form (interaction-environment)))) ;;*fixme* Not necessary to use flags no-stack and no-source (define (get-frame-source frame) @@ -206,7 +208,8 @@ (define (format template . rest) (let loop ((chars (string->list template)) - (result '())) + (result '()) + (rest rest)) (cond ((null? chars) (list->string (reverse result))) ((char=? (car chars) #\%) (loop (cddr chars) @@ -215,8 +218,9 @@ (case (cadr chars) ((#\S) (object->string (car rest))) ((#\s) (object->string (car rest) display))))) - result))) - (else (loop (cdr chars) (cons (car chars) result)))))) + result) + (cdr rest))) + (else (loop (cdr chars) (cons (car chars) result) rest))))) (define (error-args->string args) (let ((msg (apply format (caddr args) (cadddr args)))) @@ -244,9 +248,9 @@ (define (emacs-symdoc symbol) (if (or (not (module-bound? (current-module) symbol)) - (not (procedure? (eval symbol)))) + (not (procedure? (eval symbol (interaction-environment))))) 'nil - (procedure-documentation (eval symbol)))) + (procedure-documentation (eval symbol (interaction-environment))))) ;;; A fix to get the emacs interface to work together with the module system. ;;;