--- gforth/gforth.el 2010/08/20 20:17:28 1.79 +++ gforth/gforth.el 2011/08/13 09:47:08 1.85 @@ -1,6 +1,6 @@ ;;; gforth.el --- major mode for editing (G)Forth sources -;; Copyright (C) 1995,1996,1997,1998,2000,2001,2003,2004,2007,2008 Free Software Foundation, Inc. +;; Copyright (C) 1995,1996,1997,1998,2000,2001,2003,2004,2007,2008,2010 Free Software Foundation, Inc. ;; This file is part of Gforth. @@ -256,9 +256,10 @@ PARSED-TYPE specifies what kind of text "[ \t\n]" t string (font-lock-string-face . 1)) (("char") non-immediate (font-lock-keyword-face . 1) "[ \t\n]" t string (font-lock-string-face . 1)) - (("s\"" "c\"") immediate (font-lock-string-face . 1) + ("'.'?" non-immediate (font-lock-string-face . 1)) + (("s\"" "c\"" "s\\\"") immediate (font-lock-string-face . 1) "[\"\n]" nil string (font-lock-string-face . 1)) - ((".\"") compile-only (font-lock-string-face . 1) + ((".\"" ".\\\"") compile-only (font-lock-string-face . 1) "[\"\n]" nil string (font-lock-string-face . 1)) (("abort\"") compile-only (font-lock-keyword-face . 1) "[\"\n]" nil string (font-lock-string-face . 1)) @@ -306,7 +307,7 @@ PARSED-TYPE specifies what kind of text (("create" "variable" "constant" "2variable" "2constant" "fvariable" "fconstant" "value" "field" "user" "vocabulary" - "create-interpret/compile") + "create-interpret/compile" "interpret/compile:") non-immediate (font-lock-type-face . 2) "[ \t\n]" t name (font-lock-variable-name-face . 3)) ("\\S-+%" non-immediate (font-lock-type-face . 2)) @@ -315,7 +316,19 @@ PARSED-TYPE specifies what kind of text "[ \t\n]" t name (font-lock-function-name-face . 3)) (("end-struct") non-immediate (font-lock-keyword-face . 2) "[ \t\n]" t name (font-lock-type-face . 3)) - (("struct") non-immediate (font-lock-keyword-face . 2)) + (("struct" "end-c-library" "c-library-name") + non-immediate (font-lock-keyword-face . 2)) + (("c-library") non-immediate (font-lock-keyword-face . 2) + "[ \t\n]" t name (font-lock-variable-name-face . 3)) + (("c-variable") non-immediate (font-lock-type-face . 1) + "[ \t\n]" t name (font-lock-function-name-face . 3) + "[ \t\n]" t name (font-lock-function-name-face . 3)) + (("c-function" "c-value") non-immediate (font-lock-type-face . 1) + "[ \t\n]" t name (font-lock-function-name-face . 3) + "[ \t\n]" t name (font-lock-function-name-face . 3) + "[\n]" nil comment (font-lock-variable-name-face . 3)) + (("\\c") non-immediate (font-lock-keyword-face . 1) + "[\n]" nil string (font-lock-string-face . 1)) ("-?[0-9]+\\(\\.[0-9]*e\\(-?[0-9]+\\)?\\|\\.?[0-9a-f]*\\)" immediate (font-lock-constant-face . 3)) ("-?\\([&#][0-9]+\\|\\(0x\\|\\$\\)[0-9a-f]+\\|%[01]+\\)" @@ -428,7 +441,7 @@ INDENT1 and INDENT2 are indentation spec "[if]" "[ifdef]" "[ifundef]" "[begin]" "[for]" "[do]" "[?do]") (0 . 2) (0 . 2)) ((":" ":noname" "code" "abi-code" "struct" "m:" ":m" "class" - "interface") + "interface" "c-library" "c-library-name") (0 . 2) (0 . 2) non-immediate) ("\\S-+%$" (0 . 2) (0 . 0) non-immediate) ((";" ";m") (-2 . 0) (0 . -2)) @@ -437,7 +450,7 @@ INDENT1 and INDENT2 are indentation spec "[until]" "[again]" "loop") (-2 . 0) (0 . -2)) (("end-code" "end-class" "end-interface" "end-class-noname" - "end-interface-noname" "end-struct" "class;") + "end-interface-noname" "end-struct" "class;" "end-c-library") (-2 . 0) (0 . -2) non-immediate) (("protected" "public" "how:") (-1 . 1) (0 . 0) non-immediate) (("+loop" "-loop" "until") (-2 . 0) (-2 . 0)) @@ -748,7 +761,7 @@ End:\" construct).") (defvar forth-defining-words '("VARIABLE" "CONSTANT" "2VARIABLE" "2CONSTANT" "FVARIABLE" "FCONSTANT" "USER" "VALUE" "field" "end-struct" "VOCABULARY" "CREATE" ":" "CODE" - "DEFER" "ALIAS") + "DEFER" "ALIAS" "interpret/compile:") "List of words, that define the following word. Used for imenu index generation.") @@ -1103,7 +1116,6 @@ exceeds 64 characters." (define-key forth-mode-map "\C-x\\" 'comment-region) (define-key forth-mode-map "\C-x~" 'forth-remove-tracers) (define-key forth-mode-map "\C-x\C-m" 'forth-split) -(define-key forth-mode-map "\e " 'forth-reload) (define-key forth-mode-map "\t" 'forth-indent-command) (define-key forth-mode-map "\C-m" 'forth-reindent-then-newline-and-indent) (define-key forth-mode-map "\M-q" 'forth-fill-paragraph) @@ -1376,7 +1388,7 @@ programmers who tend to fill code won't (defun forth-remove-tracers () "Remove tracers of the form `~~ '. Queries the user for each occurrence." (interactive) - (query-replace-regexp "\\(~~ \\| ~~$\\)" "" nil)) + (query-replace-regexp "\\(~~[ \t]\\|[ \t]~~$\\)" "" nil)) (define-key forth-mode-map "\C-x\C-e" 'compile) (define-key forth-mode-map "\C-x\C-n" 'next-error)