Mercurial > emacs
comparison lisp/progmodes/tcl.el @ 12645:3ce3ca90e4a3
(tcl-word-no-props): New function.
(tcl-figure-type): Use it.
(tcl-current-word): Ditto.
author | Tom Tromey <tromey@redhat.com> |
---|---|
date | Sun, 23 Jul 1995 23:51:25 +0000 |
parents | 35800a352783 |
children | 841ba4b250a4 |
comparison
equal
deleted
inserted
replaced
12644:35800a352783 | 12645:3ce3ca90e4a3 |
---|---|
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.43 $ | 9 ;; Version: $Revision: 1.44 $ |
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/17 19:59:49 $|$Revision: 1.43 $|~/modes/tcl.el.Z| | 54 ;; $Date: 1995/07/23 20:26:47 $|$Revision: 1.44 $|~/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.44 1995/07/23 20:26:47 tromey | |
69 ;; Doc fixes. | |
70 ;; | |
68 ;; Revision 1.43 1995/07/17 19:59:49 tromey | 71 ;; Revision 1.43 1995/07/17 19:59:49 tromey |
69 ;; (inferior-tcl-mode): Use modeline-process if it exists. | 72 ;; (inferior-tcl-mode): Use modeline-process if it exists. |
70 ;; | 73 ;; |
71 ;; Revision 1.42 1995/07/17 19:55:25 tromey | 74 ;; Revision 1.42 1995/07/17 19:55:25 tromey |
72 ;; XEmacs currently must use tcl-internal-end-of-defun | 75 ;; XEmacs currently must use tcl-internal-end-of-defun |
340 (if (and (string-match "19\\." emacs-version) | 343 (if (and (string-match "19\\." emacs-version) |
341 (not (string-match "XEmacs" emacs-version))) | 344 (not (string-match "XEmacs" emacs-version))) |
342 (require 'imenu)) | 345 (require 'imenu)) |
343 ())) | 346 ())) |
344 | 347 |
345 (defconst tcl-version "$Revision: 1.43 $") | 348 (defconst tcl-version "$Revision: 1.44 $") |
346 (defconst tcl-maintainer "Tom Tromey <tromey@drip.colorado.edu>") | 349 (defconst tcl-maintainer "Tom Tromey <tromey@drip.colorado.edu>") |
347 | 350 |
348 ;; | 351 ;; |
349 ;; User variables. | 352 ;; User variables. |
350 ;; | 353 ;; |
1166 ;; over entire variables, etc. | 1169 ;; over entire variables, etc. |
1167 (backward-sexp) | 1170 (backward-sexp) |
1168 (if (looking-at "[a-zA-Z_]+") | 1171 (if (looking-at "[a-zA-Z_]+") |
1169 (let ((list tcl-type-alist) | 1172 (let ((list tcl-type-alist) |
1170 entry) | 1173 entry) |
1171 (setq word-stack (cons (current-word) word-stack)) | 1174 (setq word-stack (cons (tcl-word-no-props) word-stack)) |
1172 (while (and list (not result)) | 1175 (while (and list (not result)) |
1173 (setq entry (car list)) | 1176 (setq entry (car list)) |
1174 (setq list (cdr list)) | 1177 (setq list (cdr list)) |
1175 (let ((index 0)) | 1178 (let ((index 0)) |
1176 (while (and entry (<= index count)) | 1179 (while (and entry (<= index count)) |
1799 (setq tcl-help-saved-dirs tcl-help-directory-list) | 1802 (setq tcl-help-saved-dirs tcl-help-directory-list) |
1800 (setq tcl-help-alist nil) | 1803 (setq tcl-help-alist nil) |
1801 (tcl-help-snarf-commands tcl-help-directory-list) | 1804 (tcl-help-snarf-commands tcl-help-directory-list) |
1802 (message "Building Tcl help file index...done")) | 1805 (message "Building Tcl help file index...done")) |
1803 | 1806 |
1807 (defun tcl-word-no-props () | |
1808 "Like current-word, but strips properties." | |
1809 (let ((word (current-word))) | |
1810 (and (fboundp 'set-text-properties) | |
1811 (set-text-properties 0 (length word) nil word)) | |
1812 word)) | |
1813 | |
1804 (defun tcl-current-word (flag) | 1814 (defun tcl-current-word (flag) |
1805 "Return current command word, or nil. | 1815 "Return current command word, or nil. |
1806 If FLAG is nil, just uses `current-word'. | 1816 If FLAG is nil, just uses `current-word'. |
1807 Otherwise scans backward for most likely Tcl command word." | 1817 Otherwise scans backward for most likely Tcl command word." |
1808 (if (and flag | 1818 (if (and flag |
1813 (if (bobp) | 1823 (if (bobp) |
1814 () | 1824 () |
1815 (while (and (not (bobp)) | 1825 (while (and (not (bobp)) |
1816 (not (tcl-real-command-p))) | 1826 (not (tcl-real-command-p))) |
1817 (backward-sexp))) | 1827 (backward-sexp))) |
1818 (if (assoc (current-word) tcl-help-alist) | 1828 (if (assoc (tcl-word-no-props) tcl-help-alist) |
1819 (current-word))) | 1829 (tcl-word-no-props))) |
1820 (error nil)) | 1830 (error nil)) |
1821 (current-word))) | 1831 (tcl-word-no-props))) |
1822 | 1832 |
1823 ;;;###autoload | 1833 ;;;###autoload |
1824 (defun tcl-help-on-word (command &optional arg) | 1834 (defun tcl-help-on-word (command &optional arg) |
1825 "Get help on Tcl command. Default is word at point. | 1835 "Get help on Tcl command. Default is word at point. |
1826 Prefix argument means invert sense of `tcl-use-smart-word-finder'." | 1836 Prefix argument means invert sense of `tcl-use-smart-word-finder'." |