/[emacs]/emacs/lisp/progmodes/tcl.el
ViewVC logotype

Diff of /emacs/lisp/progmodes/tcl.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.67 by rms, Fri Mar 29 12:47:57 2002 UTC revision 1.68 by rms, Mon Apr 1 20:18:48 2002 UTC
# Line 506  Uses variables `tcl-proc-regexp' and `tc Line 506  Uses variables `tcl-proc-regexp' and `tc
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  ;;  ;;
# Line 549  Commands: Line 554  Commands:
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)
# Line 571  Commands: Line 578  Commands:
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)
# Line 987  Returns nil if line starts inside a stri Line 994  Returns nil if line starts inside a stri
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.
# Line 1108  Prefix argument means switch to the Tcl Line 1098  Prefix argument means switch to the Tcl
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.

Legend:
Removed from v.1.67  
changed lines
  Added in v.1.68

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26