Merge branch 'emacs' of http://git.hacks-galore.org/jao/factor
commit
5dcf500bbd
|
@ -1,2 +1 @@
|
||||||
Jose Antonio Ortega Ruiz
|
Jose Antonio Ortega Ruiz
|
||||||
Eduardo Cavazos
|
|
||||||
|
|
|
@ -41,6 +41,12 @@ beast.
|
||||||
|
|
||||||
To start the listener, try M-x run-factor.
|
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:
|
Many aspects of the environment can be customized:
|
||||||
M-x customize-group fuel will show you how many.
|
M-x customize-group fuel will show you how many.
|
||||||
|
|
||||||
|
|
|
@ -144,8 +144,7 @@ code in the buffer."
|
||||||
(cond ((or (fuel-syntax--at-end-of-def)
|
(cond ((or (fuel-syntax--at-end-of-def)
|
||||||
(fuel-syntax--at-setter-line))
|
(fuel-syntax--at-setter-line))
|
||||||
(fuel-syntax--decreased-indentation))
|
(fuel-syntax--decreased-indentation))
|
||||||
((and (fuel-syntax--at-begin-of-def)
|
((fuel-syntax--at-begin-of-indent-def)
|
||||||
(not (fuel-syntax--at-using)))
|
|
||||||
(fuel-syntax--increased-indentation))
|
(fuel-syntax--increased-indentation))
|
||||||
(t (current-indentation)))))
|
(t (current-indentation)))))
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,11 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; 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))
|
(add-to-list 'auto-mode-alist '("\\.factor\\'" . factor-mode))
|
||||||
(autoload 'factor-mode "factor-mode.el"
|
(autoload 'factor-mode "factor-mode.el"
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
(defvar fuel-debug--uses-restarts nil))
|
(defvar fuel-debug--uses-restarts nil))
|
||||||
|
|
||||||
(defsubst fuel-debug--uses-insert-title ()
|
(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)
|
(defun fuel-debug--uses-prepare (file)
|
||||||
(fuel--with-popup (fuel-debug--uses-buffer)
|
(fuel--with-popup (fuel-debug--uses-buffer)
|
||||||
|
@ -173,7 +173,7 @@
|
||||||
map))
|
map))
|
||||||
|
|
||||||
(defconst fuel-debug--uses-header-regex
|
(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 USING: is already fine!"
|
||||||
"Current vocabulary list:"
|
"Current vocabulary list:"
|
||||||
"Correct vocabulary list:"
|
"Correct vocabulary list:"
|
||||||
|
|
|
@ -72,10 +72,10 @@
|
||||||
;;; Font lock:
|
;;; Font lock:
|
||||||
|
|
||||||
(defconst fuel-font-lock--font-lock-keywords
|
(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)
|
(,fuel-syntax--brace-words-regex 1 'factor-font-lock-parsing-word)
|
||||||
("\\(P\\|SBUF\\)\"" 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--vocab-ref-regexp 2 'factor-font-lock-vocabulary-name)
|
||||||
(,fuel-syntax--declaration-words-regex . 'factor-font-lock-declaration)
|
(,fuel-syntax--declaration-words-regex . 'factor-font-lock-declaration)
|
||||||
(,fuel-syntax--word-definition-regex 2 'factor-font-lock-word)
|
(,fuel-syntax--word-definition-regex 2 'factor-font-lock-word)
|
||||||
|
|
|
@ -30,12 +30,14 @@
|
||||||
"Interacting with a Factor listener inside Emacs."
|
"Interacting with a Factor listener inside Emacs."
|
||||||
:group 'fuel)
|
: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."
|
"Full path to the factor executable to use when starting a listener."
|
||||||
:type '(file :must-match t)
|
:type '(file :must-match t)
|
||||||
:group 'fuel-listener)
|
: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."
|
"Full path to the factor image to use when starting a listener."
|
||||||
:type '(file :must-match t)
|
:type '(file :must-match t)
|
||||||
:group 'fuel-listener)
|
:group 'fuel-listener)
|
||||||
|
|
|
@ -132,16 +132,28 @@
|
||||||
|
|
||||||
(defconst fuel-syntax--sub-vocab-regex "^<\\([^ \n]+\\) *$")
|
(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
|
(defconst fuel-syntax--definition-start-regex
|
||||||
(format "^\\(%s:\\) " (regexp-opt '("" ":"
|
(format "^\\(%s:\\) " (regexp-opt (append fuel-syntax--no-indent-def-starts
|
||||||
"FROM"
|
fuel-syntax--indent-def-starts))))
|
||||||
"INTERSECTION:"
|
|
||||||
"MACRO" "MACRO:" "M" "MEMO" "MEMO:" "METHOD"
|
|
||||||
"PREDICATE" "PRIMITIVE"
|
|
||||||
"SINGLETONS" "SYMBOLS"
|
|
||||||
"TUPLE"
|
|
||||||
"UNION"
|
|
||||||
"VARS"))))
|
|
||||||
|
|
||||||
(defconst fuel-syntax--definition-end-regex
|
(defconst fuel-syntax--definition-end-regex
|
||||||
(format "\\(\\(^\\| +\\);\\( *%s\\)*\\($\\| +\\)\\)"
|
(format "\\(\\(^\\| +\\);\\( *%s\\)*\\($\\| +\\)\\)"
|
||||||
|
@ -256,6 +268,9 @@
|
||||||
(defsubst fuel-syntax--at-begin-of-def ()
|
(defsubst fuel-syntax--at-begin-of-def ()
|
||||||
(looking-at fuel-syntax--begin-of-def-regex))
|
(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 ()
|
(defsubst fuel-syntax--at-end-of-def ()
|
||||||
(looking-at fuel-syntax--end-of-def-regex))
|
(looking-at fuel-syntax--end-of-def-regex))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue