]> gitweb.factorcode.org Git - factor.git/commitdiff
FUEL: Correctly detect vocabs when M-. in a USING:/USE: form.
authorJose A. Ortega Ruiz <jao@gnu.org>
Fri, 16 Jan 2009 21:07:14 +0000 (22:07 +0100)
committerJose A. Ortega Ruiz <jao@gnu.org>
Fri, 16 Jan 2009 21:07:14 +0000 (22:07 +0100)
misc/fuel/fuel-edit.el

index 20e1f1eb013796e9e3a697fba5a006a12c82dfe5..b0756826f14880a3303ba18e6ed4bcd1dfc987a3 100644 (file)
 \f
 ;;; Auxiliar functions:
 
+(defun fuel-edit--looking-at-vocab ()
+  (save-excursion
+    (fuel-syntax--beginning-of-defun)
+    (looking-at "USING:\\|USE:")))
+
 (defun fuel-edit--try-edit (ret)
   (let* ((err (fuel-eval--retort-error ret))
          (loc (fuel-eval--retort-result ret)))
@@ -92,9 +97,9 @@ With prefix, asks for the word to edit."
                    (fuel-completion--read-word "Edit word: ")))
          (cmd `(:fuel* ((:quote ,word) fuel-get-edit-location)))
          (marker (and (not arg) (point-marker))))
-    (condition-case nil
-        (fuel-edit--try-edit (fuel-eval--send/wait cmd))
-      (error (fuel-edit-vocabulary nil word)))
+    (if (and (not arg) (fuel-edit--looking-at-vocab))
+        (fuel-edit-vocabulary nil word)
+      (fuel-edit--try-edit (fuel-eval--send/wait cmd)))
     (when marker (ring-insert find-tag-marker-ring marker))))
 
 (defun fuel-edit-word-doc-at-point (&optional arg word)