diff options
| author | Miles Bader | 2005-06-14 22:49:30 +0000 |
|---|---|---|
| committer | Miles Bader | 2005-06-14 22:49:30 +0000 |
| commit | 7a3dfaeead479cd4e0dd8bfeea0421a646af760f (patch) | |
| tree | e83070f7708f797425a557ebdd308b90f42d3fbe | |
| parent | b6116bd2567b686d591306f5b31e3c8e35952f75 (diff) | |
| download | emacs-7a3dfaeead479cd4e0dd8bfeea0421a646af760f.tar.gz emacs-7a3dfaeead479cd4e0dd8bfeea0421a646af760f.zip | |
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-409
Remove "-face" suffix from antlr-mode faces
2005-06-14 Miles Bader <miles@gnu.org>
* lisp/progmodes/antlr-mode.el (antlr-default, antlr-keyword, antlr-syntax)
(antlr-ruledef, antlr-tokendef, antlr-ruleref, antlr-tokenref)
(antlr-literal): Remove "-face" suffix and "font-lock-" from face
names.
(antlr-font-lock-default-face, antlr-font-lock-keyword-face)
(antlr-font-lock-syntax-face, antlr-font-lock-ruledef-face)
(antlr-font-lock-tokendef-face, antlr-font-lock-ruleref-face)
(antlr-font-lock-tokenref-face, antlr-font-lock-literal-face):
New backward-compatibility aliases for renamed faces.
(antlr-default-face, antlr-keyword-face, antlr-syntax-face)
(antlr-ruledef-face, antlr-tokendef-face, antlr-ruleref-face)
(antlr-tokenref-face, antlr-literal-face): Variables renamed to remove
"font-lock-". Use renamed antlr-mode faces.
(antlr-font-lock-additional-keywords): Use renamed faces.
Replace literal face-names with face variable references.
| -rw-r--r-- | lisp/ChangeLog | 16 | ||||
| -rw-r--r-- | lisp/progmodes/antlr-mode.el | 94 |
2 files changed, 71 insertions, 39 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0a491e0d93e..5dce703c7dd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,21 @@ | |||
| 1 | 2005-06-14 Miles Bader <miles@gnu.org> | 1 | 2005-06-14 Miles Bader <miles@gnu.org> |
| 2 | 2 | ||
| 3 | * progmodes/antlr-mode.el (antlr-default, antlr-keyword, antlr-syntax) | ||
| 4 | (antlr-ruledef, antlr-tokendef, antlr-ruleref, antlr-tokenref) | ||
| 5 | (antlr-literal): Remove "-face" suffix and "font-lock-" from face | ||
| 6 | names. | ||
| 7 | (antlr-font-lock-default-face, antlr-font-lock-keyword-face) | ||
| 8 | (antlr-font-lock-syntax-face, antlr-font-lock-ruledef-face) | ||
| 9 | (antlr-font-lock-tokendef-face, antlr-font-lock-ruleref-face) | ||
| 10 | (antlr-font-lock-tokenref-face, antlr-font-lock-literal-face): | ||
| 11 | New backward-compatibility aliases for renamed faces. | ||
| 12 | (antlr-default-face, antlr-keyword-face, antlr-syntax-face) | ||
| 13 | (antlr-ruledef-face, antlr-tokendef-face, antlr-ruleref-face) | ||
| 14 | (antlr-tokenref-face, antlr-literal-face): Variables renamed to remove | ||
| 15 | "font-lock-". Use renamed antlr-mode faces. | ||
| 16 | (antlr-font-lock-additional-keywords): Use renamed faces. | ||
| 17 | Replace literal face-names with face variable references. | ||
| 18 | |||
| 3 | * buff-menu.el (Buffer-menu-buffer): Remove "-face" suffix from | 19 | * buff-menu.el (Buffer-menu-buffer): Remove "-face" suffix from |
| 4 | face name. | 20 | face name. |
| 5 | (Buffer-menu-buffer-face): New backward-compatibility alias for | 21 | (Buffer-menu-buffer-face): New backward-compatibility alias for |
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index bdf376bfab7..89d167de25d 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; antlr-mode.el --- major mode for ANTLR grammar files | 1 | ;;; antlr-mode.el --- major mode for ANTLR grammar files |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. |
| 4 | ;; | 4 | ;; |
| 5 | ;; Author: Christoph.Wedler@sap.com | 5 | ;; Author: Christoph.Wedler@sap.com |
| 6 | ;; Keywords: languages, ANTLR, code generator | 6 | ;; Keywords: languages, ANTLR, code generator |
| @@ -827,58 +827,72 @@ font-lock keywords according to `font-lock-defaults' used for the code | |||
| 827 | in the grammar's actions and semantic predicates, see | 827 | in the grammar's actions and semantic predicates, see |
| 828 | `antlr-font-lock-maximum-decoration'.") | 828 | `antlr-font-lock-maximum-decoration'.") |
| 829 | 829 | ||
| 830 | (defvar antlr-font-lock-default-face 'antlr-font-lock-default-face) | 830 | (defvar antlr-default-face 'antlr-default) |
| 831 | (defface antlr-font-lock-default-face nil | 831 | (defface antlr-default |
| 832 | "Face to prevent strings from language dependent highlighting. | 832 | "Face to prevent strings from language dependent highlighting. |
| 833 | Do not change." | 833 | Do not change." |
| 834 | :group 'antlr) | 834 | :group 'antlr) |
| 835 | ;; backward-compatibility alias | ||
| 836 | (put 'antlr-font-lock-default-face 'face-alias 'antlr-default) | ||
| 835 | 837 | ||
| 836 | (defvar antlr-font-lock-keyword-face 'antlr-font-lock-keyword-face) | 838 | (defvar antlr-keyword-face 'antlr-keyword) |
| 837 | (defface antlr-font-lock-keyword-face | 839 | (defface antlr-keyword |
| 838 | (cond-emacs-xemacs | 840 | (cond-emacs-xemacs |
| 839 | '((((class color) (background light)) | 841 | '((((class color) (background light)) |
| 840 | (:foreground "black" :EMACS :weight bold :XEMACS :bold t)))) | 842 | (:foreground "black" :EMACS :weight bold :XEMACS :bold t)))) |
| 841 | "ANTLR keywords." | 843 | "ANTLR keywords." |
| 842 | :group 'antlr) | 844 | :group 'antlr) |
| 845 | ;; backward-compatibility alias | ||
| 846 | (put 'antlr-font-lock-keyword-face 'face-alias 'antlr-keyword) | ||
| 843 | 847 | ||
| 844 | (defvar antlr-font-lock-syntax-face 'antlr-font-lock-keyword-face) | 848 | (defvar antlr-syntax-face 'antlr-keyword) |
| 845 | (defface antlr-font-lock-syntax-face | 849 | (defface antlr-syntax |
| 846 | (cond-emacs-xemacs | 850 | (cond-emacs-xemacs |
| 847 | '((((class color) (background light)) | 851 | '((((class color) (background light)) |
| 848 | (:foreground "black" :EMACS :weight bold :XEMACS :bold t)))) | 852 | (:foreground "black" :EMACS :weight bold :XEMACS :bold t)))) |
| 849 | "ANTLR syntax symbols like :, |, (, ), ...." | 853 | "ANTLR syntax symbols like :, |, (, ), ...." |
| 850 | :group 'antlr) | 854 | :group 'antlr) |
| 855 | ;; backward-compatibility alias | ||
| 856 | (put 'antlr-font-lock-syntax-face 'face-alias 'antlr-syntax) | ||
| 851 | 857 | ||
| 852 | (defvar antlr-font-lock-ruledef-face 'antlr-font-lock-ruledef-face) | 858 | (defvar antlr-ruledef-face 'antlr-ruledef) |
| 853 | (defface antlr-font-lock-ruledef-face | 859 | (defface antlr-ruledef |
| 854 | (cond-emacs-xemacs | 860 | (cond-emacs-xemacs |
| 855 | '((((class color) (background light)) | 861 | '((((class color) (background light)) |
| 856 | (:foreground "blue" :EMACS :weight bold :XEMACS :bold t)))) | 862 | (:foreground "blue" :EMACS :weight bold :XEMACS :bold t)))) |
| 857 | "ANTLR rule references (definition)." | 863 | "ANTLR rule references (definition)." |
| 858 | :group 'antlr) | 864 | :group 'antlr) |
| 865 | ;; backward-compatibility alias | ||
| 866 | (put 'antlr-font-lock-ruledef-face 'face-alias 'antlr-ruledef) | ||
| 859 | 867 | ||
| 860 | (defvar antlr-font-lock-tokendef-face 'antlr-font-lock-tokendef-face) | 868 | (defvar antlr-tokendef-face 'antlr-tokendef) |
| 861 | (defface antlr-font-lock-tokendef-face | 869 | (defface antlr-tokendef |
| 862 | (cond-emacs-xemacs | 870 | (cond-emacs-xemacs |
| 863 | '((((class color) (background light)) | 871 | '((((class color) (background light)) |
| 864 | (:foreground "blue" :EMACS :weight bold :XEMACS :bold t)))) | 872 | (:foreground "blue" :EMACS :weight bold :XEMACS :bold t)))) |
| 865 | "ANTLR token references (definition)." | 873 | "ANTLR token references (definition)." |
| 866 | :group 'antlr) | 874 | :group 'antlr) |
| 875 | ;; backward-compatibility alias | ||
| 876 | (put 'antlr-font-lock-tokendef-face 'face-alias 'antlr-tokendef) | ||
| 867 | 877 | ||
| 868 | (defvar antlr-font-lock-ruleref-face 'antlr-font-lock-ruleref-face) | 878 | (defvar antlr-ruleref-face 'antlr-ruleref) |
| 869 | (defface antlr-font-lock-ruleref-face | 879 | (defface antlr-ruleref |
| 870 | '((((class color) (background light)) (:foreground "blue4"))) | 880 | '((((class color) (background light)) (:foreground "blue4"))) |
| 871 | "ANTLR rule references (usage)." | 881 | "ANTLR rule references (usage)." |
| 872 | :group 'antlr) | 882 | :group 'antlr) |
| 883 | ;; backward-compatibility alias | ||
| 884 | (put 'antlr-font-lock-ruleref-face 'face-alias 'antlr-ruleref) | ||
| 873 | 885 | ||
| 874 | (defvar antlr-font-lock-tokenref-face 'antlr-font-lock-tokenref-face) | 886 | (defvar antlr-tokenref-face 'antlr-tokenref) |
| 875 | (defface antlr-font-lock-tokenref-face | 887 | (defface antlr-tokenref |
| 876 | '((((class color) (background light)) (:foreground "orange4"))) | 888 | '((((class color) (background light)) (:foreground "orange4"))) |
| 877 | "ANTLR token references (usage)." | 889 | "ANTLR token references (usage)." |
| 878 | :group 'antlr) | 890 | :group 'antlr) |
| 891 | ;; backward-compatibility alias | ||
| 892 | (put 'antlr-font-lock-tokenref-face 'face-alias 'antlr-tokenref) | ||
| 879 | 893 | ||
| 880 | (defvar antlr-font-lock-literal-face 'antlr-font-lock-literal-face) | 894 | (defvar antlr-literal-face 'antlr-literal) |
| 881 | (defface antlr-font-lock-literal-face | 895 | (defface antlr-literal |
| 882 | (cond-emacs-xemacs | 896 | (cond-emacs-xemacs |
| 883 | '((((class color) (background light)) | 897 | '((((class color) (background light)) |
| 884 | (:foreground "brown4" :EMACS :weight bold :XEMACS :bold t)))) | 898 | (:foreground "brown4" :EMACS :weight bold :XEMACS :bold t)))) |
| @@ -886,6 +900,8 @@ Do not change." | |||
| 886 | It is used to highlight strings matched by the first regexp group of | 900 | It is used to highlight strings matched by the first regexp group of |
| 887 | `antlr-font-lock-literal-regexp'." | 901 | `antlr-font-lock-literal-regexp'." |
| 888 | :group 'antlr) | 902 | :group 'antlr) |
| 903 | ;; backward-compatibility alias | ||
| 904 | (put 'antlr-font-lock-literal-face 'face-alias 'antlr-literal) | ||
| 889 | 905 | ||
| 890 | (defcustom antlr-font-lock-literal-regexp "\"\\(\\sw\\(\\sw\\|-\\)*\\)\"" | 906 | (defcustom antlr-font-lock-literal-regexp "\"\\(\\sw\\(\\sw\\|-\\)*\\)\"" |
| 891 | "Regexp matching literals with special syntax highlighting, or nil. | 907 | "Regexp matching literals with special syntax highlighting, or nil. |
| @@ -904,56 +920,56 @@ group. The string matched by the first group is highlighted with | |||
| 904 | (cond-emacs-xemacs | 920 | (cond-emacs-xemacs |
| 905 | `((antlr-invalidate-context-cache) | 921 | `((antlr-invalidate-context-cache) |
| 906 | ("\\$setType[ \t]*(\\([A-Za-z\300-\326\330-\337]\\sw*\\))" | 922 | ("\\$setType[ \t]*(\\([A-Za-z\300-\326\330-\337]\\sw*\\))" |
| 907 | (1 antlr-font-lock-tokendef-face)) | 923 | (1 antlr-tokendef-face)) |
| 908 | ("\\$\\sw+" (0 font-lock-keyword-face)) | 924 | ("\\$\\sw+" (0 keyword-face)) |
| 909 | ;; the tokens are already fontified as string/docstrings: | 925 | ;; the tokens are already fontified as string/docstrings: |
| 910 | (,(lambda (limit) | 926 | (,(lambda (limit) |
| 911 | (if antlr-font-lock-literal-regexp | 927 | (if antlr-literal-regexp |
| 912 | (antlr-re-search-forward antlr-font-lock-literal-regexp limit))) | 928 | (antlr-re-search-forward antlr-font-lock-literal-regexp limit))) |
| 913 | (1 antlr-font-lock-literal-face t) | 929 | (1 antlr-literal-face t) |
| 914 | :XEMACS (0 nil)) ; XEmacs bug workaround | 930 | :XEMACS (0 nil)) ; XEmacs bug workaround |
| 915 | (,(lambda (limit) | 931 | (,(lambda (limit) |
| 916 | (antlr-re-search-forward antlr-class-header-regexp limit)) | 932 | (antlr-re-search-forward antlr-class-header-regexp limit)) |
| 917 | (1 antlr-font-lock-keyword-face) | 933 | (1 antlr-keyword-face) |
| 918 | (2 antlr-font-lock-ruledef-face) | 934 | (2 antlr-ruledef-face) |
| 919 | (3 antlr-font-lock-keyword-face) | 935 | (3 antlr-keyword-face) |
| 920 | (4 (if (member (match-string 4) '("Lexer" "Parser" "TreeParser")) | 936 | (4 (if (member (match-string 4) '("Lexer" "Parser" "TreeParser")) |
| 921 | 'antlr-font-lock-keyword-face | 937 | antlr-keyword-face |
| 922 | 'font-lock-type-face))) | 938 | type-face))) |
| 923 | (,(lambda (limit) | 939 | (,(lambda (limit) |
| 924 | (antlr-re-search-forward | 940 | (antlr-re-search-forward |
| 925 | "\\<\\(header\\|options\\|tokens\\|exception\\|catch\\|returns\\)\\>" | 941 | "\\<\\(header\\|options\\|tokens\\|exception\\|catch\\|returns\\)\\>" |
| 926 | limit)) | 942 | limit)) |
| 927 | (1 antlr-font-lock-keyword-face)) | 943 | (1 antlr-keyword-face)) |
| 928 | (,(lambda (limit) | 944 | (,(lambda (limit) |
| 929 | (antlr-re-search-forward | 945 | (antlr-re-search-forward |
| 930 | "^\\(private\\|public\\|protected\\)\\>[ \t]*\\(\\(\\sw+[ \t]*\\(:\\)?\\)\\)?" | 946 | "^\\(private\\|public\\|protected\\)\\>[ \t]*\\(\\(\\sw+[ \t]*\\(:\\)?\\)\\)?" |
| 931 | limit)) | 947 | limit)) |
| 932 | (1 font-lock-type-face) ; not XEmacs' java level-3 fruit salad | 948 | (1 font-lock-type-face) ; not XEmacs' java level-3 fruit salad |
| 933 | (3 (if (antlr-upcase-p (char-after (match-beginning 3))) | 949 | (3 (if (antlr-upcase-p (char-after (match-beginning 3))) |
| 934 | 'antlr-font-lock-tokendef-face | 950 | antlr-tokendef-face |
| 935 | 'antlr-font-lock-ruledef-face) nil t) | 951 | antlr-ruledef-face) nil t) |
| 936 | (4 antlr-font-lock-syntax-face nil t)) | 952 | (4 antlr-syntax-face nil t)) |
| 937 | (,(lambda (limit) | 953 | (,(lambda (limit) |
| 938 | (antlr-re-search-forward "^\\(\\sw+\\)[ \t]*\\(:\\)?" limit)) | 954 | (antlr-re-search-forward "^\\(\\sw+\\)[ \t]*\\(:\\)?" limit)) |
| 939 | (1 (if (antlr-upcase-p (char-after (match-beginning 0))) | 955 | (1 (if (antlr-upcase-p (char-after (match-beginning 0))) |
| 940 | 'antlr-font-lock-tokendef-face | 956 | antlr-tokendef-face |
| 941 | 'antlr-font-lock-ruledef-face) nil t) | 957 | antlr-ruledef-face) nil t) |
| 942 | (2 antlr-font-lock-syntax-face nil t)) | 958 | (2 antlr-syntax-face nil t)) |
| 943 | (,(lambda (limit) | 959 | (,(lambda (limit) |
| 944 | ;; v:ruleref and v:"literal" is allowed... | 960 | ;; v:ruleref and v:"literal" is allowed... |
| 945 | (antlr-re-search-forward "\\(\\sw+\\)[ \t]*\\([=:]\\)?" limit)) | 961 | (antlr-re-search-forward "\\(\\sw+\\)[ \t]*\\([=:]\\)?" limit)) |
| 946 | (1 (if (match-beginning 2) | 962 | (1 (if (match-beginning 2) |
| 947 | (if (eq (char-after (match-beginning 2)) ?=) | 963 | (if (eq (char-after (match-beginning 2)) ?=) |
| 948 | 'antlr-font-lock-default-face | 964 | antlr-default-face |
| 949 | 'font-lock-variable-name-face) | 965 | font-lock-variable-name-face) |
| 950 | (if (antlr-upcase-p (char-after (match-beginning 1))) | 966 | (if (antlr-upcase-p (char-after (match-beginning 1))) |
| 951 | 'antlr-font-lock-tokenref-face | 967 | antlr-tokenref-face |
| 952 | 'antlr-font-lock-ruleref-face))) | 968 | antlr-ruleref-face))) |
| 953 | (2 antlr-font-lock-default-face nil t)) | 969 | (2 antlr-default-face nil t)) |
| 954 | (,(lambda (limit) | 970 | (,(lambda (limit) |
| 955 | (antlr-re-search-forward "[|&:;(~]\\|)\\([*+?]\\|=>\\)?" limit)) | 971 | (antlr-re-search-forward "[|&:;(~]\\|)\\([*+?]\\|=>\\)?" limit)) |
| 956 | (0 'antlr-font-lock-syntax-face)))) | 972 | (0 antlr-syntax-face)))) |
| 957 | "Font-lock keywords for ANTLR's normal grammar code. | 973 | "Font-lock keywords for ANTLR's normal grammar code. |
| 958 | See `antlr-font-lock-keywords-alist' for the keywords of actions.") | 974 | See `antlr-font-lock-keywords-alist' for the keywords of actions.") |
| 959 | 975 | ||