506 |
() |
() |
507 |
(tcl-set-font-lock-keywords)) |
(tcl-set-font-lock-keywords)) |
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 |
|
|
514 |
|
|
515 |
|
|
516 |
;; |
;; |
554 |
(set (make-local-variable 'paragraph-start) "$\\|") |
(set (make-local-variable 'paragraph-start) "$\\|") |
555 |
(set (make-local-variable 'paragraph-separate) paragraph-start) |
(set (make-local-variable 'paragraph-separate) paragraph-start) |
556 |
|
|
557 |
(set (make-local-variable 'paragraph-ignore-fill-prefix) t) |
(unless (and (boundp 'filladapt-mode) filladapt-mode) |
558 |
(set (make-local-variable 'fill-paragraph-function) 'tcl-do-fill-paragraph) |
(set (make-local-variable 'paragraph-ignore-fill-prefix) t) |
559 |
|
(set (make-local-variable 'fill-paragraph-function) |
560 |
|
'tcl-do-fill-paragraph)) |
561 |
|
|
562 |
(set (make-local-variable 'indent-line-function) 'tcl-indent-line) |
(set (make-local-variable 'indent-line-function) 'tcl-indent-line) |
563 |
(set (make-local-variable 'comment-indent-function) 'tcl-comment-indent) |
(set (make-local-variable 'comment-indent-function) 'tcl-comment-indent) |
578 |
(font-lock-syntactic-keywords . tcl-font-lock-syntactic-keywords) |
(font-lock-syntactic-keywords . tcl-font-lock-syntactic-keywords) |
579 |
(parse-sexp-lookup-properties . t))) |
(parse-sexp-lookup-properties . t))) |
580 |
|
|
581 |
(set (make-local-variable 'imenu-create-index-function) |
(set (make-local-variable 'imenu-generic-expression) |
582 |
'tcl-imenu-create-index-function) |
'tcl-imenu-generic-expression) |
583 |
|
|
584 |
;; Settings for new dabbrev code. |
;; Settings for new dabbrev code. |
585 |
(set (make-local-variable 'dabbrev-case-fold-search) nil) |
(set (make-local-variable 'dabbrev-case-fold-search) nil) |
994 |
;; Interfaces to other packages. |
;; Interfaces to other packages. |
995 |
;; |
;; |
996 |
|
|
|
(defun tcl-imenu-create-index-function () |
|
|
"Generate alist of indices for `imenu'." |
|
|
(let ((re (concat tcl-proc-regexp "\\([^ \t\n{]+\\)")) |
|
|
alist prev-pos) |
|
|
(goto-char (point-min)) |
|
|
(imenu-progress-message prev-pos 0) |
|
|
(save-match-data |
|
|
(while (re-search-forward re nil t) |
|
|
(imenu-progress-message prev-pos) |
|
|
;; Position on start of proc name, not beginning of line. |
|
|
(setq alist (cons |
|
|
(cons (buffer-substring (match-beginning 2) (match-end 2)) |
|
|
(match-beginning 2)) |
|
|
alist)))) |
|
|
(imenu-progress-message prev-pos 100) |
|
|
(nreverse alist))) |
|
|
|
|
997 |
;; FIXME Definition of function is very ad-hoc. Should use |
;; FIXME Definition of function is very ad-hoc. Should use |
998 |
;; beginning-of-defun. Also has incestuous knowledge about the |
;; beginning-of-defun. Also has incestuous knowledge about the |
999 |
;; format of tcl-proc-regexp. |
;; format of tcl-proc-regexp. |
1098 |
(define-derived-mode inferior-tcl-mode comint-mode "Inferior Tcl" |
(define-derived-mode inferior-tcl-mode comint-mode "Inferior Tcl" |
1099 |
"Major mode for interacting with Tcl interpreter. |
"Major mode for interacting with Tcl interpreter. |
1100 |
|
|
1101 |
A Tcl process can be started with M-x inferior-tcl. |
You can start a Tcl process with \\[inferior-tcl]. |
1102 |
|
|
1103 |
Entry to this mode runs the normal hooks `comint-mode-hook' and |
Entry to this mode runs the normal hooks `comint-mode-hook' and |
1104 |
`inferior-tcl-mode-hook', in that order. |
`inferior-tcl-mode-hook', in that order. |