0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-07-15 16:16:26 +00:00

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
This commit is contained in:
Ilya Shlyakhter 2012-03-08 14:15:12 -05:00 committed by Bastien Guerry
parent 9c8cc41ae1
commit ca41982ad4

View file

@ -21048,8 +21048,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))