Mercurial > emacs
comparison lisp/font-lock.el @ 21134:060f95085d3d
(scheme-font-lock-keywords-1, scheme-font-lock-keywords-2,
scheme-font-lock-keywords): Moved.
author | Dave Love <fx@gnu.org> |
---|---|
date | Tue, 10 Mar 1998 22:54:43 +0000 |
parents | ae0c93b9ac1f |
children | febfd4282be6 |
comparison
equal
deleted
inserted
replaced
21133:ea8428070d53 | 21134:060f95085d3d |
---|---|
471 lisp-font-lock-keywords-1 lisp-font-lock-keywords-2) | 471 lisp-font-lock-keywords-1 lisp-font-lock-keywords-2) |
472 nil nil (("+-*/.<>=!?$%_&~^:" . "w")) beginning-of-defun | 472 nil nil (("+-*/.<>=!?$%_&~^:" . "w")) beginning-of-defun |
473 ;; Obsoleted by Emacs 20 parse-partial-sexp's COMMENTSTOP. | 473 ;; Obsoleted by Emacs 20 parse-partial-sexp's COMMENTSTOP. |
474 ;(font-lock-comment-start-regexp . ";") | 474 ;(font-lock-comment-start-regexp . ";") |
475 (font-lock-mark-block-function . mark-defun))) | 475 (font-lock-mark-block-function . mark-defun))) |
476 (scheme-mode-defaults | |
477 '((scheme-font-lock-keywords | |
478 scheme-font-lock-keywords-1 scheme-font-lock-keywords-2) | |
479 nil t (("+-*/.<>=!?$%_&~^:" . "w")) beginning-of-defun | |
480 ;; Obsoleted by Emacs 20 parse-partial-sexp's COMMENTSTOP. | |
481 ;(font-lock-comment-start-regexp . ";") | |
482 (font-lock-mark-block-function . mark-defun))) | |
483 ;; For TeX modes we could use `backward-paragraph' for the same reason. | 476 ;; For TeX modes we could use `backward-paragraph' for the same reason. |
484 ;; But we don't, because paragraph breaks are arguably likely enough to | 477 ;; But we don't, because paragraph breaks are arguably likely enough to |
485 ;; occur within a genuine syntactic block to make it too risky. | 478 ;; occur within a genuine syntactic block to make it too risky. |
486 ;; However, we do specify a MARK-BLOCK function as that cannot result | 479 ;; However, we do specify a MARK-BLOCK function as that cannot result |
487 ;; in a mis-fontification even if it might not fontify enough. --sm. | 480 ;; in a mis-fontification even if it might not fontify enough. --sm. |
497 (cons 'c-mode c-mode-defaults) | 490 (cons 'c-mode c-mode-defaults) |
498 (cons 'c++-mode c++-mode-defaults) | 491 (cons 'c++-mode c++-mode-defaults) |
499 (cons 'objc-mode objc-mode-defaults) | 492 (cons 'objc-mode objc-mode-defaults) |
500 (cons 'java-mode java-mode-defaults) | 493 (cons 'java-mode java-mode-defaults) |
501 (cons 'emacs-lisp-mode lisp-mode-defaults) | 494 (cons 'emacs-lisp-mode lisp-mode-defaults) |
502 (cons 'inferior-scheme-mode scheme-mode-defaults) | |
503 (cons 'latex-mode tex-mode-defaults) | 495 (cons 'latex-mode tex-mode-defaults) |
504 (cons 'lisp-mode lisp-mode-defaults) | 496 (cons 'lisp-mode lisp-mode-defaults) |
505 (cons 'lisp-interaction-mode lisp-mode-defaults) | 497 (cons 'lisp-interaction-mode lisp-mode-defaults) |
506 (cons 'plain-tex-mode tex-mode-defaults) | 498 (cons 'plain-tex-mode tex-mode-defaults) |
507 (cons 'scheme-mode scheme-mode-defaults) | |
508 (cons 'scheme-interaction-mode scheme-mode-defaults) | |
509 (cons 'slitex-mode tex-mode-defaults) | 499 (cons 'slitex-mode tex-mode-defaults) |
510 (cons 'tex-mode tex-mode-defaults))) | 500 (cons 'tex-mode tex-mode-defaults))) |
511 "Alist of fall-back Font Lock defaults for major modes. | 501 "Alist of fall-back Font Lock defaults for major modes. |
512 Each item should be a list of the form: | 502 Each item should be a list of the form: |
513 | 503 |
1992 "Gaudy level highlighting for Lisp modes.") | 1982 "Gaudy level highlighting for Lisp modes.") |
1993 | 1983 |
1994 (defvar lisp-font-lock-keywords lisp-font-lock-keywords-1 | 1984 (defvar lisp-font-lock-keywords lisp-font-lock-keywords-1 |
1995 "Default expressions to highlight in Lisp modes.") | 1985 "Default expressions to highlight in Lisp modes.") |
1996 | 1986 |
1997 ;; Scheme. | |
1998 | |
1999 (defconst scheme-font-lock-keywords-1 | |
2000 (eval-when-compile | |
2001 (list | |
2002 ;; | |
2003 ;; Declarations. Hannes Haug <hannes.haug@student.uni-tuebingen.de> says | |
2004 ;; this works for SOS, STklos, SCOOPS, Meroon and Tiny CLOS. | |
2005 (list (concat "(\\(define\\(" | |
2006 ;; Function names. | |
2007 "\\(\\|-method\\|-generic\\(-procedure\\)?\\)\\|" | |
2008 ;; Macro names, as variable names. A bit dubious, this. | |
2009 "\\(-syntax\\)\\|" | |
2010 ;; Class names. | |
2011 "-class" | |
2012 "\\)\\)\\>" | |
2013 ;; Any whitespace and declared object. | |
2014 "[ \t]*(?" | |
2015 "\\(\\sw+\\)?") | |
2016 '(1 font-lock-keyword-face) | |
2017 '(6 (cond ((match-beginning 3) font-lock-function-name-face) | |
2018 ((match-beginning 5) font-lock-variable-name-face) | |
2019 (t font-lock-type-face)) | |
2020 nil t)) | |
2021 )) | |
2022 "Subdued expressions to highlight in Scheme modes.") | |
2023 | |
2024 (defconst scheme-font-lock-keywords-2 | |
2025 (append scheme-font-lock-keywords-1 | |
2026 (eval-when-compile | |
2027 (list | |
2028 ;; | |
2029 ;; Control structures. | |
2030 (cons | |
2031 (concat | |
2032 "(" (regexp-opt | |
2033 '("begin" "call-with-current-continuation" "call/cc" | |
2034 "call-with-input-file" "call-with-output-file" "case" "cond" | |
2035 "do" "else" "for-each" "if" "lambda" | |
2036 "let" "let*" "let-syntax" "letrec" "letrec-syntax" | |
2037 ;; Hannes Haug <hannes.haug@student.uni-tuebingen.de> wants: | |
2038 "and" "or" "delay" | |
2039 ;; Stefan Monnier <stefan.monnier@epfl.ch> says don't bother: | |
2040 ;;"quasiquote" "quote" "unquote" "unquote-splicing" | |
2041 "map" "syntax" "syntax-rules") t) | |
2042 "\\>") 1) | |
2043 ;; | |
2044 ;; David Fox <fox@graphics.cs.nyu.edu> for SOS/STklos class specifiers. | |
2045 '("\\<<\\sw+>\\>" . font-lock-type-face) | |
2046 ;; | |
2047 ;; Scheme `:' keywords as builtins. | |
2048 '("\\<:\\sw+\\>" . font-lock-builtin-face) | |
2049 ))) | |
2050 "Gaudy expressions to highlight in Scheme modes.") | |
2051 | |
2052 (defvar scheme-font-lock-keywords scheme-font-lock-keywords-1 | |
2053 "Default expressions to highlight in Scheme modes.") | |
2054 | |
2055 ;; TeX. | 1987 ;; TeX. |
2056 | 1988 |
2057 ;(defvar tex-font-lock-keywords | 1989 ;(defvar tex-font-lock-keywords |
2058 ; ;; Regexps updated with help from Ulrik Dickow <dickow@nbi.dk>. | 1990 ; ;; Regexps updated with help from Ulrik Dickow <dickow@nbi.dk>. |
2059 ; '(("\\\\\\(begin\\|end\\|newcommand\\){\\([a-zA-Z0-9\\*]+\\)}" | 1991 ; '(("\\\\\\(begin\\|end\\|newcommand\\){\\([a-zA-Z0-9\\*]+\\)}" |