aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Tromey1995-07-09 01:07:57 +0000
committerTom Tromey1995-07-09 01:07:57 +0000
commit8ebb39c016ef40df3fce7f05bbd2f025d962224a (patch)
tree2cbc7bbbb0903976ea5c04fbb33f4790c39707a7
parentfdb3286ede1cb01161cf334db7695f2029bbc873 (diff)
downloademacs-8ebb39c016ef40df3fce7f05bbd2f025d962224a.tar.gz
emacs-8ebb39c016ef40df3fce7f05bbd2f025d962224a.zip
(tcl-imenu-create-index-function): Work with imenu from Emacs 19.29
-rw-r--r--lisp/progmodes/tcl.el30
1 files changed, 17 insertions, 13 deletions
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el
index abb6ca403f3..c4c280cd678 100644
--- a/lisp/progmodes/tcl.el
+++ b/lisp/progmodes/tcl.el
@@ -6,7 +6,7 @@
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.34 $ 9;; Version: $Revision: 1.35 $
10 10
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12 12
@@ -51,7 +51,7 @@
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/06/27 20:06:05 $|$Revision: 1.34 $|~/modes/tcl.el.Z| 54;; $Date: 1995/06/27 20:12:00 $|$Revision: 1.35 $|~/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
@@ -65,6 +65,9 @@
65 65
66;; Change log: 66;; Change log:
67;; $Log: tcl.el,v $ 67;; $Log: tcl.el,v $
68;; Revision 1.35 1995/06/27 20:12:00 tromey
69;; (tcl-type-alist): More itcl changes.
70;;
68;; Revision 1.34 1995/06/27 20:06:05 tromey 71;; Revision 1.34 1995/06/27 20:06:05 tromey
69;; More changes for itcl. 72;; More changes for itcl.
70;; Bug fixes for Emacs 19.29. 73;; Bug fixes for Emacs 19.29.
@@ -313,7 +316,7 @@
313 (require 'imenu)) 316 (require 'imenu))
314 ())) 317 ()))
315 318
316(defconst tcl-version "$Revision: 1.34 $") 319(defconst tcl-version "$Revision: 1.35 $")
317(defconst tcl-maintainer "Tom Tromey <tromey@drip.colorado.edu>") 320(defconst tcl-maintainer "Tom Tromey <tromey@drip.colorado.edu>")
318 321
319;; 322;;
@@ -1351,17 +1354,18 @@ Returns nil if line starts inside a string, t if in a comment."
1351(defun tcl-imenu-create-index-function () 1354(defun tcl-imenu-create-index-function ()
1352 "Generate alist of indices for imenu." 1355 "Generate alist of indices for imenu."
1353 (let ((re (concat tcl-proc-regexp "\\([^ \t\n{]+\\)")) 1356 (let ((re (concat tcl-proc-regexp "\\([^ \t\n{]+\\)"))
1354 alist) 1357 alist prev-pos)
1355 (imenu-progress-message 0)
1356 (goto-char (point-min)) 1358 (goto-char (point-min))
1357 (while (re-search-forward re nil t) 1359 (imenu-progress-message prev-pos 0)
1358 (imenu-progress-message nil) 1360 (save-match-data
1359 ;; Position on start of proc name, not beginning of line. 1361 (while (re-search-forward re nil t)
1360 (setq alist (cons 1362 (imenu-progress-message prev-pos)
1361 (cons (buffer-substring (match-beginning 2) (match-end 2)) 1363 ;; Position on start of proc name, not beginning of line.
1362 (match-beginning 2)) 1364 (setq alist (cons
1363 alist))) 1365 (cons (buffer-substring (match-beginning 2) (match-end 2))
1364 (imenu-progress-message 100) 1366 (match-beginning 2))
1367 alist))))
1368 (imenu-progress-message prev-pos 100)
1365 (nreverse alist))) 1369 (nreverse alist)))
1366 1370
1367;; FIXME Definition of function is very ad-hoc. Should use 1371;; FIXME Definition of function is very ad-hoc. Should use