From a182ebe9a51ecb902103d038b4b217ded959a025 Mon Sep 17 00:00:00 2001
From: Jose Antonio Ortega Ruiz <jao@gnu.org>
Date: Fri, 11 Jun 2010 18:18:10 +0200
Subject: Guile: showing again submodules in module documentation.

---
 scheme/guile/geiser/modules.scm | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

(limited to 'scheme/guile')

diff --git a/scheme/guile/geiser/modules.scm b/scheme/guile/geiser/modules.scm
index f7ea927..a57145e 100644
--- a/scheme/guile/geiser/modules.scm
+++ b/scheme/guile/geiser/modules.scm
@@ -57,7 +57,7 @@
 (define (module-path module-name)
   (and (module-name? module-name)
        (or ((@@ (ice-9 session) module-filename) module-name)
-           (module-filename (resolve-module module-name)))))
+           (module-filename (resolve-module module-name #f)))))
 
 (define (submodules mod)
   (hash-map->list (lambda (k v) v) (module-submodules mod)))
@@ -82,19 +82,19 @@
           cs)))
 
 (define (module-exports mod-name)
-  (let* ((elts (hash-fold classify-module-object
+  (let* ((mod (catch #t
+                (lambda () (resolve-interface mod-name))
+                (lambda args (resolve-module mod-name))))
+         (elts (hash-fold classify-module-object
                           (list '() '() '())
-                          (module-obarray (maybe-module-interface mod-name))))
+                          (module-obarray mod)))
          (elts (map sort-symbols! elts)))
-    (list (cons 'modules (map (lambda (m) `(,@mod-name ,m)) (car elts)))
+    (list (cons 'modules (append
+                          (map module-name (submodules mod))
+                          (map (lambda (m) `(,@mod-name ,m)) (car elts))))
           (cons 'procs (cadr elts))
           (cons 'vars (caddr elts)))))
 
-(define (maybe-module-interface mod-name)
-  (catch #t
-    (lambda () (resolve-interface mod-name))
-    (lambda args (resolve-module mod-name))))
-
 (define (classify-module-object name var elts)
   (let ((obj (and (variable-bound? var)
                   (variable-ref var))))
-- 
cgit v1.2.3