From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Suckling Subject: re-search and org-link Date: Wed, 21 Jan 2009 14:17:22 +0000 Message-ID: Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LPdta-0001xH-78 for emacs-orgmode@gnu.org; Wed, 21 Jan 2009 09:17:30 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LPdtZ-0001wm-Pj for emacs-orgmode@gnu.org; Wed, 21 Jan 2009 09:17:29 -0500 Received: from [199.232.76.173] (port=52784 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LPdtZ-0001wj-Kk for emacs-orgmode@gnu.org; Wed, 21 Jan 2009 09:17:29 -0500 Received: from mail-ew0-f20.google.com ([209.85.219.20]:63091) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LPdtY-0001I7-Ry for emacs-orgmode@gnu.org; Wed, 21 Jan 2009 09:17:29 -0500 Received: by ewy13 with SMTP id 13so1718190ewy.18 for ; Wed, 21 Jan 2009 06:17:26 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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