From 86604af6826780d6cdfa6e90006133dacc5af6f2 Mon Sep 17 00:00:00 2001 From: "Jose A. Ortega Ruiz" Date: Sat, 10 Jan 2009 01:15:57 +0100 Subject: [PATCH 01/11] FUEL: Display of parsing words lists in help browser fixed. --- misc/fuel/fuel-markup.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/fuel/fuel-markup.el b/misc/fuel/fuel-markup.el index 69d1de8814..9e5e1c8af2 100644 --- a/misc/fuel/fuel-markup.el +++ b/misc/fuel/fuel-markup.el @@ -373,10 +373,10 @@ (let ((heading `($heading ,(match-string-no-properties 0))) (rows)) (forward-line) - (when (looking-at "Word *Stack effect$") - (push '("Word" "Stack effect") rows) + (when (looking-at "Word *\\(Stack effect\\|Syntax\\)$") + (push (list "Word" (match-string-no-properties 1)) rows) (forward-line)) - (while (looking-at "\\(.+?\\)\\( +\\(( .*\\)\\)?$") + (while (looking-at "\\(.+?\\)\\( +\\(.+\\)\\)?$") (let ((word `($link ,(match-string-no-properties 1) ,(match-string-no-properties 1) word)) From 8e6be0ccefe7b2e22ded906f263161a6c29675fe Mon Sep 17 00:00:00 2001 From: "Jose A. Ortega Ruiz" Date: Sat, 10 Jan 2009 02:09:25 +0100 Subject: [PATCH 02/11] FUEL: Numeric literals' font-lock fixed. --- misc/fuel/fuel-syntax.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/fuel/fuel-syntax.el b/misc/fuel/fuel-syntax.el index 49e7788b2f..0d85cf897e 100644 --- a/misc/fuel/fuel-syntax.el +++ b/misc/fuel/fuel-syntax.el @@ -85,7 +85,7 @@ "^M: +\\([^ ]+\\) +\\([^ ]+\\)") (defconst fuel-syntax--number-regex - "\\(\\+\\|-\\)?\\([0-9]+\\.?[0-9]*\\|\\.[0-9]+\\)\\([eE]\\(\\+\\|-\\)?[0-9]+\\)?") + "\\_<\\(\\+\\|-\\)?\\([0-9]+\\.?[0-9]*\\|\\.[0-9]+\\)\\([eE]\\(\\+\\|-\\)?[0-9]+\\)?\\_>") (defconst fuel-syntax--word-definition-regex (fuel-syntax--second-word-regex From 36dcb21857fbab76e4026311d334e762f11f17b4 Mon Sep 17 00:00:00 2001 From: "Jose A. Ortega Ruiz" Date: Sat, 10 Jan 2009 06:40:01 +0100 Subject: [PATCH 03/11] FUEL: Font lock for integers, floats and ratios. --- misc/fuel/fuel-font-lock.el | 6 +++++- misc/fuel/fuel-syntax.el | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/misc/fuel/fuel-font-lock.el b/misc/fuel/fuel-font-lock.el index 45fd0758d5..bcddf82d18 100644 --- a/misc/fuel/fuel-font-lock.el +++ b/misc/fuel/fuel-font-lock.el @@ -55,6 +55,8 @@ ((comment comment "comments") (constructor type "constructors ()") (constant constant "constants and literal values") + (number constant "integers and floats") + (ratio constant "ratios") (declaration keyword "declaration words") (parsing-word keyword "parsing words") (setter-word function-name "setter words (>>foo)") @@ -80,7 +82,9 @@ (,fuel-syntax--alias-definition-regex (1 'factor-font-lock-word) (2 'factor-font-lock-word)) (,fuel-syntax--int-constant-def-regex 2 'factor-font-lock-constant) - (,fuel-syntax--number-regex . 'factor-font-lock-constant) + (,fuel-syntax--integer-regex . 'factor-font-lock-number) + (,fuel-syntax--float-regex . 'factor-font-lock-number) + (,fuel-syntax--ratio-regex . 'factor-font-lock-ratio) (,fuel-syntax--type-definition-regex 2 'factor-font-lock-type-name) (,fuel-syntax--method-definition-regex (1 'factor-font-lock-type-name) (2 'factor-font-lock-word)) diff --git a/misc/fuel/fuel-syntax.el b/misc/fuel/fuel-syntax.el index 0d85cf897e..93274c5160 100644 --- a/misc/fuel/fuel-syntax.el +++ b/misc/fuel/fuel-syntax.el @@ -84,8 +84,14 @@ (defconst fuel-syntax--method-definition-regex "^M: +\\([^ ]+\\) +\\([^ ]+\\)") -(defconst fuel-syntax--number-regex - "\\_<\\(\\+\\|-\\)?\\([0-9]+\\.?[0-9]*\\|\\.[0-9]+\\)\\([eE]\\(\\+\\|-\\)?[0-9]+\\)?\\_>") +(defconst fuel-syntax--integer-regex + "\\_<-?[0-9]+\\_>") + +(defconst fuel-syntax--ratio-regex + "\\_<-?\\([0-9]+\\+\\)?[0-9]+/-?[0-9]+\\_>") + +(defconst fuel-syntax--float-regex + "\\_<-?[0-9]+\\.[0-9]*\\([eE]-?[0-9]+\\)?\\_>") (defconst fuel-syntax--word-definition-regex (fuel-syntax--second-word-regex From 65e6a6ca848fc2eadd96165480829c3f0a6b589c Mon Sep 17 00:00:00 2001 From: "Jose A. Ortega Ruiz" Date: Sat, 10 Jan 2009 15:44:03 +0100 Subject: [PATCH 04/11] FUEL: Bug in quotation pprint fixed. --- extra/fuel/fuel.factor | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/extra/fuel/fuel.factor b/extra/fuel/fuel.factor index 50f02f1a1a..07454a73f0 100644 --- a/extra/fuel/fuel.factor +++ b/extra/fuel/fuel.factor @@ -69,13 +69,15 @@ M: integer fuel-pprint pprint ; inline M: string fuel-pprint pprint ; inline -M: sequence fuel-pprint - "(" write [ " " write ] [ fuel-pprint ] interleave ")" write ; inline +: fuel-pprint-sequence ( seq open close -- ) + [ write ] dip swap [ " " write ] [ fuel-pprint ] interleave write ; inline + +M: sequence fuel-pprint "(" ")" fuel-pprint-sequence ; inline + +M: quotation fuel-pprint "[" "]" fuel-pprint-sequence ; inline M: tuple fuel-pprint tuple>array fuel-pprint ; inline -M: quotation fuel-pprint pprint ; inline - M: continuation fuel-pprint drop ":continuation" write ; inline M: restart fuel-pprint name>> fuel-pprint ; inline From bb7c82a9aacf4fe2018e6f7e332813570210cba3 Mon Sep 17 00:00:00 2001 From: "Jose A. Ortega Ruiz" Date: Sun, 11 Jan 2009 14:15:26 +0100 Subject: [PATCH 05/11] FUEL: Fix for float highlight (+ en exp) and small tweaks. --- extra/fuel/fuel.factor | 9 +++++---- misc/fuel/factor-mode.el | 2 +- misc/fuel/fuel-eval.el | 4 ++-- misc/fuel/fuel-syntax.el | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/extra/fuel/fuel.factor b/extra/fuel/fuel.factor index 07454a73f0..67ddc8fcd9 100644 --- a/extra/fuel/fuel.factor +++ b/extra/fuel/fuel.factor @@ -6,7 +6,8 @@ compiler.units continuations debugger definitions help help.crossref help.markup help.topics io io.pathnames io.streams.string kernel lexer make math math.order memoize namespaces parser quotations prettyprint sequences sets sorting source-files strings summary tools.crossref -tools.vocabs tools.vocabs.browser vectors vocabs vocabs.parser words ; +tools.vocabs tools.vocabs.browser vectors vocabs vocabs.parser +vocabs.loader words ; IN: fuel @@ -330,7 +331,7 @@ SYMBOL: vocab-list [ describe-words ] with-string-writer \ describe-words swap 2array ; inline : (fuel-vocab-help) ( name -- element ) - \ article swap dup >vocab-link + dup require \ article swap dup >vocab-link [ { [ vocab-authors [ \ $authors prefix , ] when* ] @@ -360,12 +361,12 @@ MEMO: (fuel-get-vocabs/author) ( author -- element ) : fuel-get-vocabs/author ( author -- ) (fuel-get-vocabs/author) fuel-eval-set-result ; -MEMO: (fuel-get-vocabs/tag ( tag -- element ) +MEMO: (fuel-get-vocabs/tag) ( tag -- element ) [ "Vocabularies tagged " prepend \ $heading swap 2array ] [ tagged fuel-vocab-list ] bi 2array ; : fuel-get-vocabs/tag ( tag -- ) - (fuel-get-vocabs/tag fuel-eval-set-result ; + (fuel-get-vocabs/tag) fuel-eval-set-result ; ! -run=fuel support diff --git a/misc/fuel/factor-mode.el b/misc/fuel/factor-mode.el index d3a633910c..d862b71da0 100644 --- a/misc/fuel/factor-mode.el +++ b/misc/fuel/factor-mode.el @@ -239,7 +239,7 @@ code in the buffer." ;;; Keymap: (defun factor-mode-insert-and-indent (n) - (interactive "p") + (interactive "*p") (self-insert-command n) (indent-according-to-mode)) diff --git a/misc/fuel/fuel-eval.el b/misc/fuel/fuel-eval.el index 149e608964..543d23bd3f 100644 --- a/misc/fuel/fuel-eval.el +++ b/misc/fuel/fuel-eval.el @@ -42,7 +42,7 @@ (factor (case sexp (:rs 'fuel-eval-restartable) (:nrs 'fuel-eval-non-restartable) - (:in (fuel-syntax--current-vocab)) + (:in (or (fuel-syntax--current-vocab) "fuel")) (:usings `(:array ,@(fuel-syntax--usings))) (:get 'fuel-eval-set-result) (:end '\;) @@ -70,7 +70,7 @@ (defsubst factor--fuel-in (in) (cond ((or (eq in :in) (null in)) :in) ((eq in 'f) 'f) - ((eq in 't) "fuel-scratchpad") + ((eq in 't) "fuel") ((stringp in) in) (t (error "Invalid 'in' (%s)" in)))) diff --git a/misc/fuel/fuel-syntax.el b/misc/fuel/fuel-syntax.el index 93274c5160..384838af12 100644 --- a/misc/fuel/fuel-syntax.el +++ b/misc/fuel/fuel-syntax.el @@ -91,7 +91,7 @@ "\\_<-?\\([0-9]+\\+\\)?[0-9]+/-?[0-9]+\\_>") (defconst fuel-syntax--float-regex - "\\_<-?[0-9]+\\.[0-9]*\\([eE]-?[0-9]+\\)?\\_>") + "\\_<-?[0-9]+\\.[0-9]*\\([eE][+-]?[0-9]+\\)?\\_>") (defconst fuel-syntax--word-definition-regex (fuel-syntax--second-word-regex From 732c525eaa6dda2f0b16159973414c8ee2c81ee7 Mon Sep 17 00:00:00 2001 From: "Jose A. Ortega Ruiz" Date: Sun, 11 Jan 2009 14:29:55 +0100 Subject: [PATCH 06/11] FUEL: Fix for indentation after brace-words. --- misc/fuel/fuel-syntax.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/misc/fuel/fuel-syntax.el b/misc/fuel/fuel-syntax.el index 384838af12..e8c5d296ad 100644 --- a/misc/fuel/fuel-syntax.el +++ b/misc/fuel/fuel-syntax.el @@ -63,12 +63,12 @@ "UNION:" "USE:" "USING:" "VARS:")) -(defconst fuel-syntax--bracers - '("B" "BV" "C" "CS" "H" "T" "V" "W")) - (defconst fuel-syntax--parsing-words-regex (regexp-opt fuel-syntax--parsing-words 'words)) +(defconst fuel-syntax--bracers + '("B" "BV" "C" "CS" "H" "T" "V" "W")) + (defconst fuel-syntax--brace-words-regex (format "%s{" (regexp-opt fuel-syntax--bracers t))) @@ -216,8 +216,7 @@ (" \\(|\\) " (1 "(|")) (" \\(|\\)$" (1 ")")) ;; Opening brace words: - (,(format "\\_<%s\\({\\)\\_>" (regexp-opt fuel-syntax--bracers)) (1 "(}")) - ("\\_<\\({\\)\\_>" (1 "(}")) + ("\\_<\\w*\\({\\)\\_>" (1 "(}")) ("\\_<\\(}\\)\\_>" (1 "){")) ;; Parenthesis: ("\\_<\\((\\)\\_>" (1 "()")) From 608352f3134d6ddb8547eb28838ae17ad95fb989 Mon Sep 17 00:00:00 2001 From: "Jose A. Ortega Ruiz" Date: Sun, 11 Jan 2009 16:28:02 +0100 Subject: [PATCH 07/11] FUEL: Workaround for comint mode hang up. --- misc/fuel/fuel-listener.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/fuel/fuel-listener.el b/misc/fuel/fuel-listener.el index d4fa5aed1f..c6835ede6b 100644 --- a/misc/fuel/fuel-listener.el +++ b/misc/fuel/fuel-listener.el @@ -102,6 +102,8 @@ buffer." (defun fuel-listener-nuke () (interactive) + (goto-char (point-max)) + (comint-kill-region comint-last-input-start (point)) (comint-redirect-cleanup) (fuel-con--setup-connection fuel-listener--buffer)) From 4543590ca9e6b6d07bc77c03ceec5bdcccfe19ef Mon Sep 17 00:00:00 2001 From: "Jose A. Ortega Ruiz" Date: Sun, 11 Jan 2009 18:01:52 +0100 Subject: [PATCH 08/11] FUEL: Electric indentation for ] and } fixed. --- misc/fuel/factor-mode.el | 12 +++++++----- misc/fuel/fuel-font-lock.el | 1 - misc/fuel/fuel-syntax.el | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/misc/fuel/factor-mode.el b/misc/fuel/factor-mode.el index d862b71da0..4164e14c5e 100644 --- a/misc/fuel/factor-mode.el +++ b/misc/fuel/factor-mode.el @@ -111,7 +111,7 @@ code in the buffer." (= (- be (point)) (current-indentation)) (= ln (line-number-at-pos be))) (fuel-syntax--indentation-at bs)) - ((or (fuel-syntax--is-eol bs) + ((or (fuel-syntax--is-last-char bs) (not (eq ?\ (char-after (1+ bs))))) (fuel-syntax--increased-indentation (fuel-syntax--indentation-at bs))) @@ -238,15 +238,17 @@ code in the buffer." ;;; Keymap: -(defun factor-mode-insert-and-indent (n) +(defun factor-mode--insert-and-indent (n) (interactive "*p") - (self-insert-command n) + (let ((start (point))) + (self-insert-command n) + (save-excursion (font-lock-fontify-region start (point)))) (indent-according-to-mode)) (defvar factor-mode-map (let ((map (make-sparse-keymap))) - (define-key map [?\]] 'factor-mode-insert-and-indent) - (define-key map [?}] 'factor-mode-insert-and-indent) + (define-key map [?\]] 'factor-mode--insert-and-indent) + (define-key map [?}] 'factor-mode--insert-and-indent) (define-key map "\C-m" 'newline-and-indent) (define-key map "\C-co" 'factor-mode-visit-other-file) (define-key map "\C-c\C-o" 'factor-mode-visit-other-file) diff --git a/misc/fuel/fuel-font-lock.el b/misc/fuel/fuel-font-lock.el index bcddf82d18..b12be1eac7 100644 --- a/misc/fuel/fuel-font-lock.el +++ b/misc/fuel/fuel-font-lock.el @@ -107,7 +107,6 @@ (list (cons 'font-lock-syntactic-keywords fuel-syntax--syntactic-keywords)))))) - ;;; Fontify strings as Factor code: diff --git a/misc/fuel/fuel-syntax.el b/misc/fuel/fuel-syntax.el index e8c5d296ad..8bb7a6d6ef 100644 --- a/misc/fuel/fuel-syntax.el +++ b/misc/fuel/fuel-syntax.el @@ -260,7 +260,7 @@ (defsubst fuel-syntax--looking-at-emptiness () (looking-at "^[ ]*$\\|$")) -(defsubst fuel-syntax--is-eol (pos) +(defsubst fuel-syntax--is-last-char (pos) (save-excursion (goto-char (1+ pos)) (fuel-syntax--looking-at-emptiness))) From 4bb5ad19252a35fb44bc86f3df60821a19b34306 Mon Sep 17 00:00:00 2001 From: "Jose A. Ortega Ruiz" Date: Sun, 11 Jan 2009 20:07:34 +0100 Subject: [PATCH 09/11] FUEL: Interface with tools.scaffold. --- basis/tools/scaffold/scaffold-docs.factor | 2 +- extra/fuel/fuel.factor | 16 ++++- misc/fuel/README | 20 ++++++ misc/fuel/fu.el | 7 +- misc/fuel/fuel-scaffold.el | 81 +++++++++++++++++++++++ 5 files changed, 121 insertions(+), 5 deletions(-) create mode 100644 misc/fuel/fuel-scaffold.el diff --git a/basis/tools/scaffold/scaffold-docs.factor b/basis/tools/scaffold/scaffold-docs.factor index d2989d3cac..9074c80986 100644 --- a/basis/tools/scaffold/scaffold-docs.factor +++ b/basis/tools/scaffold/scaffold-docs.factor @@ -26,7 +26,7 @@ HELP: scaffold-undocumented HELP: scaffold-vocab { $values { "vocab-root" "a vocabulary root string" } { "string" string } } -{ $description "Creates a direcory in the given root for a new vocabulary and adds a main .factor file, a tests file, and an authors.txt file." } ; +{ $description "Creates a directory in the given root for a new vocabulary and adds a main .factor file, a tests file, and an authors.txt file." } ; HELP: using { $description "Stores the vocabularies that are pulled into the documentation file from looking up the stack effect types." } ; diff --git a/extra/fuel/fuel.factor b/extra/fuel/fuel.factor index 67ddc8fcd9..e2a8c701a0 100644 --- a/extra/fuel/fuel.factor +++ b/extra/fuel/fuel.factor @@ -4,10 +4,10 @@ USING: accessors arrays assocs classes.tuple combinators compiler.units continuations debugger definitions help help.crossref help.markup help.topics io io.pathnames io.streams.string kernel lexer -make math math.order memoize namespaces parser quotations prettyprint +make math math.order memoize namespaces parser prettyprint quotations sequences sets sorting source-files strings summary tools.crossref -tools.vocabs tools.vocabs.browser vectors vocabs vocabs.parser -vocabs.loader words ; +tools.scaffold tools.vocabs tools.vocabs.browser vectors vocabs +vocabs.loader vocabs.parser words ; IN: fuel @@ -368,6 +368,16 @@ MEMO: (fuel-get-vocabs/tag) ( tag -- element ) : fuel-get-vocabs/tag ( tag -- ) (fuel-get-vocabs/tag) fuel-eval-set-result ; +! Scaffold support + +: fuel-scaffold-vocab ( root name devname -- ) + developer-name set + [ scaffold-vocab ] 2keep [ (normalize-path) ] dip dup + append-path append-path ".factor" append fuel-eval-set-result ; + +: fuel-scaffold-help ( name -- ) + dup require dup scaffold-help vocab-docs-path + (normalize-path) fuel-eval-set-result ; ! -run=fuel support diff --git a/misc/fuel/README b/misc/fuel/README index f722b18598..2f3417a6b5 100644 --- a/misc/fuel/README +++ b/misc/fuel/README @@ -43,6 +43,26 @@ beast. Many aspects of the environment can be customized: M-x customize-group fuel will show you how many. +*** Faster listener startup + + On startup, run-factor loads the fuel vocabulary, which can take a + while. If you want to speedup the load process, type 'save' in the + listener prompt just after invoking run-factor. This will save a + factor image (overwriting the current one) with all the needed + vocabs. + +*** Vocabulary creation + + FUEL offers a basic interface with Factor's scaffolding utilities. + To create a new vocabulary directory and associated files: + + M-x fuel-scaffold-vocab + + and when in a vocab file, to create a docs file with boilerplate + for each word: + + M-x fuel-scaffold-help + * Quick key reference (Triple chords ending in a single letter accept also C- (e.g. diff --git a/misc/fuel/fu.el b/misc/fuel/fu.el index ffd88bf144..e78502a6ee 100644 --- a/misc/fuel/fu.el +++ b/misc/fuel/fu.el @@ -1,6 +1,6 @@ ;;; fu.el --- Startup file for FUEL -;; Copyright (C) 2008 Jose Antonio Ortega Ruiz +;; Copyright (C) 2008, 2009 Jose Antonio Ortega Ruiz ;; See http://factorcode.org/license.txt for BSD license. ;; Author: Jose Antonio Ortega Ruiz @@ -24,6 +24,11 @@ "Minor mode showing in the minibuffer a synopsis of Factor word at point." t) +(autoload 'fuel-scaffold-vocab "fuel-scaffold.el" + "Create a new Factor vocabulary." t) + +(autoload 'fuel-scaffold-help "fuel-scaffold.el" + "Create a Factor vocabulary help file." t) ;;; fu.el ends here diff --git a/misc/fuel/fuel-scaffold.el b/misc/fuel/fuel-scaffold.el new file mode 100644 index 0000000000..c7ad5c4062 --- /dev/null +++ b/misc/fuel/fuel-scaffold.el @@ -0,0 +1,81 @@ +;;; fuel-scaffold.el -- interaction with tools.scaffold + +;; Copyright (C) 2009 Jose Antonio Ortega Ruiz +;; See http://factorcode.org/license.txt for BSD license. + +;; Author: Jose Antonio Ortega Ruiz +;; Keywords: languages, fuel, factor +;; Start date: Sun Jan 11, 2009 18:40 + +;;; Comentary: + +;; Utilities for creating new vocabulary files and other boilerplate. +;; Mainly, an interface to Factor's tools.scaffold. + +;;; Code: + +(require 'fuel-eval) +(require 'fuel-edit) +(require 'fuel-syntax) +(require 'fuel-base) + + +;;; Customisation: + +(defgroup fuel-scaffold nil + "Options for FUEL's scaffolding." + :group 'fuel) + +(defcustom fuel-scaffold-developer-name user-full-name + "The name to be inserted as yours in scaffold templates." + :type 'string + :group 'fuel-scaffold) + + +;;; Auxiliary functions: + +(defun fuel-scaffold--vocab-roots () + (let ((cmd '(:fuel* (vocab-roots get :get) "fuel"))) + (fuel-eval--retort-result (fuel-eval--send/wait cmd)))) + + +;;; User interface: + +(defun fuel-scaffold-vocab () + "Creates a directory in the given root for a new vocabulary and +adds source, tests and authors.txt files. + +You can configure `fuel-scaffold-developer-name' (set by default to +`user-full-name') for the name to be inserted in the generated files." + (interactive) + (let* ((name (read-string "Vocab name: ")) + (root (completing-read "Vocab root: " + (fuel-scaffold--vocab-roots) + nil t "resource:")) + (cmd `(:fuel* ((,root ,name ,fuel-scaffold-developer-name) + (fuel-scaffold-vocab)) "fuel")) + (ret (fuel-eval--send/wait cmd)) + (file (fuel-eval--retort-result ret))) + (unless file + (error "Error creating vocab (%s)" (car (fuel-eval--retort-error ret)))) + (find-file file) + (goto-char (point-max)))) + +(defun fuel-scaffold-help (&optional arg) + "Creates, if it does not already exist, a help file with +scaffolded help for each word in the current vocabulary. + +With prefix argument, ask for the vocabulary name." + (interactive "P") + (let* ((vocab (or (and (not arg) (fuel-syntax--current-vocab)) + (fuel-edit--read-vocabulary-name nil))) + (cmd `(:fuel* (,vocab fuel-scaffold-help) "fuel")) + (ret (fuel-eval--send/wait cmd)) + (file (fuel-eval--retort-result ret))) + (unless file + (error "Error creating help file" (car (fuel-eval--retort-error ret)))) + (find-file file))) + + +(provide 'fuel-scaffold) +;;; fuel-scaffold.el ends here From 5c8a09eb521a836501c26ac77892ab0635f41d2a Mon Sep 17 00:00:00 2001 From: "Jose A. Ortega Ruiz" Date: Sun, 11 Jan 2009 20:22:08 +0100 Subject: [PATCH 10/11] FUEL: Use the customized developer name in fuel-scaffold-help. --- extra/fuel/fuel.factor | 3 ++- misc/fuel/fuel-scaffold.el | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/extra/fuel/fuel.factor b/extra/fuel/fuel.factor index e2a8c701a0..587537adcf 100644 --- a/extra/fuel/fuel.factor +++ b/extra/fuel/fuel.factor @@ -375,7 +375,8 @@ MEMO: (fuel-get-vocabs/tag) ( tag -- element ) [ scaffold-vocab ] 2keep [ (normalize-path) ] dip dup append-path append-path ".factor" append fuel-eval-set-result ; -: fuel-scaffold-help ( name -- ) +: fuel-scaffold-help ( name devname -- ) + developer-name set dup require dup scaffold-help vocab-docs-path (normalize-path) fuel-eval-set-result ; diff --git a/misc/fuel/fuel-scaffold.el b/misc/fuel/fuel-scaffold.el index c7ad5c4062..8026371def 100644 --- a/misc/fuel/fuel-scaffold.el +++ b/misc/fuel/fuel-scaffold.el @@ -65,11 +65,14 @@ You can configure `fuel-scaffold-developer-name' (set by default to "Creates, if it does not already exist, a help file with scaffolded help for each word in the current vocabulary. -With prefix argument, ask for the vocabulary name." +With prefix argument, ask for the vocabulary name. +You can configure `fuel-scaffold-developer-name' (set by default to +`user-full-name') for the name to be inserted in the generated file." (interactive "P") (let* ((vocab (or (and (not arg) (fuel-syntax--current-vocab)) (fuel-edit--read-vocabulary-name nil))) - (cmd `(:fuel* (,vocab fuel-scaffold-help) "fuel")) + (cmd `(:fuel* (,vocab ,fuel-scaffold-developer-name fuel-scaffold-help) + "fuel")) (ret (fuel-eval--send/wait cmd)) (file (fuel-eval--retort-result ret))) (unless file From 4686f04becdb0dfc74dab0fd0bed483b7d17c5b5 Mon Sep 17 00:00:00 2001 From: "Jose A. Ortega Ruiz" Date: Sun, 11 Jan 2009 20:37:06 +0100 Subject: [PATCH 11/11] FUEL: Help parsing words recognised. --- misc/fuel/fuel-syntax.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/misc/fuel/fuel-syntax.el b/misc/fuel/fuel-syntax.el index 8bb7a6d6ef..6b93787a50 100644 --- a/misc/fuel/fuel-syntax.el +++ b/misc/fuel/fuel-syntax.el @@ -44,14 +44,14 @@ (defconst fuel-syntax--parsing-words '(":" "::" ";" "<<" ">" - "ALIAS:" + "ABOUT:" "ALIAS:" "ARTICLE:" "B" "BIN:" "C:" "C-STRUCT:" "C-UNION:" "CHAR:" "CONSTANT:" "call-next-method" "DEFER:" "ERROR:" "EXCLUDE:" "f" "FORGET:" "FROM:" "GENERIC#" "GENERIC:" - "HEX:" "HOOK:" + "HELP:" "HEX:" "HOOK:" "IN:" "initial:" "INSTANCE:" "INTERSECTION:" "M:" "MACRO:" "MACRO::" "MAIN:" "MATH:" "MEMO:" "MEMO:" "METHOD:" "MIXIN:" "OCT:" @@ -148,12 +148,14 @@ fuel-syntax--declaration-words-regex)) (defconst fuel-syntax--single-liner-regex - (format "^%s" (regexp-opt '("ALIAS:" + (format "^%s" (regexp-opt '("ABOUT:" + "ARTICLE:" + "ALIAS:" "CONSTANT:" "C:" "DEFER:" "FORGET:" "GENERIC:" "GENERIC#" - "HEX:" "HOOK:" + "HELP:" "HEX:" "HOOK:" "IN:" "INSTANCE:" "MAIN:" "MATH:" "MIXIN:" "OCT:"