From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: Re: Speed commands Date: Sat, 14 Nov 2009 10:48:00 -0500 Message-ID: <87tywx2jm7.fsf@stats.ox.ac.uk> References: <87aayqfh8a.wl%ucecesf@ucl.ac.uk> <8D1991FE-E04A-41DF-8919-C72E4EA9AFF1@uva.nl> <4AFDB0AB.9040607@cs.tu-berlin.de> <78C217F4-D3EA-46BA-A237-CA0E54216D5E@uva.nl> <87eio14s0y.fsf@stats.ox.ac.uk> <87my2ph7ci.fsf@in-ulm.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N9KrH-0007FS-56 for emacs-orgmode@gnu.org; Sat, 14 Nov 2009 10:48:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N9KrB-0007El-LF for emacs-orgmode@gnu.org; Sat, 14 Nov 2009 10:48:13 -0500 Received: from [199.232.76.173] (port=37592 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N9KrB-0007Ei-Ep for emacs-orgmode@gnu.org; Sat, 14 Nov 2009 10:48:09 -0500 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:50889) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N9KrA-0006sR-TY for emacs-orgmode@gnu.org; Sat, 14 Nov 2009 10:48:09 -0500 In-Reply-To: <87my2ph7ci.fsf@in-ulm.de> (Benjamin Andresen's message of "Sat, 14 Nov 2009 08:51:41 +0100") 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: Benjamin Andresen Cc: Emacs-orgmode mailing list Benjamin Andresen writes: > Hey Dan, > > Dan Davison writes: > >> (unless (org-heading-has-child-p) (org-cycle)) > > There is no function by the name of org-heading-has-child-p in the > current org-mode tree. I'd like to try the above code. Thanks Benny. Here's a new version. There could also be a reverse direction version if people think this might be useful. ----------------------------------------------------------- (defun ded/org-show-next-heading-tidily () "Show next entry, keeping all other entries closed." (if (save-excursion (end-of-line) (outline-invisible-p)) (org-cycle) (let ((pos (point)) (level (org-current-level)) (next-level (progn (outline-next-heading) (org-current-level)))) (cond ((< next-level level) (save-excursion (outline-backward-same-level 1) (org-cycle))) ((= next-level level) (save-excursion (goto-char pos) (org-cycle)))) (if (and (bolp) (org-on-heading-p)) (org-cycle) (outline-up-heading 1 t) (org-cycle) (error "Boundary reached"))))) (setq org-use-speed-commands t) (add-to-list 'org-speed-commands-user '(" " ded/org-show-next-heading-tidily)) ----------------------------------------------------------- Dan > >> >> Dan > > br, > benny > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode