]> gitweb.factorcode.org Git - factor.git/blobdiff - misc/fuel/fuel-listener.el
fuel: Incorporate refresh-and-test-all
[factor.git] / misc / fuel / fuel-listener.el
index f33b6a67d7908abda1fdf5c21f87e6357d726f62..3058a0d6961de81e86df856594798c11ed3871e0 100644 (file)
@@ -1,4 +1,4 @@
-;;; fuel-listener.el --- starting the fuel listener
+;;; fuel-listener.el --- starting the fuel listener -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2008, 2009, 2010  Jose Antonio Ortega Ruiz
 ;; See http://factorcode.org/license.txt for BSD license.
@@ -22,7 +22,6 @@
 
 (require 'comint)
 
-\f
 ;;; Customization:
 
 ;;;###autoload
@@ -52,12 +51,6 @@ the factor-listener buffer."
   :type 'boolean
   :group 'fuel-listener)
 
-(defcustom fuel-listener-window-allow-split t
-  "Allow window splitting when switching to the fuel listener
-buffer."
-  :type 'boolean
-  :group 'fuel-listener)
-
 (defcustom fuel-listener-history-filename
   (expand-file-name "~/.fuel_history.eld")
   "File where listener input history is saved, so that it persists between
@@ -181,8 +174,7 @@ sessions."
 (defun run-factor (&optional arg)
   "Show the fuel-listener buffer, starting the process if needed."
   (interactive)
-  (let ((buf (process-buffer (fuel-listener--process t)))
-        (pop-up-windows fuel-listener-window-allow-split))
+  (let ((buf (process-buffer (fuel-listener--process t))))
     (if fuel-listener-use-other-window
         (pop-to-buffer buf)
       (switch-to-buffer buf))
@@ -219,6 +211,16 @@ With prefix, you're teletransported to the listener's buffer."
       (comint-send-string nil " refresh-all \"Done!\" write nl flush\n"))
     (when arg (pop-to-buffer buf))))
 
+(defun fuel-refresh-and-test-all (&optional arg)
+  "Switch to the listener buffer and invokes Factor's refresh-and-test-all.
+With prefix, you're teletransporteded to the listener's buffer."
+  (interactive "P")
+  (let ((buf (process-buffer (fuel-listener--process))))
+    (with-current-buffer buf
+      (comint-send-string nil "\"Refreshing loaded vocabs and running tests...\" write nl flush")
+      (comint-send-string nil " refresh-and-test-all \"Done!\" write nl flush\n"))
+    (when arg (pop-to-buffer buf))))
+
 (defun fuel-test-vocab (&optional arg)
   "Run the unit tests for the current vocabulary. With prefix argument, ask for
 the vocabulary name."
@@ -259,7 +261,7 @@ the vocabulary name."
   (when (= (point) (comint-bol)) (beginning-of-line)))
 
 ;;;###autoload
-(define-derived-mode fuel-listener-mode comint-mode "Fuel Listener"
+(define-derived-mode fuel-listener-mode comint-mode "FUEL Listener"
   "Major mode for interacting with an inferior Factor listener process.
 \\{fuel-listener-mode-map}"
   (setq-local comint-prompt-regexp fuel-con--prompt-regex)
@@ -274,16 +276,23 @@ the vocabulary name."
 (fuel-menu--defmenu listener fuel-listener-mode-map
   ("Complete symbol" ((kbd "TAB") (kbd "M-TAB"))
    fuel-completion--complete-symbol :enable (symbol-at-point))
+  --
   ("Edit word or vocab at point" "\M-." fuel-edit-word-at-point)
   ("Edit vocabulary" "\C-c\C-v" fuel-edit-vocabulary)
   --
-  ("Word help" "\C-c\C-w" fuel-help)
-  ("Apropos" "\C-c\C-p" fuel-apropos)
-  (mode "Autodoc mode" "\C-c\C-a" fuel-autodoc-mode)
+  ("Help on word" "\C-c\C-w" fuel-help)
+  ("Apropos..." "\C-c\C-p" fuel-apropos)
   (mode "Show stack mode" "\C-c\C-s" fuel-stack-mode)
   --
+  (menu "Crossref"
+        ("Word callers" "\C-c\M-<"
+         fuel-show-callers :enable (symbol-at-point))
+        ("Word callees" "\C-c\M->"
+         fuel-show-callees :enable (symbol-at-point))
+        (mode "Autodoc mode" "\C-c\C-a" fuel-autodoc-mode))
   ("Run file" "\C-c\C-k" fuel-run-file)
-  ("Refresh vocabs" "\C-c\C-r" fuel-refresh-all))
+  ("Refresh vocabs" "\C-c\C-r" fuel-refresh-all)
+  ("Refresh vocabs and test" "\C-c\M-r" fuel-refresh-and-test-all))
 
 (define-key fuel-listener-mode-map [menu-bar completion] 'undefined)