summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Djurfeldt <djurfeldt@nada.kth.se>1997-08-24 03:39:47 +0000
committerMikael Djurfeldt <djurfeldt@nada.kth.se>1997-08-24 03:39:47 +0000
commit68aed3ea96dcce600044eab567bd8c231033d273 (patch)
tree6ba5ad1a3863428435b66f0e7f0af8fa59e2b96e
parent1c21502928f5394df8dc9258220a1d5348c3ec97 (diff)
downloadguile-68aed3ea96dcce600044eab567bd8c231033d273.tar.gz
* session.scm (vector-for-each): Removed.
(apropos): vector-for-each --> array-for-each. (apropos-internal): New function. Return list of accessible symbols matching regexp.
-rw-r--r--ice-9/ChangeLog23
-rw-r--r--ice-9/session.scm39
2 files changed, 52 insertions, 10 deletions
diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog
index becdb8fc5..24dbd3f8c 100644
--- a/ice-9/ChangeLog
+++ b/ice-9/ChangeLog
@@ -1,7 +1,22 @@
-Thu Aug 21 11:30:08 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
-
- * emacs.scm (emacs-load): New argument: interactivep: when
- non-false, send back results to Emacs.
+Sun Aug 24 01:03:10 1997 Mikael Djurfeldt <mdj@kenneth>
+
+ * session.scm (vector-for-each): Removed.
+ (apropos): vector-for-each --> array-for-each.
+ (apropos-internal): New function. Return list of accessible
+ symbols matching regexp.
+
+ * debug.scm (frame-number->index): New function. Convert frame
+ number (as displayed in the backtrace) to frame index (to be used
+ in stack-ref).
+
+ * emacs.scm (emacs-load): New arguments: interactivep: when
+ non-false, send back results to Emacs; colnum: Column number;
+ Use modules (ice-9 debug) and (ice-9 session);
+ (no-stack, no-source): New simple-actions;
+ (result-to-emacs): New procedure. Sends data to Emacs via the
+ result protocol;
+ (get-frame-source, emacs-select-frame, emacs-frame-eval,
+ emacs-symdoc): New procedures.
Wed Aug 20 13:21:11 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
diff --git a/ice-9/session.scm b/ice-9/session.scm
index 622e55e42..262eb82a3 100644
--- a/ice-9/session.scm
+++ b/ice-9/session.scm
@@ -27,11 +27,6 @@
(define (id x) x)
-(define (vector-for-each proc vector)
- (do ((i (+ -1 (vector-length vector)) (+ -1 i)))
- ((negative? i))
- (proc (vector-ref vector i))))
-
(define-public (apropos rgx . options)
"Search for bindings: apropos regexp {options= 'full 'shadow 'value}"
(if (zero? (string-length rgx))
@@ -60,7 +55,7 @@
)
(for-each
(lambda (obarray get-ref)
- (vector-for-each
+ (array-for-each
(lambda (oblist)
(for-each
(lambda (x)
@@ -86,3 +81,35 @@
obarray))
obarrays get-refs)))
modules))))
+
+(define-public (apropos-internal rgx)
+ "Return a list of accessible variable names."
+ (let ((match (make-regexp rgx))
+ (modules (cons (current-module)
+ (module-uses (current-module))))
+ (recorded (make-vector 61 '()))
+ (vars '(#f)))
+ (let ((last vars))
+ (for-each
+ (lambda (module)
+ (for-each
+ (lambda (obarray)
+ (array-for-each
+ (lambda (oblist)
+ (for-each
+ (lambda (x)
+ (if (and (regexp-exec match (car x))
+ (not (hashq-get-handle recorded (car x))))
+ (begin
+ (set-cdr! last (cons (car x) '()))
+ (set! last (cdr last))
+ (hashq-set! recorded (car x) #t))))
+ oblist))
+ obarray))
+ (if (or (eq? module the-scm-module)
+ (eq? module the-root-module))
+ (list (builtin-weak-bindings)
+ (builtin-bindings))
+ (list (module-obarray module)))))
+ modules))
+ (cdr vars)))