diff options
| author | Stefan Monnier | 2002-11-07 15:22:49 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2002-11-07 15:22:49 +0000 |
| commit | cd21c04ac9ab2b67f1d67b700453e19370da42fa (patch) | |
| tree | 489790eb85c21b62e1af46858a70d59275af522f | |
| parent | 686eb0dd77f00490b78e09bcabd566af520eb8f7 (diff) | |
| download | emacs-cd21c04ac9ab2b67f1d67b700453e19370da42fa.tar.gz emacs-cd21c04ac9ab2b67f1d67b700453e19370da42fa.zip | |
(tcl-mode): Don't set paragraph-start,
paragraph-separate, comment-column, and fill-paragraph-function.
Simplify outline-regexp.
(tcl-do-fill-paragraph): Remove.
| -rw-r--r-- | lisp/progmodes/tcl.el | 53 |
1 files changed, 3 insertions, 50 deletions
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index d1be68e9d56..38867b96ec8 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.68 $ | 9 | ;; Version: $Revision: 1.69 $ |
| 10 | 10 | ||
| 11 | ;; This file is part of GNU Emacs. | 11 | ;; This file is part of GNU Emacs. |
| 12 | 12 | ||
| @@ -550,13 +550,8 @@ already exist. | |||
| 550 | 550 | ||
| 551 | Commands: | 551 | Commands: |
| 552 | \\{tcl-mode-map}" | 552 | \\{tcl-mode-map}" |
| 553 | (set (make-local-variable 'paragraph-start) "$\\|") | ||
| 554 | (set (make-local-variable 'paragraph-separate) paragraph-start) | ||
| 555 | |||
| 556 | (unless (and (boundp 'filladapt-mode) filladapt-mode) | 553 | (unless (and (boundp 'filladapt-mode) filladapt-mode) |
| 557 | (set (make-local-variable 'paragraph-ignore-fill-prefix) t) | 554 | (set (make-local-variable 'paragraph-ignore-fill-prefix) t)) |
| 558 | (set (make-local-variable 'fill-paragraph-function) | ||
| 559 | 'tcl-do-fill-paragraph)) | ||
| 560 | 555 | ||
| 561 | (set (make-local-variable 'indent-line-function) 'tcl-indent-line) | 556 | (set (make-local-variable 'indent-line-function) 'tcl-indent-line) |
| 562 | (set (make-local-variable 'comment-indent-function) 'tcl-comment-indent) | 557 | (set (make-local-variable 'comment-indent-function) 'tcl-comment-indent) |
| @@ -566,10 +561,9 @@ Commands: | |||
| 566 | 561 | ||
| 567 | (set (make-local-variable 'comment-start) "# ") | 562 | (set (make-local-variable 'comment-start) "# ") |
| 568 | (set (make-local-variable 'comment-start-skip) "#+ *") | 563 | (set (make-local-variable 'comment-start-skip) "#+ *") |
| 569 | (set (make-local-variable 'comment-column) 40) ;why? -stef | ||
| 570 | (set (make-local-variable 'comment-end) "") | 564 | (set (make-local-variable 'comment-end) "") |
| 571 | 565 | ||
| 572 | (set (make-local-variable 'outline-regexp) "[^\n\^M]") | 566 | (set (make-local-variable 'outline-regexp) ".") |
| 573 | (set (make-local-variable 'outline-level) 'tcl-outline-level) | 567 | (set (make-local-variable 'outline-level) 'tcl-outline-level) |
| 574 | 568 | ||
| 575 | (set (make-local-variable 'font-lock-defaults) | 569 | (set (make-local-variable 'font-lock-defaults) |
| @@ -1234,47 +1228,6 @@ simpler version that is often right, and works in Emacs 18." | |||
| 1234 | (beginning-of-defun) | 1228 | (beginning-of-defun) |
| 1235 | (car (tcl-hairy-scan-for-comment nil save nil)))) | 1229 | (car (tcl-hairy-scan-for-comment nil save nil)))) |
| 1236 | 1230 | ||
| 1237 | (defun tcl-do-fill-paragraph (ignore) | ||
| 1238 | "fill-paragraph function for Tcl mode. Only fills in a comment." | ||
| 1239 | (let (in-comment col where) | ||
| 1240 | (save-excursion | ||
| 1241 | (end-of-line) | ||
| 1242 | (setq in-comment (tcl-in-comment)) | ||
| 1243 | (if in-comment | ||
| 1244 | (progn | ||
| 1245 | (setq where (1+ (point))) | ||
| 1246 | (setq col (1- (current-column)))))) | ||
| 1247 | (and in-comment | ||
| 1248 | (save-excursion | ||
| 1249 | (back-to-indentation) | ||
| 1250 | (= col (current-column))) | ||
| 1251 | ;; In a comment. Set the fill prefix, and find the paragraph | ||
| 1252 | ;; boundaries by searching for lines that look like | ||
| 1253 | ;; comment-only lines. | ||
| 1254 | (let ((fill-prefix (buffer-substring (progn | ||
| 1255 | (beginning-of-line) | ||
| 1256 | (point)) | ||
| 1257 | where)) | ||
| 1258 | p-start p-end) | ||
| 1259 | ;; Search backwards. | ||
| 1260 | (save-excursion | ||
| 1261 | (while (and (looking-at "^[ \t]*#[ \t]*[^ \t\n]") | ||
| 1262 | (not (bobp))) | ||
| 1263 | (forward-line -1)) | ||
| 1264 | (setq p-start (point))) | ||
| 1265 | |||
| 1266 | ;; Search forwards. | ||
| 1267 | (save-excursion | ||
| 1268 | (while (looking-at "^[ \t]*#[ \t]*[^ \t\n]") | ||
| 1269 | (forward-line)) | ||
| 1270 | (setq p-end (point))) | ||
| 1271 | |||
| 1272 | ;; Narrow and do the fill. | ||
| 1273 | (save-restriction | ||
| 1274 | (narrow-to-region p-start p-end) | ||
| 1275 | (fill-paragraph ignore))))) | ||
| 1276 | t) | ||
| 1277 | |||
| 1278 | 1231 | ||
| 1279 | 1232 | ||
| 1280 | ;; | 1233 | ;; |