Mercurial > emacs
comparison lisp/progmodes/tcl.el @ 12795:841ba4b250a4
(tcl-do-auto-fill): Only fill past fill-column; for 19.29.
(tcl-auto-fill-mode): Use force-mode-line-update.
author | Tom Tromey <tromey@redhat.com> |
---|---|
date | Mon, 07 Aug 1995 16:02:01 +0000 |
parents | 3ce3ca90e4a3 |
children | 8172973fd6e4 |
comparison
equal
deleted
inserted
replaced
12794:913a19cf074a | 12795:841ba4b250a4 |
---|---|
4 | 4 |
5 ;; Maintainer: Tom Tromey <tromey@busco.lanl.gov> | 5 ;; Maintainer: Tom Tromey <tromey@busco.lanl.gov> |
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.44 $ | 9 ;; Version: $Revision: 1.45 $ |
10 | 10 |
11 ;; This file is part of GNU Emacs. | 11 ;; This file is part of GNU Emacs. |
12 | 12 |
13 ;; GNU Emacs is free software; you can redistribute it and/or modify | 13 ;; GNU Emacs is free software; you can redistribute it and/or modify |
14 ;; it under the terms of the GNU General Public License as published by | 14 ;; it under the terms of the GNU General Public License as published by |
49 ;;; Commentary: | 49 ;;; Commentary: |
50 | 50 |
51 ;; LCD Archive Entry: | 51 ;; LCD Archive Entry: |
52 ;; tcl|Tom Tromey|tromey@busco.lanl.gov| | 52 ;; tcl|Tom Tromey|tromey@busco.lanl.gov| |
53 ;; Major mode for editing Tcl| | 53 ;; Major mode for editing Tcl| |
54 ;; $Date: 1995/07/23 20:26:47 $|$Revision: 1.44 $|~/modes/tcl.el.Z| | 54 ;; $Date: 1995/07/23 23:51:25 $|$Revision: 1.45 $|~/modes/tcl.el.Z| |
55 | 55 |
56 ;; CUSTOMIZATION NOTES: | 56 ;; CUSTOMIZATION NOTES: |
57 ;; * tcl-proc-list can be used to customize a list of things that | 57 ;; * tcl-proc-list can be used to customize a list of things that |
58 ;; "define" other things. Eg in my project I put "defvar" in this | 58 ;; "define" other things. Eg in my project I put "defvar" in this |
59 ;; list. | 59 ;; list. |
63 ;; * tcl-type-alist can be used to minimally customize indentation | 63 ;; * tcl-type-alist can be used to minimally customize indentation |
64 ;; according to context. | 64 ;; according to context. |
65 | 65 |
66 ;; Change log: | 66 ;; Change log: |
67 ;; $Log: tcl.el,v $ | 67 ;; $Log: tcl.el,v $ |
68 ;; Revision 1.45 1995/07/23 23:51:25 tromey | |
69 ;; (tcl-word-no-props): New function. | |
70 ;; (tcl-figure-type): Use it. | |
71 ;; (tcl-current-word): Ditto. | |
72 ;; | |
68 ;; Revision 1.44 1995/07/23 20:26:47 tromey | 73 ;; Revision 1.44 1995/07/23 20:26:47 tromey |
69 ;; Doc fixes. | 74 ;; Doc fixes. |
70 ;; | 75 ;; |
71 ;; Revision 1.43 1995/07/17 19:59:49 tromey | 76 ;; Revision 1.43 1995/07/17 19:59:49 tromey |
72 ;; (inferior-tcl-mode): Use modeline-process if it exists. | 77 ;; (inferior-tcl-mode): Use modeline-process if it exists. |
343 (if (and (string-match "19\\." emacs-version) | 348 (if (and (string-match "19\\." emacs-version) |
344 (not (string-match "XEmacs" emacs-version))) | 349 (not (string-match "XEmacs" emacs-version))) |
345 (require 'imenu)) | 350 (require 'imenu)) |
346 ())) | 351 ())) |
347 | 352 |
348 (defconst tcl-version "$Revision: 1.44 $") | 353 (defconst tcl-version "$Revision: 1.45 $") |
349 (defconst tcl-maintainer "Tom Tromey <tromey@drip.colorado.edu>") | 354 (defconst tcl-maintainer "Tom Tromey <tromey@drip.colorado.edu>") |
350 | 355 |
351 ;; | 356 ;; |
352 ;; User variables. | 357 ;; User variables. |
353 ;; | 358 ;; |
1741 (fill-paragraph ignore))))) | 1746 (fill-paragraph ignore))))) |
1742 t) | 1747 t) |
1743 | 1748 |
1744 (defun tcl-do-auto-fill () | 1749 (defun tcl-do-auto-fill () |
1745 "Auto-fill function for Tcl mode. Only auto-fills in a comment." | 1750 "Auto-fill function for Tcl mode. Only auto-fills in a comment." |
1746 (let ((fill-prefix "# ") | 1751 (if (> (current-column) fill-column) |
1747 in-comment col) | 1752 (let ((fill-prefix "# ") |
1748 (save-excursion | 1753 in-comment col) |
1749 (setq in-comment (tcl-in-comment)) | 1754 (save-excursion |
1750 (if in-comment | 1755 (setq in-comment (tcl-in-comment)) |
1751 (setq col (1- (current-column))))) | 1756 (if in-comment |
1752 (if in-comment | 1757 (setq col (1- (current-column))))) |
1753 (progn | 1758 (if in-comment |
1754 (do-auto-fill) | 1759 (progn |
1755 (save-excursion | 1760 (do-auto-fill) |
1756 (back-to-indentation) | 1761 (save-excursion |
1757 (delete-region (point) (save-excursion | 1762 (back-to-indentation) |
1758 (beginning-of-line) | 1763 (delete-region (point) (save-excursion |
1759 (point))) | 1764 (beginning-of-line) |
1760 (indent-to-column col)))))) | 1765 (point))) |
1766 (indent-to-column col))))))) | |
1761 | 1767 |
1762 | 1768 |
1763 | 1769 |
1764 ;; | 1770 ;; |
1765 ;; Help-related code. | 1771 ;; Help-related code. |
1954 (if (if (null arg) | 1960 (if (if (null arg) |
1955 (not auto-fill-function) | 1961 (not auto-fill-function) |
1956 (> (prefix-numeric-value arg) 0)) | 1962 (> (prefix-numeric-value arg) 0)) |
1957 'tcl-do-auto-fill | 1963 'tcl-do-auto-fill |
1958 nil)) | 1964 nil)) |
1959 ;; Update mode line. FIXME I'd use force-mode-line-update, but I | 1965 (force-mode-line-update))) |
1960 ;; don't know if it exists in v18. | |
1961 (set-buffer-modified-p (buffer-modified-p)))) | |
1962 | 1966 |
1963 (defun tcl-electric-hash (&optional count) | 1967 (defun tcl-electric-hash (&optional count) |
1964 "Insert a `#' and quote if it does not start a real comment. | 1968 "Insert a `#' and quote if it does not start a real comment. |
1965 Prefix arg is number of `#'s to insert. | 1969 Prefix arg is number of `#'s to insert. |
1966 See variable `tcl-electric-hash-style' for description of quoting | 1970 See variable `tcl-electric-hash-style' for description of quoting |