FUEL: Correctly detect vocabs when M-. in a USING:/USE: form.

db4
Jose A. Ortega Ruiz 2009-01-16 22:07:14 +01:00
parent 72a3d309f9
commit 037ba93c1c
1 changed files with 8 additions and 3 deletions

View File

@ -33,6 +33,11 @@
;;; Auxiliar functions: ;;; 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) (defun fuel-edit--try-edit (ret)
(let* ((err (fuel-eval--retort-error ret)) (let* ((err (fuel-eval--retort-error ret))
(loc (fuel-eval--retort-result 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: "))) (fuel-completion--read-word "Edit word: ")))
(cmd `(:fuel* ((:quote ,word) fuel-get-edit-location))) (cmd `(:fuel* ((:quote ,word) fuel-get-edit-location)))
(marker (and (not arg) (point-marker)))) (marker (and (not arg) (point-marker))))
(condition-case nil (if (and (not arg) (fuel-edit--looking-at-vocab))
(fuel-edit--try-edit (fuel-eval--send/wait cmd)) (fuel-edit-vocabulary nil word)
(error (fuel-edit-vocabulary nil word))) (fuel-edit--try-edit (fuel-eval--send/wait cmd)))
(when marker (ring-insert find-tag-marker-ring marker)))) (when marker (ring-insert find-tag-marker-ring marker))))
(defun fuel-edit-word-doc-at-point (&optional arg word) (defun fuel-edit-word-doc-at-point (&optional arg word)