all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Fabian Ezequiel Gallina <galli.87@gmail.com>
To: Emacs-Devel devel <emacs-devel@gnu.org>
Subject: imenu issue from Bug #13438
Date: Mon, 21 Jan 2013 18:09:20 -0300	[thread overview]
Message-ID: <CABq4mQujvYARk=EjugSi9AQ2t-h2GiTRFOZjpQSJNrK9vWkh5g@mail.gmail.com> (raw)

Got a quick look at
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13438, in there I think
the problem is related to how `imenu-default-create-index-function'
detects infinite recursion. I this case, because the the point is at
the beginning of the latest available defun, the points doesn't move
and it throws the infinite loop error.

Here's a mindless quick patch that seems to fix the problem. I could
install it myself but I'd like some input first.


=== modified file 'lisp/imenu.el'
--- lisp/imenu.el       2013-01-01 09:11:05 +0000
+++ lisp/imenu.el       2013-01-21 21:03:57 +0000
@@ -683,7 +683,8 @@
           (goto-char (point-max))
           ;; Search for the function
           (while (funcall imenu-prev-index-position-function)
-             (when (= pos (point))
+             (when (and (= pos (point))
+                        (save-excursion (beginning-of-defun)))
                (error "Infinite loop at %s:%d:
imenu-prev-index-position-function does not move point" (buffer-name)
pos))
              (setq pos (point))
             (save-excursion



Regards,
Fabián



             reply	other threads:[~2013-01-21 21:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-21 21:09 Fabian Ezequiel Gallina [this message]
2013-01-22  1:07 ` imenu issue from Bug #13438 Stefan Monnier
2013-01-22 18:37   ` Fabian Ezequiel Gallina
2013-01-22 21:08     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABq4mQujvYARk=EjugSi9AQ2t-h2GiTRFOZjpQSJNrK9vWkh5g@mail.gmail.com' \
    --to=galli.87@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.