kamphausen / novelscience.com (SKa) writes:
> My problem is with imenu which is used by gnu emacs and by xemacs when
> using the speedbar. Since the speedbar is just wonderful I'd really
> like to use it, but it get's confused when there is more than one
> class definition in a file. When you try to start M-x imenu it just
> runs and runs and the memory print of xemacs is getting bigger and
> bigger.
I have looked at it and it appears to be a little bug there - if class
is empty (i.e it has no functions defined) - it's added to
imenu-index-alist infinitely.   
> 
> Does anybody already have a solution to this, or do I have to look at
> it myself?
Here's a patch.

BASH.EXE-2.02$ diff -u ruby-mode.el~ ruby-mode.el
--- ruby-mode.el~       Sun Aug 26 21:14:04 2001
+++ ruby-mode.el        Thu Oct 11 12:03:14 2001
@@ -137,7 +137,7 @@
        (ruby-mark-defun)
        (save-restriction
          (narrow-to-region (region-beginning) (region-end))
-         (while (re-search-forward "^\\s *def\\s *\\([^(\n ]+\\)" nil t)
+         (while (re-search-forward "^\\s *def\\s *\\([^(\n ]+\\)" nil 'move)
            (setq method-begin (match-beginning 1))
            (setq method-name (buffer-substring method-begin (match-end 1)))
            (push (cons (concat class-name "#" method-name) (match-beginning 0)) index-alist))))




Regards
--
Ed Sinjiashvili




> (it has been accepted as a patch) :-)
> 
> My problem is with imenu which is used by gnu emacs and by xemacs when
> using the speedbar. Since the speedbar is just wonderful I'd really
> like to use it, but it get's confused when there is more than one
> class definition in a file. When you try to start M-x imenu it just
> runs and runs and the memory print of xemacs is getting bigger and
> bigger.
> 
> Does anybody already have a solution to this, or do I have to look at
> it myself?
> 
> Regards
> Stefan Kamphausen
> 
> PS: A CC to kamphausen-at-novelscience-dot-com would be kind, because
> I'm reading this group just via google.