diff --git a/misc/fuel/factor-mode.el b/misc/fuel/factor-mode.el index 0e089294b5..bcb22b8b2c 100644 --- a/misc/fuel/factor-mode.el +++ b/misc/fuel/factor-mode.el @@ -628,12 +628,10 @@ source/docs/tests file. When set to false, you'll be asked only once." (beginning-of-line) (re-search-forward factor-constructor-regex (line-end-position) t))) -(defun factor-in-using () - (let ((p (point))) - (save-excursion - (and (re-search-backward "^USING:[ \n]" nil t) - (re-search-forward " ;" nil t) - (< p (match-end 0)))))) +(defun factor-on-vocab () + "t if point is on a vocab name. We just piggyback on + font-lock's pretty accurate information." + (eq (get-char-property (point) 'face) 'factor-font-lock-vocabulary-name)) (defsubst factor-end-of-defun-pos () (save-excursion diff --git a/misc/fuel/fuel-autodoc.el b/misc/fuel/fuel-autodoc.el index 1bf88f2f43..2ac2926139 100644 --- a/misc/fuel/fuel-autodoc.el +++ b/misc/fuel/fuel-autodoc.el @@ -58,7 +58,7 @@ USING: form with \\[fuel-load-usings]." (fuel-log--inhibit-p t)) (when word (let* ((usings (if fuel-autodoc-eval-using-form-p :usings t)) - (cmd (if (factor-in-using) + (cmd (if (factor-on-vocab) `(:fuel* (,word fuel-vocab-summary) :in t) `(:fuel* ((,word :usings fuel-word-synopsis)) t ,usings))) (ret (fuel-eval--send/wait cmd fuel-autodoc--timeout)) diff --git a/misc/fuel/fuel-completion.el b/misc/fuel/fuel-completion.el index 50325af776..bc4816f6c5 100644 --- a/misc/fuel/fuel-completion.el +++ b/misc/fuel/fuel-completion.el @@ -196,7 +196,7 @@ Perform completion similar to Emacs' complete-symbol." (let* ((end (point)) (beg (save-excursion (factor-beginning-of-symbol) (point))) (prefix (buffer-substring-no-properties beg end)) - (result (fuel-completion--complete prefix (factor-in-using))) + (result (fuel-completion--complete prefix (factor-on-vocab))) (completions (car result)) (partial (cdr result))) (cond ((null completions) diff --git a/misc/fuel/fuel-help.el b/misc/fuel/fuel-help.el index e3c7699f9b..75fe1f6d15 100644 --- a/misc/fuel/fuel-help.el +++ b/misc/fuel/fuel-help.el @@ -252,7 +252,7 @@ "Show extended help about the word or vocabulary at point, using a help buffer." (interactive "p") - (if (factor-in-using) + (if (factor-on-vocab) (fuel-help-vocab (factor-symbol-at-point)) (fuel-help--word-help nil nil print-message)))