From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephan Schmitt Subject: Re: Speed commands Date: Fri, 20 Nov 2009 19:13:11 +0100 Message-ID: <4B06DC37.2020107@cs.tu-berlin.de> 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> <20091120143546.GA1227@taupan.ath.cx> <95E34029-6EF2-4E77-B303-37676E5FA79F@gmail.com> <87lji16s33.wl%ucecesf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBY0Z-0005jX-Fw for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 13:14:59 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBY0V-0005j5-Us for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 13:14:59 -0500 Received: from [199.232.76.173] (port=41954 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBY0V-0005j1-Pr for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 13:14:55 -0500 Received: from mail.cs.tu-berlin.de ([130.149.17.13]:61509) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NBY0V-0005Zs-0A for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 13:14:55 -0500 Received: from localhost (localhost [127.0.0.1]) by localhost-12225.cs.tu-berlin.de (Postfix) with ESMTP id A3A6D30AA0 for ; Fri, 20 Nov 2009 19:14:33 +0100 (MET) In-Reply-To: <87lji16s33.wl%ucecesf@ucl.ac.uk> 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: e.fraga@ucl.ac.uk Cc: emacs-orgmode@gnu.org, Carsten Dominik Hi Eric, try this: (progn (org-cycle-agenda-files) (when (not (and (bolp) (org-on-heading-p))) (outline-previous-visible-heading 1) (or (and (bolp) (org-on-heading-p)) (outline-next-visible-heading 1)))) Greetings, Stephan Also sprach Eric S Fraga: > At Fri, 20 Nov 2009 15:57:09 +0100, > Carsten Dominik wrote: >> This is nice, but I guess you want to stay in fast-key space. >> So >> >> ("," . (progn (org-cycle-agenda-files) >> (or (and (bolp) (org-on-heading-p)) >> (outline-next-visible-heading 1)))) > > This is really nice and works like a charm... *except* in a very > extreme case: one of my agenda files is typically empty other than a > single top level heading. When I cycle through the agenda files, when > I land in this file, I am typically placed at the end of the file > (emacs remembers my last location). When this happens, speed keys are > no longer active and, before I know it, I have a number of ',' added > to the end of this file! > > Actually, I guess this problem generalises so that it would appear > whenever the cycling takes you to a file where the current point is at > the end (or near the end) of the file so there is actually no "next" > heading? Maybe the or statement above needs another clause (which I > unfortunately cannot suggest; sorry!). > > > _______________________________________________ > 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