comparison lisp/progmodes/tcl.el @ 12403:f863ead116f0

(tcl-set-proc-regexp): Allow leading spaces. (tcl-proc-list): Changes for itcl. (tcl-typeword-list): Ditto. (tcl-keyword-list): Ditto.
author Tom Tromey <tromey@redhat.com>
date Tue, 27 Jun 1995 20:01:29 +0000
parents 6060e368ff05
children cf59ada47a1c
comparison
equal deleted inserted replaced
12402:62e4bc95cecd 12403:f863ead116f0
4 4
5 ;; Maintainer: Tom Tromey <tromey@busco.lanl.gov> 5 ;; Maintainer: Tom Tromey <tromey@busco.lanl.gov>
6 ;; Author: Tom Tromey <tromey@busco.lanl.gov> 6 ;; Author: Tom Tromey <tromey@busco.lanl.gov>
7 ;; Chris Lindblad <cjl@lcs.mit.edu> 7 ;; Chris Lindblad <cjl@lcs.mit.edu>
8 ;; Keywords: languages tcl modes 8 ;; Keywords: languages tcl modes
9 ;; Version: $Revision: 1.31 $ 9 ;; Version: $Revision: 1.32 $
10 10
11 ;; This file is part of GNU Emacs. 11 ;; This file is part of GNU Emacs.
12 12
13 ;; GNU Emacs is free software; you can redistribute it and/or modify 13 ;; GNU Emacs is free software; you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by 14 ;; it under the terms of the GNU General Public License as published by
49 ;;; Commentary: 49 ;;; Commentary:
50 50
51 ;; LCD Archive Entry: 51 ;; LCD Archive Entry:
52 ;; tcl|Tom Tromey|tromey@busco.lanl.gov| 52 ;; tcl|Tom Tromey|tromey@busco.lanl.gov|
53 ;; Major mode for editing Tcl| 53 ;; Major mode for editing Tcl|
54 ;; $Date: 1995/05/10 23:38:12 $|$Revision: 1.31 $|~/modes/tcl.el.Z| 54 ;; $Date: 1995/05/11 22:12:49 $|$Revision: 1.32 $|~/modes/tcl.el.Z|
55 55
56 ;; CUSTOMIZATION NOTES: 56 ;; CUSTOMIZATION NOTES:
57 ;; * tcl-proc-list can be used to customize a list of things that 57 ;; * tcl-proc-list can be used to customize a list of things that
58 ;; "define" other things. Eg in my project I put "defvar" in this 58 ;; "define" other things. Eg in my project I put "defvar" in this
59 ;; list. 59 ;; list.
63 ;; * tcl-type-alist can be used to minimally customize indentation 63 ;; * tcl-type-alist can be used to minimally customize indentation
64 ;; according to context. 64 ;; according to context.
65 65
66 ;; Change log: 66 ;; Change log:
67 ;; $Log: tcl.el,v $ 67 ;; $Log: tcl.el,v $
68 ;; Revision 1.32 1995/05/11 22:12:49 tromey
69 ;; (tcl-type-alist): Include entry for "proc".
70 ;;
68 ;; Revision 1.31 1995/05/10 23:38:12 tromey 71 ;; Revision 1.31 1995/05/10 23:38:12 tromey
69 ;; (tcl-add-fsf-menu): Use make-lucid-menu-keymap, not 72 ;; (tcl-add-fsf-menu): Use make-lucid-menu-keymap, not
70 ;; "make-xemacs-menu-keymap". 73 ;; "make-xemacs-menu-keymap".
71 ;; 74 ;;
72 ;; Revision 1.30 1995/05/10 18:22:21 tromey 75 ;; Revision 1.30 1995/05/10 18:22:21 tromey
298 (if (and (string-match "19\\." emacs-version) 301 (if (and (string-match "19\\." emacs-version)
299 (not (string-match "XEmacs" emacs-version))) 302 (not (string-match "XEmacs" emacs-version)))
300 (require 'imenu)) 303 (require 'imenu))
301 ())) 304 ()))
302 305
303 (defconst tcl-version "$Revision: 1.31 $") 306 (defconst tcl-version "$Revision: 1.32 $")
304 (defconst tcl-maintainer "Tom Tromey <tromey@drip.colorado.edu>") 307 (defconst tcl-maintainer "Tom Tromey <tromey@drip.colorado.edu>")
305 308
306 ;; 309 ;;
307 ;; User variables. 310 ;; User variables.
308 ;; 311 ;;
585 588
586 (defvar inferior-tcl-mode-hook nil 589 (defvar inferior-tcl-mode-hook nil
587 "Hook for customizing Inferior Tcl mode.") 590 "Hook for customizing Inferior Tcl mode.")
588 591
589 (defvar tcl-proc-list 592 (defvar tcl-proc-list
590 '("proc") 593 '("proc" "method" "itcl_class")
591 "List of commands whose first argument defines something. 594 "List of commands whose first argument defines something.
592 This exists because some people (eg, me) use \"defvar\" et al. 595 This exists because some people (eg, me) use \"defvar\" et al.
593 Call `tcl-set-proc-regexp' and `tcl-set-font-lock-keywords' 596 Call `tcl-set-proc-regexp' and `tcl-set-font-lock-keywords'
594 after changing this list.") 597 after changing this list.")
595 598
596 (defvar tcl-proc-regexp nil 599 (defvar tcl-proc-regexp nil
597 "Regexp to use when matching proc headers.") 600 "Regexp to use when matching proc headers.")
598 601
599 (defvar tcl-typeword-list 602 (defvar tcl-typeword-list
600 '("global" "upvar") 603 '("global" "upvar" "inherit" "public" "protected" "common")
601 "List of Tcl keywords denoting \"type\". Used only for highlighting. 604 "List of Tcl keywords denoting \"type\". Used only for highlighting.
602 Call `tcl-set-font-lock-keywords' after changing this list.") 605 Call `tcl-set-font-lock-keywords' after changing this list.")
603 606
604 ;; Generally I've picked control operators to be keywords. 607 ;; Generally I've picked control operators to be keywords.
605 (defvar tcl-keyword-list 608 (defvar tcl-keyword-list
606 '("if" "then" "else" "elseif" "for" "foreach" "break" "continue" "while" 609 '("if" "then" "else" "elseif" "for" "foreach" "break" "continue" "while"
607 "eval" "case" "in" "switch" "default" "exit" "error" "proc" "return" 610 "eval" "case" "in" "switch" "default" "exit" "error" "proc" "return"
608 "uplevel" "loop" "for_array_keys" "for_recursive_glob" "for_file") 611 "uplevel" "constructor" "destructor" "itcl_class" "loop" "for_array_keys"
612 "for_recursive_glob" "for_file")
609 "List of Tcl keywords. Used only for highlighting. 613 "List of Tcl keywords. Used only for highlighting.
610 Default list includes some TclX keywords. 614 Default list includes some TclX keywords.
611 Call `tcl-set-font-lock-keywords' after changing this list.") 615 Call `tcl-set-font-lock-keywords' after changing this list.")
612 616
613 (defvar tcl-font-lock-keywords nil 617 (defvar tcl-font-lock-keywords nil
788 ;; Some helper functions. 792 ;; Some helper functions.
789 ;; 793 ;;
790 794
791 (defun tcl-set-proc-regexp () 795 (defun tcl-set-proc-regexp ()
792 "Set `tcl-proc-regexp' from variable `tcl-proc-list'." 796 "Set `tcl-proc-regexp' from variable `tcl-proc-list'."
793 (setq tcl-proc-regexp (concat "^\\(" 797 (setq tcl-proc-regexp (concat "^\\s-*\\("
794 (mapconcat 'identity tcl-proc-list "\\|") 798 (mapconcat 'identity tcl-proc-list "\\|")
795 "\\)[ \t]+"))) 799 "\\)[ \t]+")))
796 800
797 (defun tcl-set-font-lock-keywords () 801 (defun tcl-set-font-lock-keywords ()
798 "Set `tcl-font-lock-keywords'. 802 "Set `tcl-font-lock-keywords'.