Fomus
Simple Emacs Interface
Here are a few simple lines that you can put in your .emacs
file. They
associate .fms
files with Lisp (actually, this example assumes SLIME
is being used) and bind the key sequence "\c-c\c-o"
to run the FOMUS
command-line program.
;; fomus extension--editing works well enough in lisp mode (add-to-list 'auto-mode-alist '("\\.fms$" . lisp-mode)) ;; save buffers & invoke fomus (setq fomus-args "") (defun run-fomus () (interactive) (save-some-buffers) (let ((a (read-from-minibuffer "FOMUS arguments: " fomus-args))) (setq fomus-args a) (shell-command (format "fomus %s %S" a buffer-file-name)))) ;; add slime mode hook (defun custom-slime-mode-hook () (local-set-key "\C-c\C-o" 'run-fomus)) (add-hook 'slime-mode-hook 'custom-slime-mode-hook)
Another option would be to use SLIME's slime-interactive-eval
function
instead of shell-command
:
;; save buffers and invoke fomus in the default Lisp (setq fomus-args "") (defun run-fomus () (interactive) (save-some-buffers) (let ((a (read-from-minibuffer "FOMUS arguments: " fomus-args))) (setq fomus-args a) (slime-interactive-eval (format "(fomus %S %s)" buffer-file-name a))))