From 90f6fef8d29d587186f23e51c605ddc524026f93 Mon Sep 17 00:00:00 2001 From: "Jose A. Ortega Ruiz" Date: Sat, 27 Dec 2008 15:18:17 +0100 Subject: [PATCH 1/3] FUEL: fix in autodoc require's and echo area font lock. --- extra/fuel/fuel.factor | 4 +--- misc/fuel/fuel-autodoc.el | 6 ++++-- misc/fuel/fuel-eval.el | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/extra/fuel/fuel.factor b/extra/fuel/fuel.factor index 35ca438f31..7f6af22df8 100644 --- a/extra/fuel/fuel.factor +++ b/extra/fuel/fuel.factor @@ -99,9 +99,7 @@ M: source-file fuel-pprint path>> fuel-pprint ; clone fuel-eval-result set-global ; inline : fuel-retort ( -- ) - error get - fuel-eval-result get-global - fuel-eval-output get-global + error get fuel-eval-result get-global fuel-eval-output get-global 3array fuel-pprint flush nl "<~FUEL~>" write nl flush ; : fuel-forget-error ( -- ) f error set-global ; inline diff --git a/misc/fuel/fuel-autodoc.el b/misc/fuel/fuel-autodoc.el index 96c47d2c69..a1c1d19b98 100644 --- a/misc/fuel/fuel-autodoc.el +++ b/misc/fuel/fuel-autodoc.el @@ -15,6 +15,7 @@ ;;; Code: (require 'fuel-eval) +(require 'fuel-font-lock) (require 'fuel-syntax) (require 'fuel-base) @@ -36,6 +37,7 @@ (defvar fuel-autodoc--font-lock-buffer (let ((buffer (get-buffer-create " *fuel help minibuffer messages*"))) (set-buffer buffer) + (set-syntax-table fuel-syntax--syntax-table) (fuel-font-lock--font-lock-setup) buffer)) @@ -51,8 +53,8 @@ (fuel-log--inhibit-p t)) (when word (let* ((cmd (if (fuel-syntax--in-using) - `(:fuel* (,word fuel-vocab-summary) t t) - `(:fuel* (((:quote ,word) synopsis :get)) t))) + `(:fuel* (,word fuel-vocab-summary) :in t) + `(:fuel* (((:quote ,word) synopsis :get)) :in))) (ret (fuel-eval--send/wait cmd 20)) (res (fuel-eval--retort-result ret))) (when (and ret (not (fuel-eval--retort-error ret)) (stringp res)) diff --git a/misc/fuel/fuel-eval.el b/misc/fuel/fuel-eval.el index 204e794925..078a7005f8 100644 --- a/misc/fuel/fuel-eval.el +++ b/misc/fuel/fuel-eval.el @@ -67,7 +67,7 @@ (cons :array (mapcar 'factor lst))) (defsubst factor--fuel-in (in) - (cond ((null in) :in) + (cond ((or (eq in :in) (null in)) :in) ((eq in 'f) 'f) ((eq in 't) "fuel-scratchpad") ((stringp in) in) From 308f18b81e9c43bdbe752835068dd4c64ad199a5 Mon Sep 17 00:00:00 2001 From: "Jose A. Ortega Ruiz" Date: Sat, 27 Dec 2008 15:44:15 +0100 Subject: [PATCH 2/3] FUEL: Correct syntax identification for CHAR: x forms with x a paren char. --- misc/fuel/fuel-syntax.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/fuel/fuel-syntax.el b/misc/fuel/fuel-syntax.el index eeca09865d..3778caf832 100644 --- a/misc/fuel/fuel-syntax.el +++ b/misc/fuel/fuel-syntax.el @@ -157,14 +157,14 @@ table)) (defconst fuel-syntax--syntactic-keywords - `(("\\_<\\(#?!\\) .*\\(\n\\)" (1 "<") (2 ">")) - ("\\_<\\(#?!\\)\\(\n\\)" (1 "<") (2 ">")) + `(("\\_<\\(#?!\\) .*\\(\n\\|$\\)" (1 "<") (2 ">")) + ("\\_<\\(#?!\\)\\(\n\\|$\\)" (1 "<") (2 ">")) ("\\_<\\(!(\\) .* \\()\\)" (1 "<") (2 ">")) ("\\(\\[\\)\\(let\\|wlet\\|let\\*\\)\\( \\|$\\)" (1 "(]")) ("\\(\\[\\)\\(|\\) +[^|]* \\(|\\)" (1 "(]") (2 "(|") (3 ")|")) (" \\(|\\) " (1 "(|")) (" \\(|\\)$" (1 ")")) - ("CHAR: \\(\"\\)\\( \\|$\\)" (1 "w")) + ("CHAR: \\(.\\)\\( \\|$\\)" (1 "w")) (,(format "\\_<%s\\({\\)\\_>" (regexp-opt fuel-syntax--bracers)) (1 "(}")) ("\\_<\\({\\)\\_>" (1 "(}")) ("\\_<\\(}\\)\\_>" (1 "){")) From ff99bf016d4693c2e54f146997d5516961c0e454 Mon Sep 17 00:00:00 2001 From: "Jose A. Ortega Ruiz" Date: Sat, 27 Dec 2008 17:36:12 +0100 Subject: [PATCH 3/3] FUEL: recognize fried quotations in syntax table. --- misc/fuel/fuel-syntax.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/misc/fuel/fuel-syntax.el b/misc/fuel/fuel-syntax.el index 3778caf832..8234f9fcc8 100644 --- a/misc/fuel/fuel-syntax.el +++ b/misc/fuel/fuel-syntax.el @@ -157,19 +157,26 @@ table)) (defconst fuel-syntax--syntactic-keywords - `(("\\_<\\(#?!\\) .*\\(\n\\|$\\)" (1 "<") (2 ">")) + `(;; Comments: + ("\\_<\\(#?!\\) .*\\(\n\\|$\\)" (1 "<") (2 ">")) ("\\_<\\(#?!\\)\\(\n\\|$\\)" (1 "<") (2 ">")) + ;; CHARs: + ("CHAR: \\(.\\)\\( \\|$\\)" (1 "w")) + ;; Let and lambda: ("\\_<\\(!(\\) .* \\()\\)" (1 "<") (2 ">")) ("\\(\\[\\)\\(let\\|wlet\\|let\\*\\)\\( \\|$\\)" (1 "(]")) ("\\(\\[\\)\\(|\\) +[^|]* \\(|\\)" (1 "(]") (2 "(|") (3 ")|")) (" \\(|\\) " (1 "(|")) (" \\(|\\)$" (1 ")")) - ("CHAR: \\(.\\)\\( \\|$\\)" (1 "w")) + ;; Opening brace words: (,(format "\\_<%s\\({\\)\\_>" (regexp-opt fuel-syntax--bracers)) (1 "(}")) ("\\_<\\({\\)\\_>" (1 "(}")) ("\\_<\\(}\\)\\_>" (1 "){")) + ;; Parenthesis: ("\\_<\\((\\)\\_>" (1 "()")) ("\\_<\\()\\)\\_>" (1 ")(")) + ;; Quotations: + ("\\_<'\\(\\[\\)\\_>" (1 "(]")) ; fried ("\\_<\\(\\[\\)\\_>" (1 "(]")) ("\\_<\\(\\]\\)\\_>" (1 ")["))))