]> gitweb.factorcode.org Git - factor.git/commitdiff
FUEL: can use the factor-on-vocab function instead
authorBjörn Lindqvist <bjourne@gmail.com>
Tue, 27 Jun 2017 17:17:52 +0000 (19:17 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Tue, 27 Jun 2017 21:47:35 +0000 (23:47 +0200)
misc/fuel/fuel-edit.el
misc/fuel/fuel-xref.el

index ae022f0b87712bf8f03614a149543517be32adff..756f06550fbb3cc133673c2d479d95ac4f8df052 100644 (file)
         ((eq method 'frame) (find-file-other-frame file))
         (t (find-file file))))
 
-(defun fuel-edit--looking-at-vocab ()
-  (save-excursion
-    (factor-beginning-of-defun)
-    (looking-at "USING:\\|USE:\\|IN:")))
-
 (defun fuel-edit--try-edit (ret)
   (let* ((err (fuel-eval--retort-error ret))
          (loc (fuel-eval--retort-result ret)))
@@ -94,7 +89,7 @@ With prefix, asks for the word to edit."
                    (fuel-completion--read-word "Edit word: ")))
          (cmd `(:fuel* ((:quote ,word) fuel-get-word-location)))
          (marker (and (not arg) (point-marker))))
-    (if (and (not arg) (fuel-edit--looking-at-vocab))
+    (if (and (not arg) (factor-on-vocab))
         (fuel-edit-vocabulary nil word)
       (fuel-edit--try-edit (fuel-eval--send/wait cmd)))
     (when marker (ring-insert find-tag-marker-ring marker))))
index 7e7aadfb34f303e7bd9cfeb8a09ac997ad6e88b2..24141d4534cce6684b84bb1e6d6123edfa2b69ca 100644 (file)
@@ -215,7 +215,7 @@ With prefix argument, ask for word."
     (when word
       (message "Looking up %s's users ..." word)
       (if (and (not arg)
-               (fuel-edit--looking-at-vocab))
+               (factor-on-vocab))
           (fuel-xref--show-vocab-usage word)
         (fuel-xref--show-callers word)))))
 
@@ -230,7 +230,7 @@ With prefix argument, ask for word."
     (when word
       (message "Looking up %s's callees ..." word)
       (if (and (not arg)
-               (fuel-edit--looking-at-vocab))
+               (factor-on-vocab))
           (fuel-xref--show-vocab-uses word)
         (fuel-xref--show-callees word)))))