emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ilya Shlyakhter <ilya_shl@alum.mit.edu>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: [PATCH] imenu: Added a check that looking-at succeeds before using the match results.
Date: Thu, 8 Mar 2012 14:34:13 -0500	[thread overview]
Message-ID: <CACfYvRZ6uD_VQF9Nuocx-dNQx1ATa_zN1jaJJ1AYNXznhcEGAw@mail.gmail.com> (raw)

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

* 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

[-- Attachment #2: Type: text/html, Size: 3044 bytes --]

             reply	other threads:[~2012-03-08 19:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-08 19:34 Ilya Shlyakhter [this message]
2012-03-08 19:39 ` [PATCH] imenu: Added a check that looking-at succeeds before using the match results Achim Gratz
2012-03-08 21:19   ` Ilya Shlyakhter
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=CACfYvRZ6uD_VQF9Nuocx-dNQx1ATa_zN1jaJJ1AYNXznhcEGAw@mail.gmail.com \
    --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).