aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2002-04-01 21:01:04 +0000
committerStefan Monnier2002-04-01 21:01:04 +0000
commit2c7cdd69e6abe549509f8cd6c8031fc038d24716 (patch)
treee4c0bcf514a87267a4e6f50eab62d183f33c7ae6
parent28857aefb4ed2f6628c6fef835ebcf7977535663 (diff)
downloademacs-2c7cdd69e6abe549509f8cd6c8031fc038d24716.tar.gz
emacs-2c7cdd69e6abe549509f8cd6c8031fc038d24716.zip
Change maintainer.
(tcl-electric-hash-style): Change default to nil. (tcl-imenu-generic-expression): Use tcl-proc-regexp. (tcl-do-auto-fill): Remove. (tcl-auto-fill-mode): Rewrite using comment-auto-fill-only-comments.
-rw-r--r--lisp/progmodes/tcl.el59
1 files changed, 18 insertions, 41 deletions
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el
index aabe3687f73..d1be68e9d56 100644
--- a/lisp/progmodes/tcl.el
+++ b/lisp/progmodes/tcl.el
@@ -2,11 +2,11 @@
2 2
3;; Copyright (C) 1994, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. 3;; Copyright (C) 1994, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
4 4
5;; Maintainer: Tom Tromey <tromey@redhat.com> 5;; Maintainer: FSF
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.67 $ 9;; Version: $Revision: 1.68 $
10 10
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12 12
@@ -60,15 +60,16 @@
60;; Jesper Pedersen <blackie@imada.ou.dk> 60;; Jesper Pedersen <blackie@imada.ou.dk>
61;; dfarmer@evolving.com (Doug Farmer) 61;; dfarmer@evolving.com (Doug Farmer)
62;; "Chris Alfeld" <calfeld@math.utah.edu> 62;; "Chris Alfeld" <calfeld@math.utah.edu>
63;; Ben Wing <wing@666.com> 63;; Ben Wing <ben@xemacs.org>
64 64
65;; KNOWN BUGS: 65;; KNOWN BUGS:
66;; * In Tcl "#" is not always a comment character. This can confuse 66;; * In Tcl "#" is not always a comment character. This can confuse tcl.el
67;; tcl.el in certain circumstances. For now the only workaround is 67;; in certain circumstances. For now the only workaround is to use
68;; to enclose offending hash characters in quotes or precede it with 68;; font-lock which will mark the # chars accordingly or enclose offending
69;; a backslash. Note that using braces won't work -- quotes change 69;; hash characters in quotes or precede them with a backslash. Note that
70;; the syntax class of characters between them, while braces do not. 70;; using braces won't work -- quotes change the syntax class of characters
71;; The electric-# mode helps alleviate this problem somewhat. 71;; between them, while braces do not. If you don't use font-lock, the
72;; electric-# mode helps alleviate this problem somewhat.
72;; * indent-tcl-exp is untested. 73;; * indent-tcl-exp is untested.
73 74
74;; TODO: 75;; TODO:
@@ -154,14 +155,14 @@ to take place:
154 (const :tag "Maybe move or make or delete comment" 'tcl))) 155 (const :tag "Maybe move or make or delete comment" 'tcl)))
155 156
156 157
157(defcustom tcl-electric-hash-style 'smart 158(defcustom tcl-electric-hash-style nil ;; 'smart
158 "*Style of electric hash insertion to use. 159 "*Style of electric hash insertion to use.
159Possible values are `backslash', meaning that `\\' quoting should be 160Possible values are `backslash', meaning that `\\' quoting should be
160done; `quote', meaning that `\"' quoting should be done; `smart', 161done; `quote', meaning that `\"' quoting should be done; `smart',
161meaning that the choice between `backslash' and `quote' should be 162meaning that the choice between `backslash' and `quote' should be
162made depending on the number of hashes inserted; or nil, meaning that 163made depending on the number of hashes inserted; or nil, meaning that
163no quoting should be done. Any other value for this variable is 164no quoting should be done. Any other value for this variable is
164taken to mean `smart'. The default is `smart'." 165taken to mean `smart'. The default is nil."
165 :group 'tcl 166 :group 'tcl
166 :type '(choice (const backslash) (const quote) (const smart) (const nil))) 167 :type '(choice (const backslash) (const quote) (const smart) (const nil)))
167 168
@@ -508,7 +509,7 @@ Uses variables `tcl-proc-regexp' and `tcl-keyword-list'."
508 509
509 510
510(defvar tcl-imenu-generic-expression 511(defvar tcl-imenu-generic-expression
511 '((nil "^proc[ \t]+\\([-A-Za-z0-9_:+*]+\\)" 1)) 512 `((nil ,(concat tcl-proc-regexp "\\([-A-Za-z0-9_:+*]+\\)") 2))
512 "Imenu generic expression for `tcl-mode'. See `imenu-generic-expression'.") 513 "Imenu generic expression for `tcl-mode'. See `imenu-generic-expression'.")
513 514
514 515
@@ -538,8 +539,6 @@ documentation for details):
538 `tcl-auto-newline' 539 `tcl-auto-newline'
539 Non-nil means automatically newline before and after braces, brackets, 540 Non-nil means automatically newline before and after braces, brackets,
540 and semicolons inserted in Tcl code. 541 and semicolons inserted in Tcl code.
541 `tcl-electric-hash-style'
542 Controls action of `#' key.
543 `tcl-use-smart-word-finder' 542 `tcl-use-smart-word-finder'
544 If not nil, use a smarter, Tcl-specific way to find the current 543 If not nil, use a smarter, Tcl-specific way to find the current
545 word when looking up help on a Tcl command. 544 word when looking up help on a Tcl command.
@@ -1276,23 +1275,6 @@ simpler version that is often right, and works in Emacs 18."
1276 (fill-paragraph ignore))))) 1275 (fill-paragraph ignore)))))
1277 t) 1276 t)
1278 1277
1279(defun tcl-do-auto-fill ()
1280 "Auto-fill function for Tcl mode. Only auto-fills in a comment."
1281 (if (> (current-column) fill-column)
1282 (let ((fill-prefix "# ")
1283 in-comment col)
1284 (save-excursion
1285 (setq in-comment (tcl-in-comment))
1286 (if in-comment
1287 (setq col (1- (current-column)))))
1288 (if in-comment
1289 (progn
1290 (do-auto-fill)
1291 (save-excursion
1292 (back-to-indentation)
1293 (delete-region (point) (line-beginning-position))
1294 (indent-to-column col)))))))
1295
1296 1278
1297 1279
1298;; 1280;;
@@ -1468,17 +1450,12 @@ Prefix argument means switch to the Tcl buffer afterwards."
1468 (if and-go (switch-to-tcl t))))))) 1450 (if and-go (switch-to-tcl t)))))))
1469 1451
1470(defun tcl-auto-fill-mode (&optional arg) 1452(defun tcl-auto-fill-mode (&optional arg)
1471 "Like `auto-fill-mode', but controls filling of Tcl comments." 1453 "Like `auto-fill-mode', but sets `comment-auto-fill-only-comments'."
1472 (interactive "P") 1454 (interactive "P")
1473 ;; Following code taken from "auto-fill-mode" (simple.el). 1455 (auto-fill-mode arg)
1474 (prog1 1456 (if auto-fill-function
1475 (setq auto-fill-function 1457 (set (make-local-variable 'comment-auto-fill-only-comments) t)
1476 (if (if (null arg) 1458 (kill-local-variable 'comment-auto-fill-only-comments)))
1477 (not auto-fill-function)
1478 (> (prefix-numeric-value arg) 0))
1479 'tcl-do-auto-fill
1480 nil))
1481 (force-mode-line-update)))
1482 1459
1483(defun tcl-electric-hash (&optional count) 1460(defun tcl-electric-hash (&optional count)
1484 "Insert a `#' and quote if it does not start a real comment. 1461 "Insert a `#' and quote if it does not start a real comment.