From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilya Shlyakhter Subject: [PATCH] imenu: Added a check that looking-at succeeds before using the match results. Date: Thu, 8 Mar 2012 14:34:13 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf307d03706b463104bac05c50 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5j6Q-00063u-1W for emacs-orgmode@gnu.org; Thu, 08 Mar 2012 14:34:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5j6O-00071k-9u for emacs-orgmode@gnu.org; Thu, 08 Mar 2012 14:34:17 -0500 Received: from mail-vx0-f169.google.com ([209.85.220.169]:34082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5j6O-00071b-29 for emacs-orgmode@gnu.org; Thu, 08 Mar 2012 14:34:16 -0500 Received: by vcbfk14 with SMTP id fk14so816496vcb.0 for ; Thu, 08 Mar 2012 11:34:13 -0800 (PST) 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 --20cf307d03706b463104bac05c50 Content-Type: text/plain; charset=ISO-8859-1 * 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 --20cf307d03706b463104bac05c50 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: base64 KiBsaXNwL29yZy5lbCAob3JnLWltZW51LWdldC10cmVlKTogQ2hlY2sgdGhhdCBsb29raW5nLWF0 IHN1Y2NlZWRzIGJlZm9yZSB1c2luZyBtYXRjaCByZXN1bHRzLqCgoKCgoKCgoKCgoKCgoKCgoKCg oKCgoKCgoKCgoKCgoKAgPGJyPqCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCg oKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCg oKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgIDxicj4KVElOWUNIQU5HRaCgoKCgoKCg oKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCg oKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKAgPGJy Pi0tLTxicj6gbGlzcC9vcmcuZWwgfKCgoCA0ICsrLS2goKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCg oKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCg oKCgoKCgoKCgoKCgoKCgoKCgoKCgoCA8YnI+CqAxIGZpbGUgY2hhbmdlZCwgMiBpbnNlcnRpb25z KCspLCAyIGRlbGV0aW9ucygtKaCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCg oKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgIDxicj6goKCgoKCgoKCg oKCgoKCgoKCgoKCgoKCgoKCgo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