]> gitweb.factorcode.org Git - factor.git/commitdiff
FUEL: Fix for autodoc in presence of <PRIVATE > sections.
authorJose A. Ortega Ruiz <jao@gnu.org>
Wed, 31 Dec 2008 00:31:03 +0000 (01:31 +0100)
committerJose A. Ortega Ruiz <jao@gnu.org>
Wed, 31 Dec 2008 00:31:03 +0000 (01:31 +0100)
misc/fuel/fuel-debug-uses.el
misc/fuel/fuel-syntax.el

index eecdfa704403f7697464eb67ab560540301ce7a8..2e94258c287c4e56ac6fed6bc8c61a3962a02db1 100644 (file)
 (defun fuel-debug--uses-display (uses)
   (let* ((inhibit-read-only t)
          (old (with-current-buffer (find-file-noselect fuel-debug--uses-file)
-                (fuel-syntax--usings)))
-         (old (sort old 'string<))
+                (sort (fuel-syntax--find-usings t) 'string<)))
          (new (sort uses 'string<)))
     (erase-buffer)
     (fuel-debug--uses-insert-title)
index 8234f9fcc8474824b1dc4be1170d2afbbe08cd69..036ac7cbd08f9a4ed613416444cae0e878d09f58 100644 (file)
   (funcall fuel-syntax--current-vocab-function))
 
 (defun fuel-syntax--find-in ()
-  (let* ((vocab)
-         (ip
-          (save-excursion
-            (when (re-search-backward fuel-syntax--current-vocab-regex nil t)
-              (setq vocab (match-string-no-properties 1))
-              (point)))))
-    (when ip
-      (let ((pp (save-excursion
-                  (when (re-search-backward fuel-syntax--sub-vocab-regex ip t)
-                    (point)))))
-        (when (and pp (> pp ip))
-          (let ((sub (match-string-no-properties 1)))
-            (unless (save-excursion (search-backward (format "%s>" sub) pp t))
-              (setq vocab (format "%s.%s" vocab (downcase sub))))))))
-    vocab))
+  (save-excursion
+    (when (re-search-backward fuel-syntax--current-vocab-regex nil t)
+      (match-string-no-properties 1))))
 
 (make-variable-buffer-local
  (defvar fuel-syntax--usings-function 'fuel-syntax--find-usings))
 (defsubst fuel-syntax--usings ()
   (funcall fuel-syntax--usings-function))
 
-(defun fuel-syntax--find-usings ()
+(defun fuel-syntax--find-usings (&optional no-private)
   (save-excursion
     (let ((usings))
       (goto-char (point-max))
       (while (re-search-backward fuel-syntax--using-lines-regex nil t)
         (dolist (u (split-string (match-string-no-properties 1) nil t))
           (push u usings)))
+      (goto-char (point-min))
+      (when (and (not no-private)
+                 (re-search-forward "\\_<<PRIVATE\\_>" nil t)
+                 (re-search-forward "\\_<PRIVATE>\\_>" nil t))
+        (goto-char (point-max))
+        (push (concat (fuel-syntax--find-in) ".private") usings))
       usings)))
 
 \f