From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: [PATCH] Add org-goto-first-child Date: Wed, 15 Sep 2010 08:07:58 +0530 Message-ID: <81lj733f5l.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from [140.186.70.92] (port=58281 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ovht8-0005mD-SO for emacs-orgmode@gnu.org; Tue, 14 Sep 2010 22:38:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ovht6-0002wV-Oh for emacs-orgmode@gnu.org; Tue, 14 Sep 2010 22:38:22 -0400 Received: from mail-px0-f169.google.com ([209.85.212.169]:64408) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ovht6-0002wR-KG for emacs-orgmode@gnu.org; Tue, 14 Sep 2010 22:38:20 -0400 Received: by pxi5 with SMTP id 5so5237821pxi.0 for ; Tue, 14 Sep 2010 19:38:19 -0700 (PDT) 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 --=-=-= Add org-goto-first-child. Completes existing set of org tree traversal functions. --=-=-= Content-Disposition: inline >From ee430632f0d5088ed71f0d8ae48bac43f4d6208c Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Wed, 15 Sep 2010 08:00:41 +0530 Subject: [PATCH] Add org-goto-first-child * lisp/org.el (org-goto-first-child): New Completes existing set of org tree traversal functions. TINYCHANGE. --- lisp/org.el | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 70dd482..c2e6253 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -19200,6 +19200,18 @@ move point." (while (org-goto-sibling 'previous) (org-flag-heading nil)))) +(defun org-goto-first-child () + "Goto the first child, even if it is invisible. +Return t when a child was found. Otherwise don't move point and +return nil." + (let (level (pos (point)) (re (concat "^" outline-regexp))) + (when (condition-case nil (org-back-to-heading t) (error nil)) + (setq level (outline-level)) + (forward-char 1) + (if (and (re-search-forward re nil t) (> (outline-level) level)) + (progn (goto-char (match-beginning 0)) t) + (goto-char pos) nil)))) + (defun org-show-hidden-entry () "Show an entry where even the heading is hidden." (save-excursion -- 1.7.0.4 --=-=-= Jambunathan K. --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--