1 |
;;; tcl.el --- Tcl code editing commands for Emacs |
;;; tcl.el --- Tcl code editing commands for Emacs |
2 |
|
|
3 |
;; Copyright (C) 1994, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. |
;; Copyright (C) 1994,98,1999,2000,01,02,2003 Free Software Foundation, Inc. |
4 |
|
|
5 |
;; Maintainer: FSF |
;; Maintainer: FSF |
6 |
;; Author: Tom Tromey <tromey@redhat.com> |
;; Author: Tom Tromey <tromey@redhat.com> |
122 |
|
|
123 |
(defcustom tcl-indent-level 4 |
(defcustom tcl-indent-level 4 |
124 |
"*Indentation of Tcl statements with respect to containing block." |
"*Indentation of Tcl statements with respect to containing block." |
|
:group 'tcl |
|
125 |
:type 'integer) |
:type 'integer) |
126 |
|
|
127 |
(defcustom tcl-continued-indent-level 4 |
(defcustom tcl-continued-indent-level 4 |
128 |
"*Indentation of continuation line relative to first line of command." |
"*Indentation of continuation line relative to first line of command." |
|
:group 'tcl |
|
129 |
:type 'integer) |
:type 'integer) |
130 |
|
|
131 |
(defcustom tcl-auto-newline nil |
(defcustom tcl-auto-newline nil |
132 |
"*Non-nil means automatically newline before and after braces you insert." |
"*Non-nil means automatically newline before and after braces you insert." |
|
:group 'tcl |
|
133 |
:type 'boolean) |
:type 'boolean) |
134 |
|
|
135 |
(defcustom tcl-tab-always-indent t |
(defcustom tcl-tab-always-indent tab-always-indent |
136 |
"*Control effect of TAB key. |
"*Control effect of TAB key. |
137 |
If t (the default), always indent current line. |
If t (the default), always indent current line. |
138 |
If nil and point is not in the indentation area at the beginning of |
If nil and point is not in the indentation area at the beginning of |
146 |
4. Move forward to end of line, indenting if necessary. |
4. Move forward to end of line, indenting if necessary. |
147 |
5. Create an empty comment. |
5. Create an empty comment. |
148 |
6. Move backward to start of comment, indenting if necessary." |
6. Move backward to start of comment, indenting if necessary." |
|
:group 'tcl |
|
149 |
:type '(choice (const :tag "Always" t) |
:type '(choice (const :tag "Always" t) |
150 |
(const :tag "Beginning only" nil) |
(const :tag "Beginning only" nil) |
151 |
(const :tag "Maybe move or make or delete comment" 'tcl))) |
(const :tag "Maybe move or make or delete comment" 'tcl))) |
159 |
made depending on the number of hashes inserted; or nil, meaning that |
made depending on the number of hashes inserted; or nil, meaning that |
160 |
no quoting should be done. Any other value for this variable is |
no quoting should be done. Any other value for this variable is |
161 |
taken to mean `smart'. The default is nil." |
taken to mean `smart'. The default is nil." |
|
:group 'tcl |
|
162 |
:type '(choice (const backslash) (const quote) (const smart) (const nil))) |
:type '(choice (const backslash) (const quote) (const smart) (const nil))) |
163 |
|
|
164 |
(defcustom tcl-help-directory-list nil |
(defcustom tcl-help-directory-list nil |
165 |
"*List of topmost directories containing TclX help files." |
"*List of topmost directories containing TclX help files." |
|
:group 'tcl |
|
166 |
:type '(repeat directory)) |
:type '(repeat directory)) |
167 |
|
|
168 |
(defcustom tcl-use-smart-word-finder t |
(defcustom tcl-use-smart-word-finder t |
169 |
"*If not nil, use smart way to find current word, for Tcl help feature." |
"*If not nil, use smart way to find current word, for Tcl help feature." |
|
:group 'tcl |
|
170 |
:type 'boolean) |
:type 'boolean) |
171 |
|
|
172 |
(defcustom tcl-application "wish" |
(defcustom tcl-application "wish" |
173 |
"*Name of Tcl program to run in inferior Tcl mode." |
"*Name of Tcl program to run in inferior Tcl mode." |
|
:group 'tcl |
|
174 |
:type 'string) |
:type 'string) |
175 |
|
|
176 |
(defcustom tcl-command-switches nil |
(defcustom tcl-command-switches nil |
177 |
"*List of switches to supply to the `tcl-application' program." |
"*List of switches to supply to the `tcl-application' program." |
|
:group 'tcl |
|
178 |
:type '(repeat string)) |
:type '(repeat string)) |
179 |
|
|
180 |
(defcustom tcl-prompt-regexp "^\\(% \\|\\)" |
(defcustom tcl-prompt-regexp "^\\(% \\|\\)" |
183 |
|
|
184 |
The default is \"^\\(% \\|\\)\", which will match the default primary |
The default is \"^\\(% \\|\\)\", which will match the default primary |
185 |
and secondary prompts for tclsh and wish." |
and secondary prompts for tclsh and wish." |
|
:group 'tcl |
|
186 |
:type 'regexp) |
:type 'regexp) |
187 |
|
|
188 |
(defcustom inferior-tcl-source-command "source %s\n" |
(defcustom inferior-tcl-source-command "source %s\n" |
191 |
and should result in a Tcl expression that will command the |
and should result in a Tcl expression that will command the |
192 |
inferior Tcl to load that file. The filename will be appropriately |
inferior Tcl to load that file. The filename will be appropriately |
193 |
quoted for Tcl." |
quoted for Tcl." |
|
:group 'tcl |
|
194 |
:type 'string) |
:type 'string) |
195 |
|
|
196 |
;; |
;; |
426 |
is a Tcl expression, and the last argument is Tcl commands.") |
is a Tcl expression, and the last argument is Tcl commands.") |
427 |
|
|
428 |
(defvar tcl-explain-indentation nil |
(defvar tcl-explain-indentation nil |
429 |
"If not `nil', debugging message will be printed during indentation.") |
"If non-nil, debugging message will be printed during indentation.") |
430 |
|
|
431 |
|
|
432 |
|
|
549 |
(parse-sexp-lookup-properties . t))) |
(parse-sexp-lookup-properties . t))) |
550 |
|
|
551 |
(set (make-local-variable 'imenu-generic-expression) |
(set (make-local-variable 'imenu-generic-expression) |
552 |
'tcl-imenu-generic-expression) |
tcl-imenu-generic-expression) |
553 |
|
|
554 |
;; Settings for new dabbrev code. |
;; Settings for new dabbrev code. |
555 |
(set (make-local-variable 'dabbrev-case-fold-search) nil) |
(set (make-local-variable 'dabbrev-case-fold-search) nil) |
867 |
(contain-stack (list (point))) |
(contain-stack (list (point))) |
868 |
(case-fold-search nil) |
(case-fold-search nil) |
869 |
outer-loop-done inner-loop-done state ostate |
outer-loop-done inner-loop-done state ostate |
870 |
this-indent last-sexp continued-line |
this-indent continued-line |
871 |
(next-depth 0) |
(next-depth 0) |
872 |
last-depth) |
last-depth) |
873 |
(save-excursion |
(save-excursion |
887 |
(setq state (parse-partial-sexp (point) (progn (end-of-line) (point)) |
(setq state (parse-partial-sexp (point) (progn (end-of-line) (point)) |
888 |
nil nil state)) |
nil nil state)) |
889 |
(setq next-depth (car state)) |
(setq next-depth (car state)) |
|
(if (and (car (cdr (cdr state))) |
|
|
(>= (car (cdr (cdr state))) 0)) |
|
|
(setq last-sexp (car (cdr (cdr state))))) |
|
890 |
(if (or (nth 4 ostate)) |
(if (or (nth 4 ostate)) |
891 |
(tcl-indent-line)) |
(tcl-indent-line)) |
892 |
(if (or (nth 3 state)) |
(if (or (nth 3 state)) |
903 |
(setq indent-stack (cdr indent-stack) |
(setq indent-stack (cdr indent-stack) |
904 |
contain-stack (cdr contain-stack) |
contain-stack (cdr contain-stack) |
905 |
last-depth (1- last-depth))) |
last-depth (1- last-depth))) |
|
(if (/= last-depth next-depth) |
|
|
(setq last-sexp nil)) |
|
906 |
;; Add levels for any parens that were started in this line. |
;; Add levels for any parens that were started in this line. |
907 |
(while (< last-depth next-depth) |
(while (< last-depth next-depth) |
908 |
(setq indent-stack (cons nil indent-stack) |
(setq indent-stack (cons nil indent-stack) |
1510 |
|
|
1511 |
(provide 'tcl) |
(provide 'tcl) |
1512 |
|
|
1513 |
|
;;; arch-tag: 8a032554-c3ef-422e-b84c-acec0522179d |
1514 |
;;; tcl.el ends here |
;;; tcl.el ends here |