On 3/8/2012 2:39 PM, Achim Gratz wrote:
Your patch got completely mangled, try again as an attachment of type
(text/plain).
here, also at http://ilya.cc/imenu.patch
>From e3e6e7135663fb34a5318565e5663dd27fa7ce45 Mon Sep 17 00:00:00 2001
From: Ilya Shlyakhter <ilya_...@alum.mit.edu>
Date: Thu, 8 Mar 2012 14:15:12 -0500
Subject: [PATCH] imenu: Added a check that looking-at succeeds before using
 the match results.

* lisp/org.el (org-imenu-get-tree): Check that looking-at succeeds before using 
match results.

TINYCHANGE
---
 lisp/org.el |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index ad63213..e4fb497 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -21250,8 +21250,8 @@ Show the heading too, if it is currently invisible."
        (goto-char (point-max))
        (while (re-search-backward re nil t)
          (setq level (org-reduced-level (funcall outline-level)))
-         (when (<= level n)
-           (looking-at org-complex-heading-regexp)
+         (when (and (<= level n)
+                    (looking-at org-complex-heading-regexp))
            (setq head (org-link-display-format
                        (org-match-string-no-properties 4))
                  m (org-imenu-new-marker))
-- 
1.7.9.3

Reply via email to