From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suvayu Ali Subject: Re: a new way to navigate your org files Date: Sun, 24 Apr 2011 13:24:04 -0700 Message-ID: <20110424132404.7d7f6a19@bhishma.homelinux.net> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/VASrqrZ9BtcmJ8UoMFQuKAS" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:36126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QE5qn-0002dE-6a for emacs-orgmode@gnu.org; Sun, 24 Apr 2011 16:24:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QE5qm-0003MU-BQ for emacs-orgmode@gnu.org; Sun, 24 Apr 2011 16:24:13 -0400 Received: from mail-pw0-f41.google.com ([209.85.160.41]:60846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QE5qm-0003MD-6b for emacs-orgmode@gnu.org; Sun, 24 Apr 2011 16:24:12 -0400 Received: by pwi10 with SMTP id 10so1553833pwi.0 for ; Sun, 24 Apr 2011 13:24:10 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Tom Cc: emacs-orgmode@gnu.org --MP_/VASrqrZ9BtcmJ8UoMFQuKAS Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Tom, On Sun, 24 Apr 2011 16:06:05 +0000 (UTC) Tom wrote: > I use org goto to jump quckly to headings, but the other day > I forgot the name of the heading, but I remembered its contents. > I thought it could be useful if I could navigate org files by content > too, so I quickly created this package as a sunday afternoon fun. > > It is a wrapper around the multi-occur interface, so you can > simply type your search pattern and the occur results from your org > buffers are updated dynamically as you type. This is very useful. I made some enhancements in the attached patches. The first one adds a very basic minibuffer history. You can navigate the history by the usual `M-p' and `M-n'. The second patch fixes an issue, now you can go to the first match by just hitting `RET' instead of ` RET'. Thanks a lot for writing this. :) -- Suvayu Open source is the future. It sets us free. --MP_/VASrqrZ9BtcmJ8UoMFQuKAS Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-Add-minibuffer-history-to-org-occur-goto.patch >From 08c35bcf7cc3b290f8421236c4bc5e3345398ff0 Mon Sep 17 00:00:00 2001 From: Suvayu Ali Date: Sun, 24 Apr 2011 12:20:27 -0700 Subject: [PATCH 1/2] Add minibuffer history to org-occur-goto --- lisp/org-occur-goto.el | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lisp/org-occur-goto.el b/lisp/org-occur-goto.el index e2af3fb..ccef330 100644 --- a/lisp/org-occur-goto.el +++ b/lisp/org-occur-goto.el @@ -90,7 +90,7 @@ (unwind-protect (let ((minibuffer-local-map oog-map)) - (read-string "string: ")) + (read-string "string: " nil 'oog-history-list)) (remove-hook 'post-command-hook 'oog-check-input)) -- 1.7.3.4 --MP_/VASrqrZ9BtcmJ8UoMFQuKAS Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0002-oog-can-got-to-first-match-by-hitting-RET.patch >From 1742551e8e19abaa272e444fa8c27afd76a7e6b8 Mon Sep 17 00:00:00 2001 From: Suvayu Ali Date: Sun, 24 Apr 2011 13:10:19 -0700 Subject: [PATCH 2/2] oog: can got to first match by hitting RET --- lisp/org-occur-goto.el | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/lisp/org-occur-goto.el b/lisp/org-occur-goto.el index ccef330..7398daf 100644 --- a/lisp/org-occur-goto.el +++ b/lisp/org-occur-goto.el @@ -98,7 +98,10 @@ (if buf (with-current-buffer buf (unless (= (buffer-size) 0) - (setq marker (occur-mode-find-occurrence))))))) + (setq marker (if (eq (line-number-at-pos (point)) 1) + (progn (forward-line) + (occur-mode-find-occurrence)) + (occur-mode-find-occurrence)))))))) (switch-to-buffer (marker-buffer marker)) (goto-char marker) -- 1.7.3.4 --MP_/VASrqrZ9BtcmJ8UoMFQuKAS--