diff options
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/progmodes/tcl.el | 36 |
2 files changed, 23 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e3429a6f643..8e578046ef1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2002-04-01 Ville Skytt,Ad(B <ville.skytta@xemacs.org> | ||
| 2 | |||
| 3 | * tcl.el (tcl-imenu-generic-expression): New value. | ||
| 4 | (tcl-imenu-create-index-function): Function deleted. | ||
| 5 | (tcl-mode): Check for filladapt-mode. | ||
| 6 | Use tcl-imenu-generic-expression instead of | ||
| 7 | tcl-imenu-create-index-function. | ||
| 8 | (inferior-tcl-mode): Doc fix. | ||
| 9 | Change not legally significant. | ||
| 10 | |||
| 1 | 2002-04-01 Pavel Jan,Bm(Bk <Pavel@Janik.cz> | 11 | 2002-04-01 Pavel Jan,Bm(Bk <Pavel@Janik.cz> |
| 2 | 12 | ||
| 3 | * cus-start.el: Rename `x-autoselect-window' to `autoselect-window'. | 13 | * cus-start.el: Rename `x-autoselect-window' to `autoselect-window'. |
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index 2166af583d2..aabe3687f73 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.66 $ | 9 | ;; Version: $Revision: 1.67 $ |
| 10 | 10 | ||
| 11 | ;; This file is part of GNU Emacs. | 11 | ;; This file is part of GNU Emacs. |
| 12 | 12 | ||
| @@ -506,6 +506,11 @@ Uses variables `tcl-proc-regexp' and `tcl-keyword-list'." | |||
| 506 | () | 506 | () |
| 507 | (tcl-set-font-lock-keywords)) | 507 | (tcl-set-font-lock-keywords)) |
| 508 | 508 | ||
| 509 | |||
| 510 | (defvar tcl-imenu-generic-expression | ||
| 511 | '((nil "^proc[ \t]+\\([-A-Za-z0-9_:+*]+\\)" 1)) | ||
| 512 | "Imenu generic expression for `tcl-mode'. See `imenu-generic-expression'.") | ||
| 513 | |||
| 509 | 514 | ||
| 510 | 515 | ||
| 511 | ;; | 516 | ;; |
| @@ -549,8 +554,10 @@ Commands: | |||
| 549 | (set (make-local-variable 'paragraph-start) "$\\|") | 554 | (set (make-local-variable 'paragraph-start) "$\\|") |
| 550 | (set (make-local-variable 'paragraph-separate) paragraph-start) | 555 | (set (make-local-variable 'paragraph-separate) paragraph-start) |
| 551 | 556 | ||
| 552 | (set (make-local-variable 'paragraph-ignore-fill-prefix) t) | 557 | (unless (and (boundp 'filladapt-mode) filladapt-mode) |
| 553 | (set (make-local-variable 'fill-paragraph-function) 'tcl-do-fill-paragraph) | 558 | (set (make-local-variable 'paragraph-ignore-fill-prefix) t) |
| 559 | (set (make-local-variable 'fill-paragraph-function) | ||
| 560 | 'tcl-do-fill-paragraph)) | ||
| 554 | 561 | ||
| 555 | (set (make-local-variable 'indent-line-function) 'tcl-indent-line) | 562 | (set (make-local-variable 'indent-line-function) 'tcl-indent-line) |
| 556 | (set (make-local-variable 'comment-indent-function) 'tcl-comment-indent) | 563 | (set (make-local-variable 'comment-indent-function) 'tcl-comment-indent) |
| @@ -571,8 +578,8 @@ Commands: | |||
| 571 | (font-lock-syntactic-keywords . tcl-font-lock-syntactic-keywords) | 578 | (font-lock-syntactic-keywords . tcl-font-lock-syntactic-keywords) |
| 572 | (parse-sexp-lookup-properties . t))) | 579 | (parse-sexp-lookup-properties . t))) |
| 573 | 580 | ||
| 574 | (set (make-local-variable 'imenu-create-index-function) | 581 | (set (make-local-variable 'imenu-generic-expression) |
| 575 | 'tcl-imenu-create-index-function) | 582 | 'tcl-imenu-generic-expression) |
| 576 | 583 | ||
| 577 | ;; Settings for new dabbrev code. | 584 | ;; Settings for new dabbrev code. |
| 578 | (set (make-local-variable 'dabbrev-case-fold-search) nil) | 585 | (set (make-local-variable 'dabbrev-case-fold-search) nil) |
| @@ -987,23 +994,6 @@ Returns nil if line starts inside a string, t if in a comment." | |||
| 987 | ;; Interfaces to other packages. | 994 | ;; Interfaces to other packages. |
| 988 | ;; | 995 | ;; |
| 989 | 996 | ||
| 990 | (defun tcl-imenu-create-index-function () | ||
| 991 | "Generate alist of indices for `imenu'." | ||
| 992 | (let ((re (concat tcl-proc-regexp "\\([^ \t\n{]+\\)")) | ||
| 993 | alist prev-pos) | ||
| 994 | (goto-char (point-min)) | ||
| 995 | (imenu-progress-message prev-pos 0) | ||
| 996 | (save-match-data | ||
| 997 | (while (re-search-forward re nil t) | ||
| 998 | (imenu-progress-message prev-pos) | ||
| 999 | ;; Position on start of proc name, not beginning of line. | ||
| 1000 | (setq alist (cons | ||
| 1001 | (cons (buffer-substring (match-beginning 2) (match-end 2)) | ||
| 1002 | (match-beginning 2)) | ||
| 1003 | alist)))) | ||
| 1004 | (imenu-progress-message prev-pos 100) | ||
| 1005 | (nreverse alist))) | ||
| 1006 | |||
| 1007 | ;; FIXME Definition of function is very ad-hoc. Should use | 997 | ;; FIXME Definition of function is very ad-hoc. Should use |
| 1008 | ;; beginning-of-defun. Also has incestuous knowledge about the | 998 | ;; beginning-of-defun. Also has incestuous knowledge about the |
| 1009 | ;; format of tcl-proc-regexp. | 999 | ;; format of tcl-proc-regexp. |
| @@ -1108,7 +1098,7 @@ Prefix argument means switch to the Tcl buffer afterwards." | |||
| 1108 | (define-derived-mode inferior-tcl-mode comint-mode "Inferior Tcl" | 1098 | (define-derived-mode inferior-tcl-mode comint-mode "Inferior Tcl" |
| 1109 | "Major mode for interacting with Tcl interpreter. | 1099 | "Major mode for interacting with Tcl interpreter. |
| 1110 | 1100 | ||
| 1111 | A Tcl process can be started with M-x inferior-tcl. | 1101 | You can start a Tcl process with \\[inferior-tcl]. |
| 1112 | 1102 | ||
| 1113 | Entry to this mode runs the normal hooks `comint-mode-hook' and | 1103 | Entry to this mode runs the normal hooks `comint-mode-hook' and |
| 1114 | `inferior-tcl-mode-hook', in that order. | 1104 | `inferior-tcl-mode-hook', in that order. |