-;;; 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)))
(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."
(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))))