diff options
| author | Stefan Monnier | 2003-02-11 21:04:50 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-02-11 21:04:50 +0000 |
| commit | a2c6faead54f69fd6c3c3ea37c91de9e2b9aa54a (patch) | |
| tree | de5fff97240a9d3dd6413cf3e78e4b2806464b04 | |
| parent | da05debc31ad5f15454238ae806d6cd2c3064a4a (diff) | |
| download | emacs-a2c6faead54f69fd6c3c3ea37c91de9e2b9aa54a.tar.gz emacs-a2c6faead54f69fd6c3c3ea37c91de9e2b9aa54a.zip | |
(tcl-omit-ws-regexp): Correctly handle cases like `proc foo {a {b c} d} {'.
(tcl-mode): Make comment-start-skip more selective.
| -rw-r--r-- | lisp/progmodes/tcl.el | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index dedf0c4b664..ece48fa7be6 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | ;; Author: Tom Tromey <tromey@redhat.com> | 6 | ;; Author: Tom Tromey <tromey@redhat.com> |
| 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.70 $ | 9 | ;; Version: $Revision: 1.71 $ |
| 10 | 10 | ||
| 11 | ;; This file is part of GNU Emacs. | 11 | ;; This file is part of GNU Emacs. |
| 12 | 12 | ||
| @@ -441,28 +441,16 @@ is a Tcl expression, and the last argument is Tcl commands.") | |||
| 441 | 441 | ||
| 442 | 442 | ||
| 443 | 443 | ||
| 444 | ;; Its pretty bogus to have to do this, but there is no easier way to | 444 | ;; Here's another stab. I think this one actually works. |
| 445 | ;; say "match not syntax-1 and not syntax-2". Too bad you can't put | 445 | ;; We have to be careful that the open-brace following this regexp |
| 446 | ;; \s in [...]. This sickness is used in Emacs 19 to match a defun | 446 | ;; is indeed the one corresponding to the function's body so |
| 447 | ;; starter. (It is used for this in v18 as well). | 447 | ;; that end-of-defun works correctly. Tricky cases are: |
| 448 | ;;(defconst tcl-omit-ws-regexp | 448 | ;; proc foo { {arg1 def} arg2 } { |
| 449 | ;; (concat "^\\(\\s" | 449 | ;; as well as |
| 450 | ;; (mapconcat 'char-to-string "w_.()\"\\$'/" "\\|\\s") | 450 | ;; proc foo { \n {arg1 def} \n arg2 } { |
| 451 | ;; "\\)\\S(*") | 451 | ;; The current setting handles the first case properly but not the second. |
| 452 | ;; "Regular expression that matches everything except space, comment | 452 | ;; It also fails if `proc' is not in column-0 (e.g. it's in a namespace). |
| 453 | ;;starter, and comment ender syntax codes.") | 453 | (defconst tcl-omit-ws-regexp "^[^] \t\n#}].+[ \t]+") |
| 454 | |||
| 455 | ;; FIXME? Instead of using the hairy regexp above, we just use a | ||
| 456 | ;; simple one. | ||
| 457 | ;;(defconst tcl-omit-ws-regexp "^[^] \t\n#}]\\S(*" | ||
| 458 | ;; "Regular expression used in locating function definitions.") | ||
| 459 | |||
| 460 | ;; Here's another stab. I think this one actually works. Now the | ||
| 461 | ;; problem seems to be that there is a bug in Emacs 19.22 where | ||
| 462 | ;; end-of-defun doesn't really use the brace matching the one that | ||
| 463 | ;; trails defun-prompt-regexp. | ||
| 464 | ;; ?? Is there a bug now ?? | ||
| 465 | (defconst tcl-omit-ws-regexp "^[^ \t\n#}][^\n}]+}*[ \t]+") | ||
| 466 | 454 | ||
| 467 | 455 | ||
| 468 | 456 | ||
| @@ -543,8 +531,7 @@ documentation for details): | |||
| 543 | If not nil, use a smarter, Tcl-specific way to find the current | 531 | If not nil, use a smarter, Tcl-specific way to find the current |
| 544 | word when looking up help on a Tcl command. | 532 | word when looking up help on a Tcl command. |
| 545 | 533 | ||
| 546 | Turning on Tcl mode calls the value of the variable `tcl-mode-hook' | 534 | Turning on Tcl mode runs `tcl-mode-hook'. Read the documentation for |
| 547 | with no args, if that value is non-nil. Read the documentation for | ||
| 548 | `tcl-mode-hook' to see what kinds of interesting hook functions | 535 | `tcl-mode-hook' to see what kinds of interesting hook functions |
| 549 | already exist. | 536 | already exist. |
| 550 | 537 | ||
| @@ -560,7 +547,8 @@ Commands: | |||
| 560 | ;; (setq require-final-newline t) | 547 | ;; (setq require-final-newline t) |
| 561 | 548 | ||
| 562 | (set (make-local-variable 'comment-start) "# ") | 549 | (set (make-local-variable 'comment-start) "# ") |
| 563 | (set (make-local-variable 'comment-start-skip) "#+ *") | 550 | (set (make-local-variable 'comment-start-skip) |
| 551 | "\\(\\(^\\|[;{[]\\)\\s-*\\)#+ *") | ||
| 564 | (set (make-local-variable 'comment-end) "") | 552 | (set (make-local-variable 'comment-end) "") |
| 565 | 553 | ||
| 566 | (set (make-local-variable 'outline-regexp) ".") | 554 | (set (make-local-variable 'outline-regexp) ".") |