emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] re-search and org-link


From: Christopher Suckling
Subject: [Orgmode] re-search and org-link
Date: Wed, 21 Jan 2009 14:17:22 +0000

I currently use the following hook to achieve the level of detail I like from a sparse tree:

(add-hook 'org-occur-hook
          (lambda ()
            (goto-char (point-max))
            (while
                (re-search-backward regexp nil t)
              (show-subtree)
              (org-cycle)
              (org-cycle))))

I combine this hook with

(setq org-show-following-heading nil)
(setq org-show-entry-below t)

This works great unless regexp is within a fontified org-link. Then Emacs hangs and I get the OS X spinning beach-ball.

There is a very easy workaround as re-search-backward has no problem with an org-link if font-locking is turned off for the buffer:

(add-hook 'org-occur-hook
          (lambda ()
            (goto-char (point-max))
            (font-lock-mode)
            (while
                (re-search-backward regexp nil t)
              (show-subtree)
              (org-cycle)
              (org-cycle))
            (font-lock-mode)))

Practically, I'm content with my solution, but I thought I'd mention it should the bug lie within the org-link code and bite anyone else in other situations.

OS X 10.5.6, Emacs 23.0.60.1 (NS), Org-mode 6.18c

Best wishes,

Christopher







reply via email to

[Prev in Thread] Current Thread [Next in Thread]