Mercurial > emacs
comparison lisp/progmodes/antlr-mode.el @ 65161:451eb4a93201
* progmodes/antlr-mode.el (antlr-default): Fix defface form.
(antlr-font-lock-additional-keywords): Fix reference to
`antlr-font-lock-literal-regexp' erroneously changed during the
mass face rename.
(antlr-run-tool): Use `compilation-start'.
author | Romain Francoise <romain@orebokech.com> |
---|---|
date | Fri, 26 Aug 2005 18:03:46 +0000 |
parents | 629afbe74e61 |
children | 0ef9e8908562 |
comparison
equal
deleted
inserted
replaced
65160:b5106d08c7ec | 65161:451eb4a93201 |
---|---|
827 font-lock keywords according to `font-lock-defaults' used for the code | 827 font-lock keywords according to `font-lock-defaults' used for the code |
828 in the grammar's actions and semantic predicates, see | 828 in the grammar's actions and semantic predicates, see |
829 `antlr-font-lock-maximum-decoration'.") | 829 `antlr-font-lock-maximum-decoration'.") |
830 | 830 |
831 (defvar antlr-default-face 'antlr-default) | 831 (defvar antlr-default-face 'antlr-default) |
832 (defface antlr-default | 832 (defface antlr-default nil |
833 "Face to prevent strings from language dependent highlighting. | 833 "Face to prevent strings from language dependent highlighting. |
834 Do not change." | 834 Do not change." |
835 :group 'antlr) | 835 :group 'antlr) |
836 ;; backward-compatibility alias | 836 ;; backward-compatibility alias |
837 (put 'antlr-font-lock-default-face 'face-alias 'antlr-default) | 837 (put 'antlr-font-lock-default-face 'face-alias 'antlr-default) |
923 ("\\$setType[ \t]*(\\([A-Za-z\300-\326\330-\337]\\sw*\\))" | 923 ("\\$setType[ \t]*(\\([A-Za-z\300-\326\330-\337]\\sw*\\))" |
924 (1 antlr-tokendef-face)) | 924 (1 antlr-tokendef-face)) |
925 ("\\$\\sw+" (0 keyword-face)) | 925 ("\\$\\sw+" (0 keyword-face)) |
926 ;; the tokens are already fontified as string/docstrings: | 926 ;; the tokens are already fontified as string/docstrings: |
927 (,(lambda (limit) | 927 (,(lambda (limit) |
928 (if antlr-literal-regexp | 928 (if antlr-font-lock-literal-regexp |
929 (antlr-re-search-forward antlr-font-lock-literal-regexp limit))) | 929 (antlr-re-search-forward antlr-font-lock-literal-regexp limit))) |
930 (1 antlr-literal-face t) | 930 (1 antlr-literal-face t) |
931 :XEMACS (0 nil)) ; XEmacs bug workaround | 931 :XEMACS (0 nil)) ; XEmacs bug workaround |
932 (,(lambda (limit) | 932 (,(lambda (limit) |
933 (antlr-re-search-forward antlr-class-header-regexp limit)) | 933 (antlr-re-search-forward antlr-class-header-regexp limit)) |
2227 (car super))))) | 2227 (car super))))) |
2228 glibs))) | 2228 glibs))) |
2229 (cons (if glibs (concat " -glib " (mapconcat 'car glibs ";")) "") | 2229 (cons (if glibs (concat " -glib " (mapconcat 'car glibs ";")) "") |
2230 (cons unknown glibs)))) | 2230 (cons unknown glibs)))) |
2231 | 2231 |
2232 (autoload 'compilation-start "compile") | |
2233 | |
2232 (defun antlr-run-tool (command file &optional saved) | 2234 (defun antlr-run-tool (command file &optional saved) |
2233 "Run Antlr took COMMAND on grammar FILE. | 2235 "Run Antlr took COMMAND on grammar FILE. |
2234 When called interactively, COMMAND is read from the minibuffer and | 2236 When called interactively, COMMAND is read from the minibuffer and |
2235 defaults to `antlr-tool-command' with a computed \"-glib\" option if | 2237 defaults to `antlr-tool-command' with a computed \"-glib\" option if |
2236 necessary. | 2238 necessary. |
2239 called interactively, the buffers are always saved, see also variable | 2241 called interactively, the buffers are always saved, see also variable |
2240 `antlr-ask-about-save'." | 2242 `antlr-ask-about-save'." |
2241 (interactive (antlr-run-tool-interactive)) | 2243 (interactive (antlr-run-tool-interactive)) |
2242 (or saved (save-some-buffers (not antlr-ask-about-save))) | 2244 (or saved (save-some-buffers (not antlr-ask-about-save))) |
2243 (let ((default-directory (file-name-directory file))) | 2245 (let ((default-directory (file-name-directory file))) |
2244 (require 'compile) ; only `compile' autoload | 2246 (compilation-start (concat command " " (file-name-nondirectory file)) |
2245 (compile-internal (concat command " " (file-name-nondirectory file)) | 2247 nil #'(lambda (mode-name) "*Antlr-Run*")))) |
2246 "No more errors" "Antlr-Run"))) | |
2247 | 2248 |
2248 (defun antlr-run-tool-interactive () | 2249 (defun antlr-run-tool-interactive () |
2249 ;; code in `interactive' is not compiled | 2250 ;; code in `interactive' is not compiled |
2250 "Interactive specification for `antlr-run-tool'. | 2251 "Interactive specification for `antlr-run-tool'. |
2251 Use prefix argument ARG to return \(COMMAND FILE SAVED)." | 2252 Use prefix argument ARG to return \(COMMAND FILE SAVED)." |