* session.scm (vector-for-each): Removed.
authorMikael Djurfeldt <djurfeldt@nada.kth.se>
Sun, 24 Aug 1997 03:39:47 +0000 (03:39 +0000)
committerMikael Djurfeldt <djurfeldt@nada.kth.se>
Sun, 24 Aug 1997 03:39:47 +0000 (03:39 +0000)
(apropos): vector-for-each --> array-for-each.
(apropos-internal): New function.  Return list of accessible
symbols matching regexp.

ice-9/ChangeLog
ice-9/session.scm

index becdb8f..24dbd3f 100644 (file)
@@ -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>
 
index 622e55e..262eb82 100644 (file)
 
 (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)
                 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)))