Commit 8ebb39c0 authored by Tom Tromey's avatar Tom Tromey
Browse files

(tcl-imenu-create-index-function): Work with imenu from Emacs 19.29

parent fdb3286e
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
;; Author: Tom Tromey <tromey@busco.lanl.gov> ;; Author: Tom Tromey <tromey@busco.lanl.gov>
;; Chris Lindblad <cjl@lcs.mit.edu> ;; Chris Lindblad <cjl@lcs.mit.edu>
;; Keywords: languages tcl modes ;; Keywords: languages tcl modes
;; Version: $Revision: 1.34 $ ;; Version: $Revision: 1.35 $
;; This file is part of GNU Emacs. ;; This file is part of GNU Emacs.
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
;; LCD Archive Entry: ;; LCD Archive Entry:
;; tcl|Tom Tromey|tromey@busco.lanl.gov| ;; tcl|Tom Tromey|tromey@busco.lanl.gov|
;; Major mode for editing Tcl| ;; Major mode for editing Tcl|
;; $Date: 1995/06/27 20:06:05 $|$Revision: 1.34 $|~/modes/tcl.el.Z| ;; $Date: 1995/06/27 20:12:00 $|$Revision: 1.35 $|~/modes/tcl.el.Z|
;; CUSTOMIZATION NOTES: ;; CUSTOMIZATION NOTES:
;; * tcl-proc-list can be used to customize a list of things that ;; * tcl-proc-list can be used to customize a list of things that
...@@ -65,6 +65,9 @@ ...@@ -65,6 +65,9 @@
;; Change log: ;; Change log:
;; $Log: tcl.el,v $ ;; $Log: tcl.el,v $
;; Revision 1.35 1995/06/27 20:12:00 tromey
;; (tcl-type-alist): More itcl changes.
;;
;; Revision 1.34 1995/06/27 20:06:05 tromey ;; Revision 1.34 1995/06/27 20:06:05 tromey
;; More changes for itcl. ;; More changes for itcl.
;; Bug fixes for Emacs 19.29. ;; Bug fixes for Emacs 19.29.
...@@ -313,7 +316,7 @@ ...@@ -313,7 +316,7 @@
(require 'imenu)) (require 'imenu))
())) ()))
(defconst tcl-version "$Revision: 1.34 $") (defconst tcl-version "$Revision: 1.35 $")
(defconst tcl-maintainer "Tom Tromey <tromey@drip.colorado.edu>") (defconst tcl-maintainer "Tom Tromey <tromey@drip.colorado.edu>")
;; ;;
...@@ -1351,17 +1354,18 @@ Returns nil if line starts inside a string, t if in a comment." ...@@ -1351,17 +1354,18 @@ Returns nil if line starts inside a string, t if in a comment."
(defun tcl-imenu-create-index-function () (defun tcl-imenu-create-index-function ()
"Generate alist of indices for imenu." "Generate alist of indices for imenu."
(let ((re (concat tcl-proc-regexp "\\([^ \t\n{]+\\)")) (let ((re (concat tcl-proc-regexp "\\([^ \t\n{]+\\)"))
alist) alist prev-pos)
(imenu-progress-message 0)
(goto-char (point-min)) (goto-char (point-min))
(while (re-search-forward re nil t) (imenu-progress-message prev-pos 0)
(imenu-progress-message nil) (save-match-data
;; Position on start of proc name, not beginning of line. (while (re-search-forward re nil t)
(setq alist (cons (imenu-progress-message prev-pos)
(cons (buffer-substring (match-beginning 2) (match-end 2)) ;; Position on start of proc name, not beginning of line.
(match-beginning 2)) (setq alist (cons
alist))) (cons (buffer-substring (match-beginning 2) (match-end 2))
(imenu-progress-message 100) (match-beginning 2))
alist))))
(imenu-progress-message prev-pos 100)
(nreverse alist))) (nreverse alist)))
;; FIXME Definition of function is very ad-hoc. Should use ;; FIXME Definition of function is very ad-hoc. Should use
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment