comparison lisp/progmodes/tcl.el @ 12924:8172973fd6e4

(tcl-hilit): New function from "Chris Alfeld" <calfeld@math.utah.edu> (tcl-mode): Call it
author Tom Tromey <tromey@redhat.com>
date Tue, 22 Aug 1995 17:49:45 +0000
parents 841ba4b250a4
children 5a8356dc9ffc
comparison
equal deleted inserted replaced
12923:f1e05398634b 12924:8172973fd6e4
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.45 $ 9 ;; Version: $Revision: 1.46 $
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/07/23 23:51:25 $|$Revision: 1.45 $|~/modes/tcl.el.Z| 54 ;; $Date: 1995/08/07 16:02:01 $|$Revision: 1.46 $|~/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.46 1995/08/07 16:02:01 tromey
69 ;; (tcl-do-auto-fill): Only fill past fill-column; for 19.29.
70 ;; (tcl-auto-fill-mode): Use force-mode-line-update.
71 ;;
68 ;; Revision 1.45 1995/07/23 23:51:25 tromey 72 ;; Revision 1.45 1995/07/23 23:51:25 tromey
69 ;; (tcl-word-no-props): New function. 73 ;; (tcl-word-no-props): New function.
70 ;; (tcl-figure-type): Use it. 74 ;; (tcl-figure-type): Use it.
71 ;; (tcl-current-word): Ditto. 75 ;; (tcl-current-word): Ditto.
72 ;; 76 ;;
276 ;; warsaw@nlm.nih.gov (Barry A. Warsaw) 280 ;; warsaw@nlm.nih.gov (Barry A. Warsaw)
277 ;; Carl Witty <cwitty@ai.mit.edu> 281 ;; Carl Witty <cwitty@ai.mit.edu>
278 ;; T. V. Raman <raman@crl.dec.com> 282 ;; T. V. Raman <raman@crl.dec.com>
279 ;; Jesper Pedersen <blackie@imada.ou.dk> 283 ;; Jesper Pedersen <blackie@imada.ou.dk>
280 ;; dfarmer@evolving.com (Doug Farmer) 284 ;; dfarmer@evolving.com (Doug Farmer)
285 ;; "Chris Alfeld" <calfeld@math.utah.edu>
281 286
282 ;; KNOWN BUGS: 287 ;; KNOWN BUGS:
283 ;; * indent-region should skip blank lines. (It does in v19, so I'm 288 ;; * indent-region should skip blank lines. (It does in v19, so I'm
284 ;; not motivated to fix it here). 289 ;; not motivated to fix it here).
285 ;; * In Tcl "#" is not always a comment character. This can confuse 290 ;; * In Tcl "#" is not always a comment character. This can confuse
348 (if (and (string-match "19\\." emacs-version) 353 (if (and (string-match "19\\." emacs-version)
349 (not (string-match "XEmacs" emacs-version))) 354 (not (string-match "XEmacs" emacs-version)))
350 (require 'imenu)) 355 (require 'imenu))
351 ())) 356 ()))
352 357
353 (defconst tcl-version "$Revision: 1.45 $") 358 (defconst tcl-version "$Revision: 1.46 $")
354 (defconst tcl-maintainer "Tom Tromey <tromey@drip.colorado.edu>") 359 (defconst tcl-maintainer "Tom Tromey <tromey@drip.colorado.edu>")
355 360
356 ;; 361 ;;
357 ;; User variables. 362 ;; User variables.
358 ;; 363 ;;
1009 (add-menu nil "Tcl" tcl-xemacs-menu))) 1014 (add-menu nil "Tcl" tcl-xemacs-menu)))
1010 ;; Append Tcl menu to popup menu for XEmacs. 1015 ;; Append Tcl menu to popup menu for XEmacs.
1011 (if (and tcl-using-xemacs-19 (boundp 'mode-popup-menu)) 1016 (if (and tcl-using-xemacs-19 (boundp 'mode-popup-menu))
1012 (setq mode-popup-menu 1017 (setq mode-popup-menu
1013 (cons (concat mode-name " Mode Commands") tcl-xemacs-menu))) 1018 (cons (concat mode-name " Mode Commands") tcl-xemacs-menu)))
1019
1020 ;; If hilit19 is loaded, add our stuff.
1021 (if (featurep 'hilit19)
1022 (tcl-hilit))
1014 1023
1015 (run-hooks 'tcl-mode-hook)) 1024 (run-hooks 'tcl-mode-hook))
1016 1025
1017 1026
1018 1027
1962 (> (prefix-numeric-value arg) 0)) 1971 (> (prefix-numeric-value arg) 0))
1963 'tcl-do-auto-fill 1972 'tcl-do-auto-fill
1964 nil)) 1973 nil))
1965 (force-mode-line-update))) 1974 (force-mode-line-update)))
1966 1975
1976 ;; hilit19 support from "Chris Alfeld" <calfeld@math.utah.edu>
1977 (defun tcl-hilit ()
1978 (hilit-set-mode-patterns
1979 '(tcl-mode)
1980 '(
1981 ("\\(^ *\\|\; *\\)#.*$" nil comment)
1982 ("[^\\]\\(\\$[A-Za-z0-9\\-\\_./\\(\\)]+\\)" 1 label)
1983 ("[^_]\\<\\(append\\|array\\|auto_execok\\|auto_load\\|auto_mkindex\\|auto_reset\\|break\\|case\\|catch\\|cd\\|close\\|concat\\|continue\\|eof\\|error\\|eval\\|exec\\|exit\\|expr\\|file\\|flush\\|for\\|foreach\\|format\\|gets\\|glob\\|global\\|history\\|if\\|incr\\|info\\|join\\|lappend\\|lindex\\|linsert\\|list\\|llength\\|lrange\\|lreplace\\|lsearch\\|lsort\\|open\\|pid\\|proc\\|puts\\|pwd\\|read\\|regexp\\|regsub\\|rename\\|return\\|scan\\|seek\\|set\\|source\\|split\\|string\\|switch\\|tell\\|time\\|trace\\|unknown\\|unset\\|uplevel\\|upvar\\|while\\)\\>[^_]" 1 keyword) ; tcl keywords
1984 ("[^_]\\<\\(after\\|bell\\|bind\\|bindtags\\|clipboard\\|destroy\\|fileevent\\|focus\\|grab\\|image\\|lower\\|option\\|pack\\|place\\|raise\\|scale\\|selection\\|send\\|subst\\|tk\\|tk_popup\\|tkwait\\|update\\|winfo\\|wm\\)\\>[^_]" 1 define) ; tk keywords
1985 ("[^_]\\<\\(button\\|canvas\\|checkbutton\\|entry\\|frame\\|label\\|listbox\\|menu\\|menubutton\\|message\\|radiobutton\\|scrollbar\\|text\\|toplevel\\)\\>[^_]" 1 decl) ; tk widgets
1986 ("[^_]\\<\\(tix\\((ButtonBox\\|Baloon\\|Control\\|DirList\\|ExFileSelectBox\\|ExFileSelectDialog\\|FileEntry\\|HList\\|LabelEntry\\|LabelFrame\\|NoteBook\\|OptionMenu\\|PanedWindow\\|PopupMenu\\|ScrolledHList\\|ScrolledText\\|ScrolledWindow\\|Select\\|StdButtonBox\\)\\)\\>[^_]" 1 defun) ; tix widgets
1987 ("[{}\\\"\\(\\)]" nil include) ; misc punctuation
1988 )))
1989
1967 (defun tcl-electric-hash (&optional count) 1990 (defun tcl-electric-hash (&optional count)
1968 "Insert a `#' and quote if it does not start a real comment. 1991 "Insert a `#' and quote if it does not start a real comment.
1969 Prefix arg is number of `#'s to insert. 1992 Prefix arg is number of `#'s to insert.
1970 See variable `tcl-electric-hash-style' for description of quoting 1993 See variable `tcl-electric-hash-style' for description of quoting
1971 styles." 1994 styles."