]> gitweb.factorcode.org Git - factor.git/commitdiff
FUEL: fix factor-find-usings and use it in fuel-help--word-help so that fuel can...
authorBjörn Lindqvist <bjourne@gmail.com>
Mon, 14 Apr 2014 12:49:34 +0000 (14:49 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 14 Apr 2014 15:38:33 +0000 (08:38 -0700)
misc/fuel/factor-mode.el
misc/fuel/fuel-help.el

index ecee2dc14bdd03b7fd8a690c6768c95c5f0c755a..0e089294b5ed9028a1d61515296b5cda8eecafac 100644 (file)
@@ -679,9 +679,10 @@ source/docs/tests file. When set to false, you'll be asked only once."
       (string= (match-string-no-properties 0) "<PRIVATE"))))
 
 (defun factor-find-vocab-name ()
-  "name of the vocab with possible .private suffix"
+  "Name of the vocab with possible .private suffix"
   (concat (factor-find-in) (if (factor-in-private?) ".private" "")))
 
+
 (defvar-local factor-usings-function 'factor-find-usings)
 
 (defsubst factor-usings ()
@@ -694,11 +695,12 @@ source/docs/tests file. When set to false, you'll be asked only once."
          (re-search-forward "\\_<PRIVATE>\\_>" nil t))))
 
 (defun factor-find-usings (&optional no-private)
+  "Lists all vocabs used by the vocab."
   (save-excursion
     (let ((usings))
       (goto-char (point-max))
       (while (re-search-backward factor-using-lines-regex nil t)
-        (dolist (u (split-string (match-string-no-properties 1) nil t))
+        (dolist (u (split-string (match-string-no-properties 2) nil t))
           (push u usings)))
       (when (and (not no-private) (factor-file-has-private))
         (goto-char (point-max))
index daf429b70332fb57023cd81094ff4b946e02fc4d..5374a4352644e1447b973fea83300cd6be3ec34c 100644 (file)
 (defun fuel-help--word-help (&optional see word display-only print-message)
   (let ((def (or word (fuel-help--read-word see))))
     (when def
-      (let ((cmd `(:fuel* (,def ,(if see 'fuel-word-see 'fuel-word-help))
-                          ,(factor-current-vocab) t)))
+      (let ((cmd `(:fuel* (,def
+                           ,(if see 'fuel-word-see 'fuel-word-help))
+                          ,(factor-current-vocab)
+                          ,(factor-usings))))
         (when print-message
           (message "Looking up '%s' ..." def))
         (let* ((ret (fuel-eval--send/wait cmd))