Mercurial > emacs
comparison lisp/progmodes/dcl-mode.el @ 50044:534fbe8d6c4b
(dcl-font-lock-keywords, dcl-font-lock-defaults): New vars.
(dcl-mode): Make and init local var `font-lock-defaults'.
author | Thien-Thi Nguyen <ttn@gnuvola.org> |
---|---|
date | Thu, 06 Mar 2003 23:10:12 +0000 |
parents | 0d8b17d428b5 |
children | 695cf19ef79e |
comparison
equal
deleted
inserted
replaced
50043:90beb357e9f5 | 50044:534fbe8d6c4b |
---|---|
49 ;; dcl-calc-command-indent-function or dcl-calc-cont-indent-function, | 49 ;; dcl-calc-command-indent-function or dcl-calc-cont-indent-function, |
50 ;; please send them to the maintainer. | 50 ;; please send them to the maintainer. |
51 ;; | 51 ;; |
52 ;; | 52 ;; |
53 ;; Ideas for improvement: | 53 ;; Ideas for improvement: |
54 ;; * Better font-lock support. | |
54 ;; * Change meaning of `left margin' when dcl-tab-always-indent is nil. | 55 ;; * Change meaning of `left margin' when dcl-tab-always-indent is nil. |
55 ;; Consider the following line (`_' is the cursor): | 56 ;; Consider the following line (`_' is the cursor): |
56 ;; $ label: _ command | 57 ;; $ label: _ command |
57 ;; Pressing tab with the cursor at the underline now inserts a tab. | 58 ;; Pressing tab with the cursor at the underline now inserts a tab. |
58 ;; This should be part of the left margin and pressing tab should indent | 59 ;; This should be part of the left margin and pressing tab should indent |
68 ;; complete command line? A block? A subroutine? | 69 ;; complete command line? A block? A subroutine? |
69 | 70 |
70 ;;; Code: | 71 ;;; Code: |
71 | 72 |
72 ;;; *** Customization ***************************************************** | 73 ;;; *** Customization ***************************************************** |
74 | |
75 | |
76 ;; First, font lock. This is a minimal approach, please improve! | |
77 | |
78 (defvar dcl-font-lock-keywords | |
79 '(("\\<\\(if\\|then\\|else\\|endif\\)\\>" | |
80 1 font-lock-keyword-face) | |
81 ("\\<f[$][a-z]+\\>" | |
82 0 font-lock-builtin-face) | |
83 ("[.]\\(eq\\|not\\|or\\|and\\|lt\\|gt\\|le\\|ge\\|eqs\\|nes\\)[.]" | |
84 0 font-lock-builtin-face)) | |
85 "Font lock keyword specification for DCL mode. | |
86 Presently this includes some syntax, .OP.erators, and \"f$\" lexicals.") | |
87 | |
88 (defvar dcl-font-lock-defaults | |
89 '(dcl-font-lock-keywords nil) | |
90 "Font lock specification for DCL mode.") | |
91 | |
92 | |
93 ;; Now the rest. | |
73 | 94 |
74 (defgroup dcl nil | 95 (defgroup dcl nil |
75 "Major mode for editing DCL command files." | 96 "Major mode for editing DCL command files." |
76 :group 'languages) | 97 :group 'languages) |
77 | 98 |
564 $ type sys$input | 585 $ type sys$input |
565 Data lines are not indented at all. | 586 Data lines are not indented at all. |
566 $ endloop1: ! This matches dcl-block-end-regexp | 587 $ endloop1: ! This matches dcl-block-end-regexp |
567 $ endif | 588 $ endif |
568 $ | 589 $ |
569 " | 590 |
591 | |
592 There is some minimal font-lock support (see vars | |
593 `dcl-font-lock-defaults' and `dcl-font-lock-keywords')." | |
570 (interactive) | 594 (interactive) |
571 (kill-all-local-variables) | 595 (kill-all-local-variables) |
572 (set-syntax-table dcl-mode-syntax-table) | 596 (set-syntax-table dcl-mode-syntax-table) |
573 | 597 |
574 (make-local-variable 'indent-line-function) | 598 (make-local-variable 'indent-line-function) |
606 (make-local-variable 'dcl-tab-always-indent) | 630 (make-local-variable 'dcl-tab-always-indent) |
607 (make-local-variable 'dcl-electric-characters) | 631 (make-local-variable 'dcl-electric-characters) |
608 (make-local-variable 'dcl-calc-command-indent-function) | 632 (make-local-variable 'dcl-calc-command-indent-function) |
609 (make-local-variable 'dcl-calc-cont-indent-function) | 633 (make-local-variable 'dcl-calc-cont-indent-function) |
610 (make-local-variable 'dcl-electric-reindent-regexps) | 634 (make-local-variable 'dcl-electric-reindent-regexps) |
635 | |
636 ;; font lock | |
637 (make-local-variable 'font-lock-defaults) | |
638 (setq font-lock-defaults dcl-font-lock-defaults) | |
611 | 639 |
612 (setq major-mode 'dcl-mode) | 640 (setq major-mode 'dcl-mode) |
613 (setq mode-name "DCL") | 641 (setq mode-name "DCL") |
614 (use-local-map dcl-mode-map) | 642 (use-local-map dcl-mode-map) |
615 (tempo-use-tag-list 'dcl-tempo-tags) | 643 (tempo-use-tag-list 'dcl-tempo-tags) |