From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilya Shlyakhter Subject: Re: [PATCH] imenu: Added a check that looking-at succeeds before using the match results. Date: Thu, 08 Mar 2012 16:19:32 -0500 Message-ID: References: <87pqcmg9vs.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050301060805020905070507" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5kkU-0005Ou-Nl for emacs-orgmode@gnu.org; Thu, 08 Mar 2012 16:19:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5kkS-00029x-NC for emacs-orgmode@gnu.org; Thu, 08 Mar 2012 16:19:46 -0500 Received: from plane.gmane.org ([80.91.229.3]:59432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5kkS-00029o-G3 for emacs-orgmode@gnu.org; Thu, 08 Mar 2012 16:19:44 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1S5kkQ-00089A-Vs for emacs-orgmode@gnu.org; Thu, 08 Mar 2012 22:19:43 +0100 Received: from gw-outbound.broadinstitute.org ([69.173.127.45]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Mar 2012 22:19:42 +0100 Received: from ilya_shl by gw-outbound.broadinstitute.org with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Mar 2012 22:19:42 +0100 In-Reply-To: <87pqcmg9vs.fsf@Rainer.invalid> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------050301060805020905070507 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------050301060805020905070507 Content-Type: text/plain; name="imenu.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="imenu.patch" >From e3e6e7135663fb34a5318565e5663dd27fa7ce45 Mon Sep 17 00:00:00 2001 From: Ilya Shlyakhter 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 --------------050301060805020905070507--