comparison lisp/font-lock.el @ 771:943eaba38521

[xemacs-hg @ 2002-03-13 08:51:24 by ben] The big ben-mule-21-5 check-in! Various files were added and deleted. See CHANGES-ben-mule. There are still some test suite failures. No crashes, though. Many of the failures have to do with problems in the test suite itself rather than in the actual code. I'll be addressing these in the next day or so -- none of the test suite failures are at all critical. Meanwhile I'll be trying to address the biggest issues -- i.e. build or run failures, which will almost certainly happen on various platforms. All comments should be sent to ben@xemacs.org -- use a Cc: if necessary when sending to mailing lists. There will be pre- and post- tags, something like pre-ben-mule-21-5-merge-in, and post-ben-mule-21-5-merge-in.
author ben
date Wed, 13 Mar 2002 08:54:06 +0000
parents cd697e94b3d4
children 79940b592197
comparison
equal deleted inserted replaced
770:336a418893b5 771:943eaba38521
1 ;;; font-lock.el --- decorating source files with fonts/colors based on syntax 1 ;;; font-lock.el --- decorating source files with fonts/colors based on syntax
2 2
3 ;; Copyright (C) 1992-1995, 1997 Free Software Foundation, Inc. 3 ;; Copyright (C) 1992-1995, 1997 Free Software Foundation, Inc.
4 ;; Copyright (C) 1995 Amdahl Corporation. 4 ;; Copyright (C) 1995 Amdahl Corporation.
5 ;; Copyright (C) 1996, 2000, 2001 Ben Wing. 5 ;; Copyright (C) 1996, 2000, 2001, 2002 Ben Wing.
6 6
7 ;; Author: Jamie Zawinski <jwz@jwz.org>, for the LISPM Preservation Society. 7 ;; Author: Jamie Zawinski <jwz@jwz.org>, for the LISPM Preservation Society.
8 ;; Minimally merged with FSF 19.34 by Barry Warsaw <bwarsaw@python.org> 8 ;; Minimally merged with FSF 19.34 by Barry Warsaw <bwarsaw@python.org>
9 ;; Then (partially) synched with FSF 19.30, leading to: 9 ;; Then (partially) synched with FSF 19.30, leading to:
10 ;; Next Author: RMS 10 ;; Next Author: RMS
1937 ;;; Various regexp information shared by several modes. 1937 ;;; Various regexp information shared by several modes.
1938 ;;; Information specific to a single mode should go in its load library. 1938 ;;; Information specific to a single mode should go in its load library.
1939 1939
1940 (defconst lisp-font-lock-keywords-1 1940 (defconst lisp-font-lock-keywords-1
1941 (list 1941 (list
1942 ;; Anything not a variable or type declaration is fontified as a function. 1942 ;; Anything not a function or type declaration is fontified as a
1943 ;; It would be cleaner to allow preceding whitespace, but it would also be 1943 ;; variable. It would be cleaner to allow preceding whitespace, but it
1944 ;; about five times slower. 1944 ;; would also be about five times slower. We used to fontify unknown
1945 ;; stuff as functions, rather than variables, but random things are
1946 ;; generally more like variables (no parameters), and the function and
1947 ;; keyword colors are currently the same, while the variable color is
1948 ;; different, which looks better.
1945 (list (concat "^(\\(def\\(" 1949 (list (concat "^(\\(def\\("
1946 ;; Variable declarations. 1950 ;; Function declarations.
1947 "\\(const\\(\\|ant\\)\\|ine-key\\(\\|-after\\)\\|var\\|custom\\)\\|" 1951 "\\(un\\|advice\\|alias\\|macro\\|macro\\*\\|setf\\|subst\\|"
1952 "subst\\*\\|-edebug-spec\\|"
1953 "ine-\\(ccl-program\\|compatible-function-alias\\|"
1954 "compiler-macro\\|device-method\\|device-method\\*\\|"
1955 "function\\|function-when-void\\|modify-macro\\|"
1956 "obsolete-function-alias\\|prefix-command\\|setf-method\\|"
1957 "skeleton\\)\\)\\|"
1948 ;; Structure declarations. 1958 ;; Structure declarations.
1949 "\\(class\\|struct\\|type\\)\\|" 1959 "\\(class\\|struct\\|type\\)\\|"
1960 ;; Former variable declarations, but woefully inadequate.
1961 ;"\\(const\\(\\|ant\\)\\|ine-key\\(\\|-after\\)\\|var\\|custom\\)\\|"
1950 ;; Everything else is a function declaration. 1962 ;; Everything else is a function declaration.
1951 "\\([^ \t\n\(\)]+\\)" 1963 "\\([^ \t\n\(\)]+\\)"
1952 "\\)\\)\\>" 1964 "\\)\\)\\>"
1953 ;; Any whitespace and declared object. 1965 ;; Any whitespace and declared object.
1954 "[ \t'\(]*" 1966 "[ \t'\(]*"
1955 "\\([^ \t\n\)]+\\)?") 1967 "\\([^ \t\n\)]+\\)?")
1956 '(1 font-lock-keyword-face) 1968 '(1 font-lock-keyword-face)
1957 '(8 (cond ((match-beginning 3) 'font-lock-variable-name-face) 1969 '(7 (cond ((match-beginning 3) 'font-lock-function-name-face)
1958 ((match-beginning 6) 'font-lock-type-face) 1970 ((match-beginning 5) 'font-lock-type-face)
1959 (t 'font-lock-function-name-face)) 1971 (t 'font-lock-variable-name-face))
1960 nil t)) 1972 nil t))
1961 ) 1973 )
1962 "Subdued level highlighting Lisp modes.") 1974 "Subdued level highlighting Lisp modes.")
1963 1975
1964 (defconst lisp-font-lock-keywords-2 1976 (defconst lisp-font-lock-keywords-2