diff options
| author | Richard M. Stallman | 1999-08-04 22:55:56 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-08-04 22:55:56 +0000 |
| commit | 94662de752a38c2a029e7e89afed3537b54588e5 (patch) | |
| tree | 2f5398417fd90d9aef1d295fff2a22f3e638eca2 | |
| parent | d4c89075d6f148eab61270c944f5439bbeabb99e (diff) | |
| download | emacs-94662de752a38c2a029e7e89afed3537b54588e5.tar.gz emacs-94662de752a38c2a029e7e89afed3537b54588e5.zip | |
Customized.
| -rw-r--r-- | lisp/progmodes/tcl.el | 102 |
1 files changed, 66 insertions, 36 deletions
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index a79be867136..f0654f68721 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el | |||
| @@ -6,7 +6,7 @@ | |||
| 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.58 $ | 9 | ;; Version: $Revision: 1.59 $ |
| 10 | 10 | ||
| 11 | ;; This file is part of GNU Emacs. | 11 | ;; This file is part of GNU Emacs. |
| 12 | 12 | ||
| @@ -45,7 +45,7 @@ | |||
| 45 | ;; * tcl-type-alist can be used to minimally customize indentation | 45 | ;; * tcl-type-alist can be used to minimally customize indentation |
| 46 | ;; according to context. | 46 | ;; according to context. |
| 47 | 47 | ||
| 48 | ;; THANKS TO: | 48 | ;; THANKS FOR CRITICISM AND SUGGESTIONS TO: |
| 49 | ;; Guido Bosch <Guido.Bosch@loria.fr> | 49 | ;; Guido Bosch <Guido.Bosch@loria.fr> |
| 50 | ;; pgs1002@esc.cam.ac.uk (Dr P.G. Sjoerdsma) | 50 | ;; pgs1002@esc.cam.ac.uk (Dr P.G. Sjoerdsma) |
| 51 | ;; Mike Scheidler <c23mts@kocrsv01.delcoelect.com> | 51 | ;; Mike Scheidler <c23mts@kocrsv01.delcoelect.com> |
| @@ -63,8 +63,6 @@ | |||
| 63 | ;; Ben Wing <wing@666.com> | 63 | ;; Ben Wing <wing@666.com> |
| 64 | 64 | ||
| 65 | ;; KNOWN BUGS: | 65 | ;; KNOWN BUGS: |
| 66 | ;; * indent-region should skip blank lines. (It does in v19, so I'm | ||
| 67 | ;; not motivated to fix it here). | ||
| 68 | ;; * In Tcl "#" is not always a comment character. This can confuse | 66 | ;; * In Tcl "#" is not always a comment character. This can confuse |
| 69 | ;; tcl.el in certain circumstances. For now the only workaround is | 67 | ;; tcl.el in certain circumstances. For now the only workaround is |
| 70 | ;; to enclose offending hash characters in quotes or precede it with | 68 | ;; to enclose offending hash characters in quotes or precede it with |
| @@ -129,23 +127,33 @@ | |||
| 129 | (require 'imenu)) | 127 | (require 'imenu)) |
| 130 | ())) | 128 | ())) |
| 131 | 129 | ||
| 132 | (defconst tcl-version "$Revision: 1.58 $") | 130 | (defconst tcl-version "$Revision: 1.59 $") |
| 133 | (defconst tcl-maintainer "Tom Tromey <tromey@drip.colorado.edu>") | 131 | (defconst tcl-maintainer "Tom Tromey <tromey@drip.colorado.edu>") |
| 134 | 132 | ||
| 135 | ;; | 133 | ;; |
| 136 | ;; User variables. | 134 | ;; User variables. |
| 137 | ;; | 135 | ;; |
| 138 | 136 | ||
| 139 | (defvar tcl-indent-level 4 | 137 | (defgroup tcl nil |
| 140 | "*Indentation of Tcl statements with respect to containing block.") | 138 | "Major mode for editing Tcl source in Emacs" |
| 139 | :group 'languages) | ||
| 141 | 140 | ||
| 142 | (defvar tcl-continued-indent-level 4 | 141 | (defcustom tcl-indent-level 4 |
| 143 | "*Indentation of continuation line relative to first line of command.") | 142 | "*Indentation of Tcl statements with respect to containing block." |
| 143 | :group 'tcl | ||
| 144 | :type 'integer) | ||
| 144 | 145 | ||
| 145 | (defvar tcl-auto-newline nil | 146 | (defcustom tcl-continued-indent-level 4 |
| 146 | "*Non-nil means automatically newline before and after braces you insert.") | 147 | "*Indentation of continuation line relative to first line of command." |
| 148 | :group 'tcl | ||
| 149 | :type 'integer) | ||
| 147 | 150 | ||
| 148 | (defvar tcl-tab-always-indent t | 151 | (defcustom tcl-auto-newline nil |
| 152 | "*Non-nil means automatically newline before and after braces you insert." | ||
| 153 | :group 'tcl | ||
| 154 | :type 'boolean) | ||
| 155 | |||
| 156 | (defcustom tcl-tab-always-indent t | ||
| 149 | "*Control effect of TAB key. | 157 | "*Control effect of TAB key. |
| 150 | If t (the default), always indent current line. | 158 | If t (the default), always indent current line. |
| 151 | If nil and point is not in the indentation area at the beginning of | 159 | If nil and point is not in the indentation area at the beginning of |
| @@ -158,47 +166,68 @@ to take place: | |||
| 158 | 3. Move forward to start of comment, indenting if necessary. | 166 | 3. Move forward to start of comment, indenting if necessary. |
| 159 | 4. Move forward to end of line, indenting if necessary. | 167 | 4. Move forward to end of line, indenting if necessary. |
| 160 | 5. Create an empty comment. | 168 | 5. Create an empty comment. |
| 161 | 6. Move backward to start of comment, indenting if necessary.") | 169 | 6. Move backward to start of comment, indenting if necessary." |
| 170 | :group 'tcl | ||
| 171 | :type '(choice (const :tag "Always" t) | ||
| 172 | (const :tag "Beginning only" nil) | ||
| 173 | (const :tag "Maybe move or make or delete comment" 'tcl))) | ||
| 162 | 174 | ||
| 163 | (defvar tcl-use-hairy-comment-detector t | ||
| 164 | "*If not nil, use the more complicated, but slower, comment-delete method. | ||
| 165 | This variable is only used in Emacs 19; | ||
| 166 | the fast function is always used in other versions.") | ||
| 167 | 175 | ||
| 168 | (defvar tcl-electric-hash-style 'smart | 176 | (defcustom tcl-use-hairy-comment-detector t |
| 177 | "*If not nil, use the more sophisticated, but slower, comment-delete method. | ||
| 178 | This variable is not effective in Emacs 18; | ||
| 179 | the fast function is always used in that version." | ||
| 180 | :group 'tcl | ||
| 181 | :type 'boolean) | ||
| 182 | |||
| 183 | (defcustom tcl-electric-hash-style 'smart | ||
| 169 | "*Style of electric hash insertion to use. | 184 | "*Style of electric hash insertion to use. |
| 170 | Possible values are `backslash', meaning that `\\' quoting should be | 185 | Possible values are `backslash', meaning that `\\' quoting should be |
| 171 | done; `quote', meaning that `\"' quoting should be done; `smart', | 186 | done; `quote', meaning that `\"' quoting should be done; `smart', |
| 172 | meaning that the choice between `backslash' and `quote' should be | 187 | meaning that the choice between `backslash' and `quote' should be |
| 173 | made depending on the number of hashes inserted; or nil, meaning that | 188 | made depending on the number of hashes inserted; or nil, meaning that |
| 174 | no quoting should be done. Any other value for this variable is | 189 | no quoting should be done. Any other value for this variable is |
| 175 | taken to mean `smart'. The default is `smart'.") | 190 | taken to mean `smart'. The default is `smart'." |
| 176 | 191 | :group 'tcl | |
| 177 | (defvar tcl-help-directory-list nil | 192 | :type '(choice (const backslash) (const quote) (const smart) (const nil))) |
| 178 | "*List of topmost directories containing TclX help files") | 193 | |
| 179 | 194 | (defcustom tcl-help-directory-list nil | |
| 180 | (defvar tcl-use-smart-word-finder t | 195 | "*List of topmost directories containing TclX help files." |
| 181 | "*If not nil, use smart way to find current word, for Tcl help feature.") | 196 | :group 'tcl |
| 182 | 197 | :type '(list directory)) | |
| 183 | (defvar tcl-application "wish" | 198 | |
| 184 | "*Name of Tcl application to run in inferior Tcl mode.") | 199 | (defcustom tcl-use-smart-word-finder t |
| 185 | 200 | "*If not nil, use smart way to find current word, for Tcl help feature." | |
| 186 | (defvar tcl-command-switches nil | 201 | :group 'tcl |
| 187 | "*Switches to supply to `tcl-application'.") | 202 | :type 'boolean) |
| 188 | 203 | ||
| 189 | (defvar tcl-prompt-regexp "^\\(% \\|\\)" | 204 | (defcustom tcl-application "wish" |
| 205 | "*Name of Tcl program to run in inferior Tcl mode." | ||
| 206 | :group 'tcl | ||
| 207 | :type 'string) | ||
| 208 | |||
| 209 | (defcustom tcl-command-switches nil | ||
| 210 | "*List of switches to supply to the `tcl-application' program." | ||
| 211 | :group 'tcl | ||
| 212 | :type '(list string)) | ||
| 213 | |||
| 214 | (defcustom tcl-prompt-regexp "^\\(% \\|\\)" | ||
| 190 | "*If not nil, a regexp that will match the prompt in the inferior process. | 215 | "*If not nil, a regexp that will match the prompt in the inferior process. |
| 191 | If nil, the prompt is the name of the application with \">\" appended. | 216 | If nil, the prompt is the name of the application with \">\" appended. |
| 192 | 217 | ||
| 193 | The default is \"^\\(% \\|\\)\", which will match the default primary | 218 | The default is \"^\\(% \\|\\)\", which will match the default primary |
| 194 | and secondary prompts for tclsh and wish.") | 219 | and secondary prompts for tclsh and wish." |
| 220 | :group 'tcl | ||
| 221 | :type 'regexp) | ||
| 195 | 222 | ||
| 196 | (defvar inferior-tcl-source-command "source %s\n" | 223 | (defcustom inferior-tcl-source-command "source %s\n" |
| 197 | "*Format-string for building a Tcl command to load a file. | 224 | "*Format-string for building a Tcl command to load a file. |
| 198 | This format string should use `%s' to substitute a file name | 225 | This format string should use `%s' to substitute a file name |
| 199 | and should result in a Tcl expression that will command the | 226 | and should result in a Tcl expression that will command the |
| 200 | inferior Tcl to load that file. The filename will be appropriately | 227 | inferior Tcl to load that file. The filename will be appropriately |
| 201 | quoted for Tcl.") | 228 | quoted for Tcl." |
| 229 | :group 'tcl | ||
| 230 | :type 'string) | ||
| 202 | 231 | ||
| 203 | ;; | 232 | ;; |
| 204 | ;; Keymaps, abbrevs, syntax tables. | 233 | ;; Keymaps, abbrevs, syntax tables. |
| @@ -524,6 +553,7 @@ is a Tcl expression, and the last argument is Tcl commands.") | |||
| 524 | ;; problem seems to be that there is a bug in Emacs 19.22 where | 553 | ;; problem seems to be that there is a bug in Emacs 19.22 where |
| 525 | ;; end-of-defun doesn't really use the brace matching the one that | 554 | ;; end-of-defun doesn't really use the brace matching the one that |
| 526 | ;; trails defun-prompt-regexp. | 555 | ;; trails defun-prompt-regexp. |
| 556 | ;; ?? Is there a bug now ?? | ||
| 527 | (defconst tcl-omit-ws-regexp "^[^ \t\n#}][^\n}]+}*[ \t]+") | 557 | (defconst tcl-omit-ws-regexp "^[^ \t\n#}][^\n}]+}*[ \t]+") |
| 528 | 558 | ||
| 529 | (defun tcl-internal-beginning-of-defun (&optional arg) | 559 | (defun tcl-internal-beginning-of-defun (&optional arg) |