Merge branch 'master' of git://factorcode.org/git/factor

db4
Slava Pestov 2009-01-12 14:32:24 -06:00
commit 1ef15a3135
8 changed files with 44 additions and 19 deletions

View File

@ -1,2 +1 @@
Jose Antonio Ortega Ruiz
Eduardo Cavazos

View File

@ -41,6 +41,12 @@ beast.
To start the listener, try M-x run-factor.
By default, FUEL will try to use the binary and image files in the
factor installation directory. You can customize them with:
(setq fuel-listener-factor-binary <full path to factor>)
(setq fuel-listener-factor-image <full path to factor image>)
Many aspects of the environment can be customized:
M-x customize-group fuel will show you how many.

View File

@ -144,8 +144,7 @@ code in the buffer."
(cond ((or (fuel-syntax--at-end-of-def)
(fuel-syntax--at-setter-line))
(fuel-syntax--decreased-indentation))
((and (fuel-syntax--at-begin-of-def)
(not (fuel-syntax--at-using)))
((fuel-syntax--at-begin-of-indent-def)
(fuel-syntax--increased-indentation))
(t (current-indentation)))))

View File

@ -8,7 +8,11 @@
;;; Code:
(add-to-list 'load-path (file-name-directory load-file-name))
(setq fuel-factor-fuel-dir (file-name-directory load-file-name))
(setq fuel-factor-root-dir (expand-file-name "../../" fuel-factor-fuel-dir))
(add-to-list 'load-path fuel-factor-fuel-dir)
(add-to-list 'auto-mode-alist '("\\.factor\\'" . factor-mode))
(autoload 'factor-mode "factor-mode.el"

View File

@ -72,7 +72,7 @@
(defvar fuel-debug--uses-restarts nil))
(defsubst fuel-debug--uses-insert-title ()
(insert "Infering USING: stanza for " fuel-debug--uses-file ".\n\n"))
(insert "Inferring USING: stanza for " fuel-debug--uses-file ".\n\n"))
(defun fuel-debug--uses-prepare (file)
(fuel--with-popup (fuel-debug--uses-buffer)
@ -173,7 +173,7 @@
map))
(defconst fuel-debug--uses-header-regex
(format "^%s.*$" (regexp-opt '("Infering USING: stanza for "
(format "^%s.*$" (regexp-opt '("Inferring USING: stanza for "
"Current USING: is already fine!"
"Current vocabulary list:"
"Correct vocabulary list:"

View File

@ -72,10 +72,10 @@
;;; Font lock:
(defconst fuel-font-lock--font-lock-keywords
`((,fuel-syntax--parsing-words-regex . 'factor-font-lock-parsing-word)
`((,fuel-syntax--stack-effect-regex . 'factor-font-lock-stack-effect)
(,fuel-syntax--parsing-words-regex . 'factor-font-lock-parsing-word)
(,fuel-syntax--brace-words-regex 1 'factor-font-lock-parsing-word)
("\\(P\\|SBUF\\)\"" 1 'factor-font-lock-parsing-word)
(,fuel-syntax--stack-effect-regex . 'factor-font-lock-stack-effect)
(,fuel-syntax--vocab-ref-regexp 2 'factor-font-lock-vocabulary-name)
(,fuel-syntax--declaration-words-regex . 'factor-font-lock-declaration)
(,fuel-syntax--word-definition-regex 2 'factor-font-lock-word)

View File

@ -30,12 +30,14 @@
"Interacting with a Factor listener inside Emacs."
:group 'fuel)
(defcustom fuel-listener-factor-binary "~/factor/factor"
(defcustom fuel-listener-factor-binary
(expand-file-name "factor" fuel-factor-root-dir)
"Full path to the factor executable to use when starting a listener."
:type '(file :must-match t)
:group 'fuel-listener)
(defcustom fuel-listener-factor-image "~/factor/factor.image"
(defcustom fuel-listener-factor-image
(expand-file-name "factor.image" fuel-factor-root-dir)
"Full path to the factor image to use when starting a listener."
:type '(file :must-match t)
:group 'fuel-listener)

View File

@ -132,16 +132,28 @@
(defconst fuel-syntax--sub-vocab-regex "^<\\([^ \n]+\\) *$")
(defconst fuel-syntax--indent-def-starts '("" ":"
"FROM"
"INTERSECTION:"
"M" "MACRO" "MACRO:"
"MEMO" "MEMO:" "METHOD"
"PREDICATE" "PRIMITIVE"
"UNION"))
(defconst fuel-syntax--no-indent-def-starts '("SINGLETONS"
"SYMBOLS"
"TUPLE"
"VARS"))
(defconst fuel-syntax--indent-def-start-regex
(format "^\\(%s:\\) " (regexp-opt fuel-syntax--indent-def-starts)))
(defconst fuel-syntax--no-indent-def-start-regex
(format "^\\(%s:\\) " (regexp-opt fuel-syntax--no-indent-def-starts)))
(defconst fuel-syntax--definition-start-regex
(format "^\\(%s:\\) " (regexp-opt '("" ":"
"FROM"
"INTERSECTION:"
"MACRO" "MACRO:" "M" "MEMO" "MEMO:" "METHOD"
"PREDICATE" "PRIMITIVE"
"SINGLETONS" "SYMBOLS"
"TUPLE"
"UNION"
"VARS"))))
(format "^\\(%s:\\) " (regexp-opt (append fuel-syntax--no-indent-def-starts
fuel-syntax--indent-def-starts))))
(defconst fuel-syntax--definition-end-regex
(format "\\(\\(^\\| +\\);\\( *%s\\)*\\($\\| +\\)\\)"
@ -256,6 +268,9 @@
(defsubst fuel-syntax--at-begin-of-def ()
(looking-at fuel-syntax--begin-of-def-regex))
(defsubst fuel-syntax--at-begin-of-indent-def ()
(looking-at fuel-syntax--indent-def-start-regex))
(defsubst fuel-syntax--at-end-of-def ()
(looking-at fuel-syntax--end-of-def-regex))