emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ilya Shlyakhter <ilya_shl@alum.mit.edu>
To: emacs-orgmode@gnu.org
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	[thread overview]
Message-ID: <jjb7p4$akb$1@dough.gmane.org> (raw)
In-Reply-To: <87pqcmg9vs.fsf@Rainer.invalid>

[-- Attachment #1: Type: text/plain, Size: 169 bytes --]

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

[-- Attachment #2: imenu.patch --]
[-- Type: text/plain, Size: 1017 bytes --]

From e3e6e7135663fb34a5318565e5663dd27fa7ce45 Mon Sep 17 00:00:00 2001
From: Ilya Shlyakhter <ilya_shl@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	other threads:[~2012-03-08 21:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-08 19:34 [PATCH] imenu: Added a check that looking-at succeeds before using the match results Ilya Shlyakhter
2012-03-08 19:39 ` Achim Gratz
2012-03-08 21:19   ` Ilya Shlyakhter [this message]
2012-03-20 10:51     ` Bastien

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to='jjb7p4$akb$1@dough.gmane.org' \
    --to=ilya_shl@alum.mit.edu \
    --cc=emacs-orgmode@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).