From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: revealing context in org-occur-in-agenda-files Date: Wed, 23 Jan 2008 17:16:43 +0100 Message-ID: <571EA2A5-A891-49B6-88D0-7CD0397D90A3@science.uva.nl> References: <20080123101947.GS18716@atlantic.linksys.moosehall> <092A5A20-00B3-4488-B4CA-281715BCE7A3@science.uva.nl> <20080123110816.GU18716@atlantic.linksys.moosehall> Mime-Version: 1.0 (Apple Message framework v915) 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 1JHjzO-00054U-Ci for emacs-orgmode@gnu.org; Wed, 23 Jan 2008 13:06:18 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JHjzM-00051n-WD for emacs-orgmode@gnu.org; Wed, 23 Jan 2008 13:06:17 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JHjzM-00051Y-Su for emacs-orgmode@gnu.org; Wed, 23 Jan 2008 13:06:16 -0500 Received: from nf-out-0910.google.com ([64.233.182.184]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JHjzM-0005Ky-Ba for emacs-orgmode@gnu.org; Wed, 23 Jan 2008 13:06:16 -0500 Received: by nf-out-0910.google.com with SMTP id f5so582828nfh.26 for ; Wed, 23 Jan 2008 10:06:15 -0800 (PST) In-Reply-To: <20080123110816.GU18716@atlantic.linksys.moosehall> 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: Adam Spiers Cc: org-mode mailing list On Jan 23, 2008, at 12:08 PM, Adam Spiers wrote: > On Wed, Jan 23, 2008 at 11:52:39AM +0100, Carsten Dominik wrote: >> The same problem exists with normal `M-x occur'. >> >> Fixing this would require advising a number of occur functions. > > Ah of course, I hadn't twigged that it just uses occur-mode. > >> Maybe it is better to to define a new hook for the occur commands >> that we then can use for this. I'll look into it. Very likely >> this will work in 5.20, but it will require a fresh CVS Emacs. > > I'd rather have the advice to save switching to CVS emacs on all my > computers, but then I'm selfish ;-) Thanks a lot whichever you > choose. I am afraid I will go the way of creating a hook, this is more consistent and will work better for the different functions involved. Of course, you can fix this for yourself. For example (untested): (defadvice occur-mode-goto-occurrence (after org-occur-reveal activate) (and (org-mode-p) (org-reveal))) (defadvice occur-mode-goto-occurrence-other-window (after org-occur-reveal activate) (and (org-mode-p) (org-reveal))) (defadvice occur-mode-display-occurrence (after org-occur-reveal activate) (when (org-mode-p) (let ((pos (occur-mode-find-occurrence))) (with-current-buffer (marker-buffer pos) (save-excursion (goto-char pos) (org-reveal)))))) Let me know if this works for all three functions and if I have missed any other functions which need this. If it works, I'll put it into org.el as a temporary measure, untile the release of Emacs 23. - Carsten