]> gitweb.factorcode.org Git - factor.git/blobdiff - misc/fuel/fuel-edit.el
Use lexical scoping in all fuel sources
[factor.git] / misc / fuel / fuel-edit.el
index ae022f0b87712bf8f03614a149543517be32adff..bbc70490495979acea6b1ba2a22adff363dfcc40 100644 (file)
@@ -1,4 +1,4 @@
-;;; fuel-edit.el -- utilities for file editing
+;;; fuel-edit.el -- utilities for file editing -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2009 Jose Antonio Ortega Ruiz
 ;; See http://factorcode.org/license.txt for BSD license.
         ((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)))
@@ -74,18 +69,6 @@ With prefix argument, refreshes cached vocabulary list."
     (fuel-edit--try-edit (fuel-eval--send/wait cmd))))
 
 ;;;###autoload
-(defun fuel-edit-word (&optional arg)
-  "Asks for a word to edit, with completion.
-With prefix, only words visible in the current vocabulary are
-offered."
-  (interactive "P")
-  (let* ((word (fuel-completion--read-word "Edit word: "
-                                           nil
-                                           fuel-edit--word-history
-                                           arg))
-         (cmd `(:fuel* ((:quote ,word) fuel-get-word-location))))
-    (fuel-edit--try-edit (fuel-eval--send/wait cmd))))
-
 (defun fuel-edit-word-at-point (&optional arg)
   "Opens a new window visiting the definition of the word at point.
 With prefix, asks for the word to edit."
@@ -94,7 +77,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))))