From mboxrd@z Thu Jan 1 00:00:00 1970 From: Max Mikhanosha Subject: Re: FR: headline iteration API Date: Wed, 16 Jul 2008 11:06:04 -0400 Message-ID: <87prpdc1ib.wl%max@openchat.com> References: <20080530124619.GB9520@atlantic.linksys.moosehall> <9592BB6CDB1CEB48826BE86ACD71FA996ABF8D@kwik.ic.uva.nl> <20080611110623.GC19396@atlantic.linksys.moosehall> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KJ8v8-0001Fu-4T for emacs-orgmode@gnu.org; Wed, 16 Jul 2008 11:27:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KJ8v6-0001EM-SX for emacs-orgmode@gnu.org; Wed, 16 Jul 2008 11:27:57 -0400 Received: from [199.232.76.173] (port=58362 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KJ8v6-0001E2-M3 for emacs-orgmode@gnu.org; Wed, 16 Jul 2008 11:27:56 -0400 Received: from p84-72.acedsl.com ([66.114.84.72]:12424 helo=momoland.openchat.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KJ8v6-0002KQ-Aq for emacs-orgmode@gnu.org; Wed, 16 Jul 2008 11:27:56 -0400 Received: from momoland.openchat.com (localhost [127.0.0.1]) by momoland.openchat.com (Postfix) with ESMTP id 5D221F4A4ED9 for ; Wed, 16 Jul 2008 11:06:04 -0400 (EDT) In-Reply-To: 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: org-mode mailing list At Wed, 11 Jun 2008 12:15:11 -0500, Eddward DeVilla wrote: > - doc traversal > - first-item > Go to the first item in the file. > - current-item > Go to the beginning of the item containing the cursor. > - next-item > Go to the item after the current one. > - previous-item > Go to item before the current one Some time ago I wrote the following for myself, and I find that I use these bindings several times a day. (defun my-org-skip-forward (arg) "Move forward to the next visible 2nd or greater level heading, skipping headings of the same level as the starting position" (interactive "p") (let ((initial-level (org-outline-level)) (done nil)) (while (not done) (outline-next-visible-heading arg) (let ((level (org-outline-level))) (when (and (> initial-level 1) (= level 1)) (setq initial-level -1)) (setq done (or (and (< arg 0) (bobp)) (and (> arg 0) (eobp)) (and (not (= level initial-level))))))))) (defun my-org-skip-backward (arg) (interactive "p") (my-org-skip-forward (- arg))) The idea is that point is moved to the next visible boundary where outline level changes. This is useful when you have your file in collapsed state with only a few trees expanded. Above command allows one to quickly jump between such trees. Also useful for navigating result of a sparse tree search in the same manner. Regards, Max